How to Modify VDB Density based on Curvature or Gradient?

   1720   1   2
User Avatar
Member
134 posts
Joined: Aug. 2014
Offline
I am working on a visualization of a stellar remnant (nebula) based on a scientifically accurate simulation.
I'm using VDBs to represent the different elements in the clouds of gas. e.g. iron, oxygen, magnesium, etc.
They are based on data provided from the simulation.
The challenge is that the density of one element can obscure another.

One idea we would like to explore is to make the VDB less dense where there is low curvature in the source density regions.
i.e. only regions with high curvature should have high density. So that we can "see through" the dense regions of the source.

Does anyone know how to modify VDB density this way?

I experimented with the VDB Analysis node:

https://www.sidefx.com/docs/houdini/nodes/sop/vdbanalysis.html [www.sidefx.com]

The Gradient, Curvature, and Laplacian Operators look promising.
However, the documentation doesn't explain what they do or how they work.

Are there any tutorials or examples of these Operators?

Please find attached screen grabs of the original volume for Fe56 (iron), the Gradient, and Laplacian operators applied.

One more question:
Some of the operators convert the scalar density into a vector density. e.g. Gradient.
The OpenGL viewport seems to know how to visualize a density vector.
How would you mimic what the viewport is doing, in this case, using a volume shader?

Thanks
Edited by jlapre - Sept. 19, 2022 01:19:23

Attachments:
Fe.png (2.1 MB)
Fe_gradient.png (2.5 MB)
Fe_Laplacian.png (2.7 MB)

Jeroen
User Avatar
Member
53 posts
Joined: Feb. 2017
Offline
The VDB analysis node takes your VDB and calculates the curvature, gradient, Laplacian and so forth, of the input VDB and outputs a new VDB, either under the same name or a newly specified name. You can multiply your existing VDBs by the new gradient field by inputting them into a volume VOP. You can 'grab' a field with a bind node and export a field with the bind export node. If you would merge your iron field and curvature field together, you can then (inside of the volume VOP) bind both `iron` and `curvature` multiply one by another, and bind export the result into `iron`. You then have an iron field that is dense in areas where curvature is high, and less dense where the curvature is low. Hope this helps out. Cheers!

About the viewport question; I just think the density is visualized by the x component of the vector field, as density is interpreted as a float. What is it you would like to do in your render in regards to this?
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
  • Quick Links