Wednesday, October 18, 2017

AWS S3 Transferring Data Across Accounts

  Today I successfully transferred some data on AWS S3 from one account to another. 
  In the process I resolved an encryption related permission issue, which has little information on google given the misleading error message. 
  So I decided to write this down to share with people who need help.

Goal:
Copy data from one S3 bucket to another S3 bucket.

Resources:
 - source account: "src_account"
 - source bucket: "src_bucket"
 - destination account: "dst_account"
 - destination bucket: "dst_bucket"
 - an instance with AWS CLI installed (can be your laptop too)


Steps(high level):
 - created a user on destination account.
 - grant the account with permissions:
   - read from source bucket, using "resource" field & ARN.
   - write to destination bucket.
 - grant this user read access from source bucket, using bucket policy, "principal" field and ARN
 - (if encryption required) grant destination account access to encryption key on source account
 - (if encryption required) grant permission on user to use the key for:
   - decryption. required for reading.
   - encryption. required for writing.


Steps(detailed):

 - create a user on destination account: <sync_user>
  Keep the account key and secret to set up CLI.

 - under IAM on destination account, attach a policy to <sync_user> with these statements:
        {
            "Sid": "AllowReadSource",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::<src_bucket>/*",
                "arn:aws:s3:::<src_bucket>"
            ]
        },
        {
            "Sid": "AllowWriteDestination",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3: PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::<dst_bucket>/*",
                "arn:aws:s3:::<dst_bucket>"
            ]
        }

 - under <src_bucket> permission tab, attach statements to bucket policy:
        {
            "Sid": "AllowReadOnlyOnFileForUser",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<dst_account>:user/<sync_user>"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::<src_bucket>/*"
        },
        {
            "Sid": "AllowReadOnlyOnDirectoryForUser",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<dst_account>:user/<sync_user>"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::<src_bucket>/*"
        }

Additional steps if encryption is required for bucket:

 - On source account, add external account to each encryption key used.
  IAM -> Encryption Keys -> Choose the right region -> Add External Account -> <dst_account>

 - On destination account, add another policy with following statements:
        {
            "Sid": "AllowUseOfTheKey",
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt",
                "kms:GenerateDataKey*"
            ],
            "Resource": [
                "arn:aws:kms:<region>:<src_account>:key/<key_id>"
            ]
        }
 - add another statement to destination bucket in bucket policy:
        {
            "Sid": "Ensure config is encrypted on upload",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::<dst_bucket>/*",
            "Condition": {
                "StringNotLike": {
                    "s3:x-amz-server-side-encryption-aws-kms-key-id": "arn:aws:kms:<region>:<src_account>:key/<key_id>"
                }
            }
        }
CLI:
 - add the created <sync_user> to CLI as a profile:
Note: the region needs to match the region of the KMS key used. (if any)
  aws configure --profile <sync_user>

Command:
If files inside the bucket requires server-side encryption:
  aws s3 cp s3://<src_bucket> s3://<dst_bucket> --recursive --sse aws:kms --sse-kms-key-id arn:aws:kms:<region>:<src_account>:key/<key_id> --profile=<aws-cli-sync-user-profile>

otherwise:
  aws s3 cp s3://<src_bucket> s3://<dst_bucket> --recursive --profile=<aws-cli-sync-user-profile>


Summary:
  This is a quite simple process and some online documents do a better job explaining the steps than I just did. 
  I did attach some of my own understanding for the steps to help you understand why each step is needed. And the permissions I used are the absolutely minimum set of permissions to do such things. You can find templates that works with more permissions, but I feel it's not necessary to grant this user with more permissions than needed.
  I spent a lot of time dealing with the encryption permission issue, since it was nowhere documented, and the error is surfaced as another permission deny. Took me a long time to figure out what was causing the issue. So I really wish this helps if you run into similar issues.

Note: encryption is done on a per-file level, and can be heterogenous within a single bucket. If you run into permission error with "GetObject" action, double check the file that's causing the issue to see if it has encryption enabled.

Tuesday, May 30, 2017

Performance between BoneCP and HikariCP



I've been assessing HikariCP as a replacement for BoneCP for my server in the past week, and the result is somewhat surprising to me.
Sharing it here in case other people were doing the same thing.

The short conclusion is: BoneCP is slightly faster than HikariCP.

Test environment:
 - BoneCP version: 0.8.0-RELEASE
 - HikariCP version: 2.6.1
 - Tested on 2 groups of servers located on Amazon AWS, with DB servers in the same availability zone.
 - The only difference in the version of jar deployed is the connection pooling library difference (as well as the configuration difference)

The variation in configuration does not seem to make a big difference.

Tested by using the recommended configuration from each library, and for
1st test: trying to map the configuration by meaning
2nd test: match number of connections per host

Both tests give me the same result: the measured wall time for HikariCP is constantly 1~2ms slower than using BoneCP.

This is tested on a live product which has >100K concurrent users all the time and the range of tested queries has covered a few benchmark tests.

For faster database queries, this can be pretty significant: running an indexed select queries from a table costs 1ms on avg for BoneCP group but 2ms for HikariCP

Similarly this affects other queries including inserts & updates & deletes. Due to the range of the queries I have, the difference is 1~2ms.

After reading through this:
https://github.com/brettwooldridge/HikariCP/wiki/Pool-Analysis

I started to wonder if it's the validation overhead that's causing the performance difference.

And the awesome developer for HikariCP told me there are ways to configure that:
https://github.com/brettwooldridge/HikariCP/issues/900

So I did a 3rd & 4th test by:
- increase the window of validation check from 500ms to 5s
- override the test connection query from using jdbc isValid method to a simple "SELECT 1"

Unfortunately the result is the same, and the difference is roughly the same too.
So the connection test is not the culprit for performance different, at least on my environment.

Although I think the validation check is good and should be there, I've stopped at this point because I know BoneCP would probably be my go-to option given the performance result.

For now I'm unable to explain the performance different, and that's what needs to be updated. I'll dig the source code a bit further when I have some more time to spend on this.

Tuesday, May 7, 2013

Progressive Photon Mapper

During the past few weeks I've been trying to write a new tracer. After careful consideration I choose to implement a progressive photon mapping integrator within my own architecture, which I simplified and customized based on the one in PRBT book.

Right now I have only a simple scene to show the result of the integrator, later I'll focus more on the other part of the tracer (bsdf, weighting system, sampling, performance etc).

Here's a comparison image of the PPM integrator

First one has only one photon gathering pass, and second with 10 photon gathering pass. Each pass has 200K photons.

Direct lighting and indirect light are not decoupled, which makes the most mathematical sense to me.
pass 1

pass 10

Well I just realized this is not convincing enough. I should do a comparison between 200K photons per pass with 10 pass and 2M photon with 1 pass, and that would be my next post with other features added.


Monday, February 18, 2013

New demo reel

I made a new demo reel yesterday, adding the projects I've been working on recently into it.

Here's my new reel:



Thursday, February 14, 2013

the game: Penguin Planet

Last semester (Fall 2012) I took the CIS 568: Game Design Practicum, and I'm working with Nop for a game in Unity3D.

We both love arcade games, so made a game called "Penguin Planet", which is similar to the arcade game "Fill It".

We collaborated to design all the aspects of this game, and lots of technologies are involved in this game in order to implement all the features included. We like it a lot and we're proud of it.


Here's a demo for our game:



And here's the link for downloading our game:
http://dl.dropbox.com/u/122536698/Penguin%20Planet%20Game.rar

Hope you enjoy it!

Implemented accurate solid-fluid interaction for my FLIP solver

For the past few days I've been working on my fluid simulation project.
I've incoporated Christ Batty's Siggraph 2007 paper into this project.

Here's a demo about the result:

generate levelset for stanford bunny, apply fast poisson disk sampling method to get 128k particles.
grid size 100 cubic.
used anisotropic kernel for surface reconstruction. 
pretty much include everything I've done for fluid simulation, except for marching cube.

Monday, February 4, 2013

Triangle mesh to level set

Well I had the idea for this project since last summer, but I did not put it into practice until today.

Level set field data is extremely useful in all kinds of simulation, especially in fluid simulation. Also level set is a good interface for blue noise sampling technique.

Generating level set for a implicit surface is easy, all you have to do is to calculate the function value, and it's always somehow related to the minimum distance(signed).

However, things are not that easy when it comes to general case. You'll always be given a triangle mesh(obj file or ply file) as input. The problem for triangle mesh to level set is: triangle mesh is not continuous.

For a single point-triangle minimum distance, it's sometimes ambiguous how to determine the sign of the distance. For those points within the prism of the triangle, judging sign is easy, but for the those who's nearest point is on edge or vertex, it's hard to determine the sign.

So the idea I had is to calculate normal for all vertices(if not given from input) and all edges. I'm using a weighted sum for all surfaces normal related to the vertex/edge. The weight is the incident angle.

By using this method, the sign of a certain point to an arbitrary triangle is obvious and easy to compute.

No one would like to compute the signed distance for all sample points against all triangles. Two possible solutions:
1. using spacial subdivision data structure like KD tree. calculating signed distance for each sample points in a local region.
2. going the other way around. splat each triangle to a certain neighbor region, forming a narrow-band level set, and propagate the date to the whole field.

The second one is obviously faster but technically harder meanwhile. Since I've already spend a lot of time implementing fast sweeping, this approach fits me better. In fact it took me only a few hours to finish this method.

It cost 3.6s to calculate the level set data of a Stanford bunny using a 105*104*82 grid, running on single core laptop without any optimization. I'm pretty satisfied with the performance, since this conversion has to be done only once off-line.

Here's a demo showing the result of the level set. In order to show the correctness of the data, I shrink the whole field by a certain rate.


Friday, January 25, 2013

Global Intersection Analysis: a great idea for collision detection

For the past few days I've been dedicated to solve the self-collision problem in cloth simulation, and here's some insights I've found for self-collision detection:

1. collisions are generated because of positions of vertices are changed. So ideally, assuming the cloth starts without any self-collision, a naive collision detection need to be performed as long as   all vertices are moved.

2. there're two types of collision: continuous collision and static collision.
    continuous collisions are detected by testing the trajectory against a surface. That is a ray-triangle intersection test for common case. The ray starts from the position of a vertex in last frame, and ends on the current position.
    static collisions are detected by testing whether a vertex is under a certain surface, which is testing signed distance of a vertex and a triangle in general case.

3. problem for cloth simulation: cloth is just one single sheet of mesh, which means there's no negative distance for vertex against triangle. So static collision detection would fail because in case like a vertex is below triangle, you cannot distinguish if it is penetrating from above or coming from below without penetration.

4. problem for PBD: as I mentioned before, ideally a naive collision detection(contains either one type of the collision detection) has to be performed once vertices are moved. If PBD is being used, the problem would arise because the positions of vertices are moved in the resolving constraints pass without performing collision detection per iteration.
    So as always is the case, some vertices are move into a certain surface by resolving constraints, while no collision are detected. In the following frame, this kind of collision will not be detected because continuous collision will not treat this one as a collision, while static collision fails because of cloth is too thin to have a negative value.

5. Possible solution: a. GIA(global intersection analysis). b. potential collision constraints.

a. GIA is proposed in this paper. Yet as mentioned in the paper, this method has limitations when it comes to a boundary-penetrating case. I had an idea for perfecting this method, by running flood-fill on both edge and surface.

b. potential collision constraints is the idea I come up with after these days. When doing intersection test, we set a proper threshold for particle-triangle intersection. And add potential collision constraints for resolving pass. They have not collide yet, but since the distance is smaller than the threshold, it's possible for them to collide in the resolving pass. So if they collide in the resolving path, collision will be corrected. Make sure all self-collisions are resolved before entering next frame, so that even the collision detection only support continuous collision, there won't be any problem.

These are two of my ideas, and I'll start a independent project on this. Since for the first idea I'm not sure how to implement it. There're too many topological things related. And for the second idea, I don't have any idea how to set a proper threshold.

Good luck to me!


Wednesday, January 23, 2013

Cloth Simulation using PBD

Recently I've been working on a cloth simulation project as a new homework assignment for CIS 563.

It turns out that cloth simulation is harder and thus more interesting than I imagined.

I'm following Matthias Muller's Position Based Dynamics paper for implementation. I've also done a solid simulation using another of his paper with similar idea. These ideas are really innovative. They do not make that much physical sense, but they follow physical laws, and most importantly, they are a lot faster than physically based method like mass-spring-damper system.

Here's a demo for the cloth simulation. Right now it does has stretch / bend / pinned point / collision constraints, but no self intersection has been taken into consideration.

In fact, the self-intersection is the most interesting part to me. Because the cloth is just a thin layer of unclosed mesh, it's impossible to define a collision with it: position would make sense on both side of the cloth.

I'm looking into this problem right now, following these papers:
http://www.cs.ubc.ca/~rbridson/docs/cloth2002.pdf
http://www.cs.ubc.ca/~rbridson/docs/cloth2003.pdf
http://graphics.pixar.com/library/UntanglingCloth/paper.pdf

Hopefully I can find some insights from these paper and improve this project in the following days.

Saturday, November 3, 2012

Fluid mechanics: continuity equation

In order to overcome the problem in FLIP solver, I looked into fluid mechanics.

It turns out the condition for incompressibility is not correct, or to say, based on an incorrect assumption.
For continuous fluid, the governing equation is called Continuity Equation
I'll skip the proving part of this equation, lots of reading materials could be found online discussing proving of this equation. In symbolic form, this equation could be expressed as:
Compare to the incompressible confinement, we could see, it's just assuming material derivative for density is 0. Yet this assumption is not correct if fluid cells are marked by the particles: temporay incoherence would lead to a non-zero density material derivative.

One big problem associated with adding this term to the confinement is, we'll have to deal with both time derivative and spacial gradient in the Eulerian grid.

So one of the possible solutions would be: combine SPH and FLIP together in this step. The density carried by each particle provides sufficient information for the material derivative. I'll keep on reading and thinking about other possible solutions.


Solution for compressibility problem in Eulerian method

As I mentioned before, FLIP solver suffers from compressibility problem. In fact, all the grid-based method might be suffering from comressibility problem.

You might consider me to be naive, but I'll try to convince you:

The grid based solver calculate the velocity field based on two formula:

1st is the Navier Stokes equation, 2nd is the incompressible constraint.

For grid solver, all the calculations are done based on one simple assumption:
all the fluid cells have the same density as the rest density.

And this is the key why these solvers are compressible. Though, it's just a small difference, which is hard to tell visually. This problem would become apparent in FLIP solver: with the same particle input, using different grid resolution would lead to different result, some shrink the volume(high resolution), some increase the volume(low resolution).

I tried to associate a density coefficient for each cell for the pressure solve, but it does not contribute. If you combine the rhow and p term in the 1st equation as a whole, you'll find out although the density coefficient would affect the value for pressure, when calculating back to velocity field, this term would be eliminated.

So I realize the problem lies in the second formula. There should be something more than just velocity field to conserve the volume.

It turns out I'm right. Well it's a pity that I found out someone has already done research into this before, or maybe I could be the first one.
With a simple search I found 2 papers dealing with this problem:
This one by Nuttapong Chentanez and Matthias Muller,
and this one by Michael Lentine, Mridul Aanjaneya and Ronald Fedkiw.

What is interesting is that what I've been doing always match these guys research. The papers I've been referring are always done by these names.

So next step: reading these papers and integrate into the FLIP solver. This might be useful for SPH as well, but I need to take a further look.


Tuesday, October 30, 2012

Flip solver update

for the past few days I've been working on this solver.

I imported the ghost sph sampler and anisotropic kernel part for surface reconstruction. This time everything was done with tbb(Thread Building Blocks), parallelizing all the particles. The performance is really satisfying: for 150K particles, the mesh reconstruction took less than 2 seconds per frame, including neighbor search, iterative matrix decomposition and color field gathering.

Compare to my previous implementation of this part, due to everything is done on the fly, the memory deallocation cost reduced drastically, and that is one of the major reason for boosting the performance.


However, I discovered a huge problem for this solver.
It is COMPRESSIBLE!
The error is introduced by particle advection. Within each single frame, the projection is ensured to be incompressible, however, after particles being advected, the number for fluid cells would change, and that is the reason why it is compressible.

With the 150k particle configuration, using 50*50*50 grid would lead to volume increasing, while 100*100*100 would shrink volume into a thin sheet.


In fact, setting the divergence to be free would not be sufficient for FLIP solver. Because the density(or mass) is carried with the particles, while for the grid solving part, there's no way in ensuring the density of each cell to be constant.

This problem could be alleviated with a certain grid size for a certain particle distribution. Yet only alleviation is possible, cause the particle and grid are kind of coupled in terms of density.

Right now I had an idea which might be useful for decoupling the two, but I need to take a further look into the physics and math.

I'll discuss with the author of FLIP paper, and hopefully I can find a better way for it soon.

Wednesday, October 24, 2012

FLIP solver done!

Finally finished the FLIP solver.

Right now it's a first version, so still, lots of details need to be improved.

A quick demo for the new solver is here.


Well I'll keep on working on this project and come up with way better polished demo.

Sunday, October 21, 2012

Fast sweeping

Still working on the FLIP solver.
The fast sweeping algorithm is significant for FLIP solver, in generating levelset data and extending velocity field.

Based on Hongkai Zhao's paper I implemented the fast sweeping algorithm for the FLIP solver.
However proving part for the paper was using 2d example. So I extended the proving part to 3D, and here's the scanned image of the proving(also the pseudo code for the core part is included).
Compared to the implementation I did during the summer, the current one would be more abstract because of I'm using the result of my own proving directly. As a result of which, the operation would be faster, because the number of comparison and numerical calculation are minimized.

As I always says, math and physics are real science compared to computer science. In my biased personal opinion, a huge difference between science and engineering is: science is continuous and engineering is discretized.

Thanks math and physics for always providing guidance for everything.
I really enjoy this kind of life, surrounded by science. Maybe I should go for a physics phd later. Seriously I'm not kidding.

Thursday, October 4, 2012

New solver for the fluid simulation project

SPH suffers from severe compressible problem. A combination of WCSPH( http://cg.informatik.uni-freiburg.de/publications/2007_SCA_SPH.pdf ) and PCISPH( http://dl.acm.org/citation.cfm?id=1531346 ) could be a good improvement of SPH. 

However, it's far from enough. It could be a good solution for the inner particles. while for the boundary particles(either in contact with air or solid), the pressure gathering is incorrect, which will lead to an artifact.

Ghost sph(http://www.cs.ubc.ca/~rbridson/docs/schechter-siggraph2012-ghostsph.pdf) to me is the best solution for improving the quality of SPH. But the problem is ghost sph is kind of expensive. The number of sample particles for the solids is usually much more than the fluid particles. And re-sampling ghost particles is not trivial task.

In order to solve the compressibility problem and maintain the details that particles bring about, I decided to turn to FLIP(http://www.cs.ubc.ca/~rbridson/docs/zhu-siggraph05-sandfluid.pdf) for help.

FLIP is a combination of Lagrangian method and Eulerian method. Particles are used for advection, which eliminates the numerical dissipation caused by Eulerian methods, and MACGrid is used for solving the Poisson equation, which solve the pressure distribution problem perfectly.

For the past few days I've been reading lots of papers related to Eulerian fluid simulation, including Robert Bridson's book: Fluid Simulation for Computer Graphics. And finally I got a good understanding of each steps that is necessary for FLIP solver.

I'll list my understanding of the core steps in FLIP solver here:

1. transfer velocity from particles to grid. The grid is only used for solving the pressure distribution, so only the velocity field is needed. The way used for transferring is splatting each particle's velocity onto the grid using tri-linear weighting.

2. generate a level set from the particles. The level set is necessary for later use. 

3. extend the velocity field to the whole grid. Before this step, only the grid cells that intersect the particles have a non-zero velocity. In order to get the correct velocity distribution, we have to extrapolate the velocity to the whole grid based on one simple principal: the dot product of the gradient of velocity and the gradient of level set should be zero. Which means the extrapolated velocity should not change in the normal direction of fluid surface.

4. solve for Poisson equation. I haven't start coding with this part. Yet from the previous smoke simulation project, this should be similar. The key is setting boundary condition, using ghost pressure and apply pre-conditioner.

5. extend the velocity again. In the previous step, only the velocity field of the fluid cells have been updated, so in order to get a correct value in interpolating back to particles, we need to update the rest part of the grid.

6. transfer back to the particles. Update particles' velocity based on the new velocity field.

That's basically my understanding for the FLIP solver from reading during the past few days. I'm starting to write this solver part and integrate that for my fluid simulation project.

Friday, September 28, 2012

Level set vs Color field

For the mesh extraction part of particle based fluid simulation, you have to create a surface field before actually execute the mesh extraction function(e.g. marching cube). And generally there're two ways of doing this: level set and color field.

For level set, the idea is to splat each particle to the region it belongs to, and in terms of different values assigned to a certain sample point, min operator could be employed to get the exact data. 

However, this could be slow. The level set field for a certain particle is continuous, that is, no matter how far the sample point is, there's always a value for that. So you have to decide a radius that the particle have to splat to. Theoretically, the larger the splatting radius is, the closer the final result is to the "ideal" field. 

Another huge problem is, this could only be useful for spherical particles. I'm using anisotropic particles(elliptic), and calculating the distance from an arbitrary point to an ellipsoid is not trivial task. With my current configuration, a single frame would cost more that 10 mins to create the level set field only. The problem lies in the solving part. By using ellipsoids, the distance solving part relies on iterative method, and that is the bottleneck for performance.

So in order to calculate a field faster, I turned to the "color field". Level set is defined as "signed distance field", while the color field is defined as "1 for the particle center, and 0 for outside region", and for the position within the radius of the particle, the value is decided by the smoothing kernel(e.g. B-cubic kernel).

The only problem for color field is, it does not satisfy the Eikonal Equation. And this would lead to a improper value for the normal. For the past few days, I've been thinking about methods that could eliminate or improve this part. 

One of my idea is extend the kernel. Right now the kernel is limited to the (-r, r) range, and other from that, all the values are 0. Let's imagine the level set method works in a similar way as kernel: the kernel for level set has no boundary. And that's what I've mentioned about: no matter how far the sample point is, there's always a value. 

If we could design a kernel without boundary, and also could return a value that somehow reflect the definition of color field, the problem would be improved. (Not totally solved cause the Eikonal Equation still remains a problem). 

If anyone has good ideas about this, don't hesitate to contact me. This could be huge.

Fluid simulation project

During the past few days, I re-wrote my fluid simulation project.

I modulized everything in a way similar to the fluid simulation pipeline in DreamWorks. Also I modified the mesh extraction part to make it much more faster.

The performance right now is 15~20 seconds per frame using single core CPU for 150K particles. I didn't use the optimized algorithm for single core because I'm planning to doing everything in parallel on CPU. So in terms of performance, this is the worst case. However, to my satisfaction this is still pretty quick.


Here is my new demo reel, including a clip for fluid simulation using 125K particles.

Yet this is not a good demo, because:
1. I'm using a too small smoothing radius for the particles, and ends up with really bumpy surface, which should not be the case.
2. SPH method suffers from severe compressible problem. That would lead to an additional layer in in the surface extraction part.
3. Initialization part was kind of wacky. I've done another simulation using the sample method for initializing particles from the Ghost SPH paper I've been working on. And the result is better.


For the 1st and the 3rd problem, I've already improved my project to solve these problem. The openGL version images are already there, and I'm planning to render out a maya version for a better demo.

However, because of the compressibility, the second problem could not be easily solve. I've tried to use WCSPH, yet still I can not find a proper configuration for that implementation, and also I don't think that is a good way to solve the problem. It's just a numerical method dedicated for this problem, but not physically based. My original plan is to implement the Ghost SPH as a complimentary part of my simulator, yet that paper suffers from lacking of elaboration, and even by contacting the author I still did not get a satisfying answer. Now I've started to wonder how they implement that paper.

The good news is, I'm planning to turn to FLIP for the solver part. FLIP combine the best part of eulerian method and lagrangian method, and I believe that would be the best solution for me. Hopefully that won't be too hard.

Another item on the to-do-list is to substitute marching cube with dual contour method.

BTW I might implement another version using PCISPH combine WCSPH for comparison. My personal expectation for the FLIP method is to be better than PCISPH + WCSPH.

In the end, I'm still obsessed with ghost SPH. If anyone want to discuss about that with me, I'll be love to talk about that.

I've been working on this project for a relative long time, and tried lots of things. like the creating level set field for ellipsoids(which is extremely time consuming), and converting obj file to level set. these would be done after I finished the compressibility problem. In addition, my tracer project has to be postponed, cause this project has the most priority to me.

Wednesday, September 19, 2012

Demo Reel v0.22

Updated the demo reel.

Too much homework recently. Do not have enough time for my personal project.

I hope that I can get more time for updating the fluid sim. I've done lots of improvement during the summer but haven't integrated into the reel yet.


Friday, September 14, 2012

New demo for the GPU tracer

the image rendered with tone mapping satisfied me a lot. So I made a new demo for the tracer. I turned off the antweak bar and the fps viewer for less distraction.

Here's the new demo:

Monday, September 10, 2012

Tone mapping

I made a slight change to my GPU path tracer in color transferring.

Previous I was using gamma correction, with gamma equals 2.2, now I'm using the tone mapping operator proposed by Paul Debevec. 

The difference is shown as following:

In the 1st comparison group I turned off the depth of field, just in order to focus on the color difference. And the render time is only 150s, no sufficient for full convergence but good enough for color comparison.
 Image rendered with tone mapping operator
Image rendered with Gamma correction

In the 2nd comparison group I kept all the features on and take 600s for the image to be fully converged.

Image rendered with tone mapping operator

Image rendered with Gamma correction

For the gamma correction group I'm using radiance 16 for the light, but for the tone mapping group I'm using 75 for light.

Personally speaking I prefer tone mapping. It's not that shiny and looks way much better!