Page 2 of 9

Re: OpenVDB to Softimage

Posted: 05 Jan 2014, 22:42
by Mr.Core
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 :-)

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 12:06
by caledonian_tartan
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

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 16:49
by Mr.Core
>>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 :)

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 17:06
by caledonian_tartan
...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?

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 17:39
by Mr.Core
i dont have emfluid, but suppose we have access to raw voxel grid values, then you can build something like this:

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 17:42
by Mr.Core
however, I heard somewhere emfluid has native exporting to vdb, so ask Eric for this to make sure

Re: OpenVDB to Softimage

Posted: 06 Jan 2014, 21:55
by caledonian_tartan
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

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 00:53
by Tekano
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

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 01:39
by Tekano
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?!

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 10:06
by caledonian_tartan
...export the fluid grid cells as a vdb file...
i'm using emFluid4. haven't yet found out how to export vdb...

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 13:09
by caledonian_tartan
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

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 16:43
by Tekano
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

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 17:18
by caledonian_tartan
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."

Re: OpenVDB to Softimage

Posted: 07 Jan 2014, 18:07
by Tekano
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

Re: OpenVDB to Softimage

Posted: 08 Jan 2014, 09:24
by caledonian_tartan
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)...

Re: OpenVDB to Softimage

Posted: 08 Jan 2014, 16:15
by Mr.Core
>>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