OpenVDB support

Discussion related to the Engine functionality, implementations and API.
neo2068
Developer
Posts: 114
Joined: Tue Dec 05, 2017 6:06 pm

Re: OpenVDB support

Post by neo2068 » Wed Oct 09, 2019 5:36 am

Rivental1 wrote:
Sun Oct 06, 2019 5:28 am
Thank you. Blender smoke simulator is very slow and often gives strange results... So would be great to render VDB cash from other programms, like Houdini or Cinema 4d with FumeFX or TFD. Strange why blender no read other VDB files...
LuxCore has support for VDB files from other programs as Dade showed in this post with the densitygrid texture.

Code: Select all

scene.textures.tex.type = densitygrid
scene.textures.tex.nx = 256
scene.textures.tex.ny = 256
scene.textures.tex.nz = 256
scene.textures.tex.wrap = black
scene.textures.tex.openvdb.file = scenes/media/blender-blosc.vdb
scene.textures.tex.openvdb.grid = density
scene.textures.tex.mapping.type = globalmapping3d
scene.textures.tex.mapping.transformation = 1. 0 0 0  0 0 -1. 0  0 .8 0 0  0.5 0.5 0.5 1
I work on the OpenVDB support for the Blender addon. Currently, it is in a very early stage and it doesn't work with e.g. houdini VDB files on my side because the OpenVDB library isn't compiled with blosc support. I have to fix that first. Animations, e.g. automatic file selection according to the current frame doesn't work either.
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 3398
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade » Wed Oct 09, 2019 7:56 am

neo2068 wrote:
Wed Oct 09, 2019 5:36 am
it is in a very early stage and it doesn't work with e.g. houdini VDB files on my side because the OpenVDB library isn't compiled with blosc support.
It is https://github.com/LuxCoreRender/Window ... /blosc.lib but, may be, is a OpenVDB/Blosc version problem ? I was using the version used by Blender for compatibility (it is a quite old version).
Support LuxCoreRender project with salts and bounties

neo2068
Developer
Posts: 114
Joined: Tue Dec 05, 2017 6:06 pm

Re: OpenVDB support

Post by neo2068 » Wed Oct 09, 2019 8:39 am

Dade wrote:
Wed Oct 09, 2019 7:56 am
It is https://github.com/LuxCoreRender/Window ... /blosc.lib but, may be, is a OpenVDB/Blosc version problem ? I was using the version used by Blender for compatibility (it is a quite old version).
Thank you for the hint. I updated the OpenVDB library in the branch to the latest one. Probably I have messed up something in the build configuration. I will check.
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

Rivental1
Posts: 14
Joined: Tue Mar 05, 2019 9:15 pm

Re: OpenVDB support

Post by Rivental1 » Sat Oct 12, 2019 4:33 pm

neo2068 wrote:
Wed Oct 09, 2019 5:36 am
I work on the OpenVDB support for the Blender addon. Currently, it is in a very early stage and it doesn't work with e.g. houdini VDB files on my side because the OpenVDB library isn't compiled with blosc support. I have to fix that first. Animations, e.g. automatic file selection according to the current frame doesn't work either.
Thank you. It is a very important feature. Now, as i know, only octane can render VDB files inside blender, but i dont like results from octane.

neo2068
Developer
Posts: 114
Joined: Tue Dec 05, 2017 6:06 pm

Re: OpenVDB support

Post by neo2068 » Sun Nov 03, 2019 2:37 pm

Hi!
Here is an update of my work on the openVDB node in Blender. Via this node you currently can use
- VDB files created with the internal smoke simulation of Blender
- external files and file sequences created with other programs, e.g. Houdini

The node still is in very early state and the UI elements are rather technical and will change in future versions.

The automatic file sequence detection for VDB files from Blender cache doesn't work yet but you can use the "use internal cache files" option to get the files directly from blender.

Normally in LuxCore the VDB files are internally normalized to a [0...1] range to fit in the domain bounding box. This is ok for still frames in most of the cases. If you use an file sequence and the domain size changes form frame to frame the volume data will jitter or move unexpectedly. Then you have to check the 'Use Bounding Box Offset' option to use the offset stored in each file.
The nx, ny, nz values set the resolution of the volume grid on each axis. After selecting the file the node stores the resolution of the selected file. If the resolution changes in the sequence due to larger occupied space of the volume data these initial values could be too small.
Here are some demo videos which show the workflow of the openVDB node usage.
https://www.youtube.com/playlist?list=P ... wLtBVku72G

Blender smoke simulation:
internal smoke and fire.jpg
Houdini cloud bunny test file:
external smoke.jpg
Houdini buddha test file:
external levelset.jpg
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 3398
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade » Sun Nov 03, 2019 3:18 pm

Great work.

P.S. the Windows build on your branch is currently failing on Azure for missing BLOSC symbols: https://dev.azure.com/LuxCoreRender/Lux ... uildId=969
Support LuxCoreRender project with salts and bounties

neo2068
Developer
Posts: 114
Joined: Tue Dec 05, 2017 6:06 pm

Re: OpenVDB support

Post by neo2068 » Sun Nov 03, 2019 3:25 pm

Dade wrote:
Sun Nov 03, 2019 3:18 pm
Great work.

P.S. the Windows build on your branch is currently failing on Azure for missing BLOSC symbols: https://dev.azure.com/LuxCoreRender/Lux ... uildId=969
Yes, I had to do some changes in the cmake configuration. There was a mismatch of cmake variables for blosc, i.e. $BLOSC_LIBRARY in FindBlosc.cmake and $BLOSC_LIBRARIES in the target link sections. I check if I missed one.
I also have a newer version of blosc.lib in my local deps folder. Can I simply push that new file to master or does that break the master builds?
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 3398
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade » Sun Nov 03, 2019 3:51 pm

neo2068 wrote:
Sun Nov 03, 2019 3:25 pm
I also have a newer version of blosc.lib in my local deps folder. Can I simply push that new file to master or does that break the master builds?
You need to update both Linux Bin. Deps and Windows Bin. Deps repositories however you can not push the new binaries on a branch because Azure will still use the master branch to compile even your OpenVB branch.

So you have to push them on the master branch but before you should check if the new Blosc works with master branch code or not (otherwise this may fix the compilation of your branch but brake the compilation of master branch).
Support LuxCoreRender project with salts and bounties

neo2068
Developer
Posts: 114
Joined: Tue Dec 05, 2017 6:06 pm

Re: OpenVDB support

Post by neo2068 » Mon Nov 04, 2019 10:49 am

Dade wrote:
Sun Nov 03, 2019 3:51 pm
You need to update both Linux Bin. Deps and Windows Bin. Deps repositories however you can not push the new binaries on a branch because Azure will still use the master branch to compile even your OpenVB branch.

So you have to push them on the master branch but before you should check if the new Blosc works with master branch code or not (otherwise this may fix the compilation of your branch but brake the compilation of master branch).
I tested the comilation with the new version of c-blosc and the master repository on my windows system and i worked without problems.
I compiled the linux version of the latest c-blosc version and replaced the archive in the linux_deps.tgz. I updated the sha1 hash and compiled the master repository with the build script and it worked without problems, too. What would be the next steps? Should I check something else before pushing the new libraries?
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 1080 + GTX 780, Windows 10 64bit, Blender 2.79b
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 3398
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade » Mon Nov 04, 2019 11:14 am

neo2068 wrote:
Mon Nov 04, 2019 10:49 am
What would be the next steps? Should I check something else before pushing the new libraries?
A that point, it should be all good.
Support LuxCoreRender project with salts and bounties

Post Reply