OpenVDB to Softimage

Plugins linking to this thread: (hide)

OpenVDB ICEAuthor: Oleg Bliznuk
This is a Softimage ICE integration of the OpenVDB suite, Dreamworks Animation's volumetrics toolset which has been built around a new data structure for efficient storage and manipulation of big volumes. See openvdb_dreamworks.pdf for slides of a OpenVDB feature presentation.

Oleg Bliznuk, author of Exocortex's Implosia FX and Explosia FX has created this ICE adapter. His fluid simulator »Explosia FX« (free as a noncommercial version) can be used to create VDB files. OpenVDB ICE covers the essential features of the OpenVDB suite:

Mental Ray/Arnold shaders included: VDBGridReaderScalar VDBGridReaderVec3 VDBGridReaderInt VDBVolumeShaderSimple VDBBlackbody

Compounds included: Voxelize Geometry Voxelize Particles Get VDB Grid Set VDB Grid File Grid IO Add Noise Fogvolume Filter LevelSet Boolean Operations LevelSet Morphology VolumeFog Boolean Operations Advection Get Value at Coordinate Set Value at Coordinate Grid To Mesh Mesh To Grid Get Grid Data Particles To Grid Grid IO Fill Box Grid Change Grid Class Noise Advect Level Set Morphological Filters Rebuild LevelSet Resample Grid Transform Platonic Create Grid CSG Deep Copy Grid Morpher Polygonize Grid Solidify Level Set Create Velocity Field Display Grid Info Platonic Sphere Resize Container to Active Volume Visualize Grid Slice Visualize Scalar Grid Visualize Scalar Grid Slice Visualize Vector Grid Visualize Vector Grid Slice

For feedback and questions, visit the si-community thread. There's also some info there on how to interoperate with emFluid. Here is a demo video by the author and another video from the thread, created by Rob Chapman using only OpenVDB ICE nodes and rendered using the included openVDB arnold shaders. Requirements: Microsoft Visual C++ 2012 Redistributable Package (x64)

local backup: OpenVDB_to_Softimage_v0.8.rar

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: OpenVDB to Softimage

Post by Mr.Core » 05 Jan 2014, 22:42

You are welcome, Rob :) I'd like to get some feedback and wishes on future implementation since it is not always clear how to better implement something here and there. I think openvdb has a far better spreading because of it's wide set of tools for volumetric processing, while field3d is only format by itself ( if i am not mistaken ). And i have feeling that openvdb has more agressive promotion :-)

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 06 Jan 2014, 12:06

this is amazing!
played around with it a bit.

i'd love to see a connection to emFluid. (is that possible?)
or more examples for ICE only situations.

unfortunately i don't have anything to show yet. i'll go on and try again.

thank you very much Mr.Core
SI 2015 @ WIN7-64

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: OpenVDB to Softimage

Post by Mr.Core » 06 Jan 2014, 16:49

>>i'd love to see a connection to emFluid. (is that possible?)
Nothing special have to be done - emfluid just need to export in .vdb format and thats enough :)

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 06 Jan 2014, 17:06

...Nothing special have to be done...
i used "VDB Voxelize Particles" which worked so far.
but as this only translates "point-/-size/-velocity/-position", no voxelgrid/velocitygrid... i didn't get a cool look at all.

so guess caching to .vdb is needed...(?)



EDIT:
emfluid just need to export in .vdb format
how do i do that?
SI 2015 @ WIN7-64

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: OpenVDB to Softimage

Post by Mr.Core » 06 Jan 2014, 17:39

i dont have emfluid, but suppose we have access to raw voxel grid values, then you can build something like this:
Attachments
2.jpg
1.jpg

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: OpenVDB to Softimage

Post by Mr.Core » 06 Jan 2014, 17:42

however, I heard somewhere emfluid has native exporting to vdb, so ask Eric for this to make sure

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 06 Jan 2014, 21:55

thanks Mr.Core
i followed your setup, but had to change some stuff.

it renders quite ok, but there's something wrong with the voxelsize.
not shure about it.
emvdb.jpg
SI 2015 @ WIN7-64

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: OpenVDB to Softimage

Post by Tekano » 07 Jan 2014, 00:53

thats an emfluid pointcloud Tartan? that so will not work that way, but good effort :) you could go down that path andemit some particles and advect them through your emfluid sim.. but the easy way would be to do like Oleg says and export the fluid grid cells as a vdb file - which version of emfluid are you on? the latest versions or so support this. I know this because we tested the exported vdb sequence in houdini.
now we do not have to. :-bd
Gossip is what no one claims to like, but everybody enjoys.

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: OpenVDB to Softimage

Post by Tekano » 07 Jan 2014, 01:39

Mr.Core wrote:You are welcome, Rob :) I'd like to get some feedback and wishes on future implementation since it is not always clear how to better implement something here and there. I think openvdb has a far better spreading because of it's wide set of tools for volumetric processing, while field3d is only format by itself ( if i am not mistaken ). And i have feeling that openvdb has more agressive promotion :-)
excellent, well a list or an idea of which bits of VDB code you have implemented into ice nodes and what are there compound names.. or have you converted the entire cookbook!? going inside the compounds you made like solidify level set is actually change grid class. and then I am trying to go to the VDB docs to find where this is detailed but not having much luck to find the correct section or parts of the VDB docs so a wish to make it easier to translate some correlation between the library code functions names in the docs and the ICE compounds.. somehow? eg which compounds are or where are the VDB iterators, or the Tools
Utilities and Tools

OpenVDB provides utility functions and classes for the manipulation of grids and the data they hold. Tools such as those found in GridOperators.h compute vector quantities from scalar data or vice-versa. Other tools perform filtering (Filter.h and LevelSetFilter.h) and interpolation (Interpolation.h) as well as sampling (GridTransformer.h), compositing and constructive solid geometry (Composite.h), and other transformations (ValueTransformer.h). OpenVDB also supports advanced finite difference computations through a variety of local support stencils (Stencils.h).
a simple matter to do some more experimenting & reading on whats there - and I see there is a lot converted already , its a heck of a lot of stuff! :D

**edit** and a request - I do not see these below:taken from http://www.openvdb.org/download/openvdb_toolset.pdf I wonder if even VDB guys have done all these yet! :D
Gradient
tools::gradient
Mean curvature
tools::meanCurvature
Closest-point transform
tools::cpt
Divergence
tools::divergence
Laplacian
tools::laplacian
Buoyant density in an incompressible
fluid simulation
Magnitude
tools::magnitude
Curl
tools::curl

because in theory this should be way faster to do large scale neighbor lookups using vdb nodes than nearest neighbours in ICE itself?!
Gossip is what no one claims to like, but everybody enjoys.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 07 Jan 2014, 10:06

...export the fluid grid cells as a vdb file...
i'm using emFluid4. haven't yet found out how to export vdb...
SI 2015 @ WIN7-64

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 07 Jan 2014, 13:09

ok. looks like this does the trick to match voxel grids and data content of emFluid and VDB.

still some issues.
e.g. i build the colorGrid inside emFluid as it does not exist like so. looking up with closest location decreases performance massivly...
also i expected a little bit more details with a cell size of 0.2...

em2vdb2.jpg
Last edited by caledonian_tartan on 07 Jan 2014, 15:26, edited 1 time in total.

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: OpenVDB to Softimage

Post by Tekano » 07 Jan 2014, 16:43

I do believe you are turning the emfluid visualizer particles to VDB rather than the actual fluid grid.

version 4.0 you can cache the grid to Bafl format. for VDB it is the same way just rename to vdb in the export - but it could be a later version than you currently have
Gossip is what no one claims to like, but everybody enjoys.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 07 Jan 2014, 17:18

thanks Tekano

caching .bafl is easy, but i get this error at rendertime. (while reading the renamed bafl file)
# WARNING : [VDB][GRIDIO]: IoError: not a VDB file

what do i need to chache on emFluid? waste? heat? density? velocity? all?

what's the ReadingGridName on the VDB_IO reader?


(using emFluid4 _ Solver v6, including the beta cache on file node)



I do believe you are turning the emfluid visualizer particles to VDB rather than the actual fluid grid.
i'm not shure how to get the real grid instead of just the visualizer. are you shure they're not the same?

the emFluid docs say:
"Grid (Array) - for advanced users. These ports give you access to the solver's internal data grids which are stored as flat arrays."
SI 2015 @ WIN7-64

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: OpenVDB to Softimage

Post by Tekano » 07 Jan 2014, 18:07

ah yes the grid array should work! I thought you were just connecting the pointcloud and the cell size attribute earlier

will try a VDB export out later to see if it works
Gossip is what no one claims to like, but everybody enjoys.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: OpenVDB to Softimage

Post by caledonian_tartan » 08 Jan 2014, 09:24

here's a comparison of BA_Fluid and VDB rendering.
both using the same emFluid4 Grid as Source with a cell size of 0.25
vdbba.jpg
Looks quite the same. still lacks detail.

i noticed strange behaviour with "emFluid4 _ Solver (v6)".
the VisualFeedback_AlphaBox is limited in size and cuts the top. works wrong. especially with low cellsize.
no problem with v4. got to discuss that somewhere else.

still not able to load .bafl (renamed to .vdb)...
SI 2015 @ WIN7-64

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 12:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: OpenVDB to Softimage

Post by Mr.Core » 08 Jan 2014, 16:15

>>Gradient
tools::gradient
Mean curvature
tools::meanCurvature
Closest-point transform
tools::cpt
Divergence
tools::divergence
Laplacian
tools::laplacian
Buoyant density in an incompressible
fluid simulation
Magnitude
tools::magnitude
Curl
tools::curl


caledonian_tartan
Maybe you better try to get emfluid 5 beta and use it's native vdb export ..? It should be much more faster and in some cases may hasn't interpolation artifacts

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests