Comments (10)
That is great suggestion, @Immocat. Yes, I was also not very proud of the performance of the anisotropic implementation. The SDV is not very efficient, but also using the uniform grid also make things slow. Let me open a separate ticket to cover that issue.
from fluid-engine-dev.
I've been using eigen's svd for the moment. At one point I had a slow access pattern for the vdb neighbour search and the svd wasn't an issue. Now I've got a faster search, the svd could probably now be looked at. There is a guy here at work who implemented the fast 3x3 svd so I'm going to look at that as well.
The banding does look familiar. It was definely tied to the voxel grid res. It varied with the angle too.
I wish I could share screenshots but here at Weta, we can't really get stuff out without getting it all approved.
from fluid-engine-dev.
Thanks for finding this, @Immocat! Let me take a look at the problem. Iām not sure if the magic number is the real root cause, but still very interesting find.
from fluid-engine-dev.
Hi all.
I've been implementing this paper at work using vdb pointDataGrids into a volume grid. I have been a bit confused by that magic number too. I've also encountered banding at the voxel splat stage. I think I'm close to figuring out what the issue is and it's related to the magic scaling.
So here's the problem (I think). I have a particle grid (which stores the particles in 'index' space ie the integer coordinates of the grid which is the way vdb accesses it's coordinates). I calculate the svd/matrix using those coordinates. The svd is fine as I can load the particles back into houdini and instance spheres onto them using the matrix and they are all oriented and squashed correctly.
Then I go to the voxel splat stage which is where I've been having the banding issues. The thing causing the issue is that I am writing to a voxel grid of arbitrary resolution. I do the neighbour search and splat the particles using a kernel (i've tried many) and mult the r vector by the matrix. (one tricky thing to keep in my mind is that I am doing the voxel splat in the particles index space to prevent me having to do a transform into a different 'space').
The thing I think is the problem is that I am using the matrix which is of a certain 'scale' but the voxel splat has a different 'support' radius. So the matrix scaling and the kernel radius are of different scales. So if the anisotropic matrix has eigenvalues of something like (2.0, 0.5, 2.0), and the voxel splat is only 1.0, then the r vectors will be stretched out of the kernel support and messes up the splatted value. I'm going to try and scale down the matrix by a factor that is the difference between the two kernels in the particle and voxel stages.
Also want to try a metaball approach with sdf blending still using the matrices.
I'll follow this thread with interest!
from fluid-engine-dev.
Thank you for chiming in, @dokipen3d! Yes, I also experienced similar issues with the kernel support not being fully captured by the grid points. Probably this is related to that issue based on the first screenshot @Immocat attached (SDF being not smooth which indicates kernel cut-off).
from fluid-engine-dev.
Thanks for all your replies.
Although using the ks = 1400 solve the "hole" problem, I found a new problem:
I'm not sure if it is the banding problem @dokipen3d mentioned. I used the same frame particles to generate these two meshes, while the left one's grid spacing is 0.01 and the right is 0.02.
So for my current project, I choose to use zhu_bridson's method
Comparing to zhu_bridson's method, anisotropic method is much slower because of the svd. So I also recommend @doyubkim to adopt the Implicit-shifted Symmetric QR Singular Value Decomposition of 3 Ć 3(2x2) Matrices.
Not only this method is widely used and critical in Disney's Material point method simulation(maybe in your future book?
I will try to implement material point method and adopt the QRSVD as my future project and do some experiment with this anisotropic kernel but not in the near future.
from fluid-engine-dev.
Just pushed a branch with a potential fix. @Immocat, if you can checkout that branch and see if it fixes your problem, that would be great. It seems to work with most of my test cases including your attached file.
The actual bug was caused by wrong clamping of the singular values after SVD step.
Not related to the bug, but if I make additional comment on my magic parameter, I'm actually implementing the algorithm slightly different from the original paper in order to remove the original magic parameter, 1400. The scaling factor I'm using (pow(relV, 1/3) part) is trying to normalize the kernel volume so that either perfect spherical kernel or elongated kernel have same volume.
Also, about the aliasing, I'm using fixed 2x radius than the kernel size which can be improved I think.
from fluid-engine-dev.
Why would absmax fix the holes? Can svd give negative scales?
from fluid-engine-dev.
Yeah if we can fix this aliasing, I will be very happy!
from fluid-engine-dev.
@dokipen3d great question. I think my PR and comment were misleading. Apparently, the version of implementation I'm using for SVD does generate negative output, which is totally fine unless I carry the sign all the way to the G matrix. So the fix is cancelling out the sign part and use the abs scale to construct G. But as I type this comment here, I think I can make my code and comment more clear.
from fluid-engine-dev.
Related Issues (20)
- Is gtest necessary in the CMakeLists.txt for the unit tests? HOT 3
- Python API import error on Windows and Python 3.8+ with Intel TBB HOT 10
- render manual tests root path HOT 4
- How do I run the examples and the animations?
- How to run the particles2obj example? HOT 14
- Compile error when compiling with Clang 10 HOT 1
- Promotion of projects/research using Jet Framework HOT 4
- How to implement the xyz to mesh generation to another code for fluid simulation? HOT 1
- How do I set up a fluid particles at rest and a fluid particles with initial velocity HOT 3
- Suggestion to replace Travis CI/Appveyor with GitHub Actions HOT 5
- Some unit tests failure on 32-bit system
- Fix Visual Studio 2017 build failure on GitHub Action
- Timer test code failure on MinGW system
- No known features for CXX compiler "Clang" HOT 5
- running the Python example show error HOT 8
- Replace Clara
- makeTranslationMatrix should be transposed HOT 8
- About the local method in the surface_to_implicit HOT 1
- GridSmokeSolver3::computeDiffusion is diffusing smokeDensity instead of temperature HOT 2
- Incorrect formula for collider boundary conditions (Equation 3.18 in the book)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluid-engine-dev.