OpenVDB support

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

OpenVDB support

Post by Dade »

The very first rendering of an OpenVDB volume (http://www.openvdb.org/download/):
bunny.jpg
Support LuxCoreRender project with salts and bounties
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: OpenVDB support

Post by Sharlybg »

:shock: We are going in Very professional area ! be sure that we will abuse of the engine if you continue like that don't complaint anymore after :lol:
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
neo2068
Developer
Developer
Posts: 260
Joined: Tue Dec 05, 2017 6:06 pm
Location: Germany

Re: OpenVDB support

Post by neo2068 »

Really cool! :D
i7 5820K, 32 GB RAM, NVIDIA Geforce RTX 2080 SUPER + GTX 1080, Windows 10 64bit, Blender 2.83.5
Support LuxCoreRender project with salts and bounties
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: OpenVDB support

Post by kintuX »

Oh, yes... :D
impatiently waiting as was just playing with multiscattered banded Blender Marble inside the Cube (Heterogeneous Volume) on Tiled PT - Works really well. Next, clouds in a Box 8-)
Thank you, thank you very much...
Gaser_004cubePTms.jpg
Do you think that one day will be able to render iridescence in volumes?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade »

kintuX wrote: Fri Apr 06, 2018 9:59 pm Do you think that one day will be able to render iridescence in volumes?
It is but there are so many aspects to work on that sometime it is just hard to keep track of all of them and prioritize what to work on next.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade »

I updated the linux procedure to compile with OpenVDB support and it should now work out of the box, just switch to the "openvdb" branch in LuxCore, LinuxCompile and LinuxCompileDeps repositories.

@B.Y.O.B., I tried the .vdb, exported from Blender, you posted some time ago and they seems to work but we need to do some test about the volume transformation. I'm currently ignoring the transformation stored inside .vdb file and remapping the volume in [0, 1] coordinates. This should be what you expect (i.e. it works like densitygrid texture .data field) but we need to try.

This is the new syntax:

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
where ".data" field can be replaced by ".openvdb.file" and ".openvdb.grid" properties. The ".openvdb.grid" is the name of the grid (i.e. data channel) to read from the file. If you need to check what names are used in a .vdb, just check the log:

Code: Select all

[SDL][0.005] Texture definition: tex
[SDL][0.005] OpenVDB file: scenes/media/blender-blosc.vdb
[SDL][0.012] OpenVDB grid names:
[SDL][0.012]   [density]
[SDL][0.012]   [obstacles]
[SDL][0.012]   [shadow]
[SDL][0.012]   [velocity]
[SDL][0.025] OpenVDB grid bbox: [(26, 13, 27), (184, 119, 171)]
[SDL][0.025] OpenVDB grid size: (158, 106, 144)
[SDL][0.910] Define ImageMap: LUXCORE_DENSITYGRID_tex
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade »

I have now both the Linux and Windows versions working with OpenVDB ... the porting to Windows was the usual horrible pain but it is done. Tomorrow, I will merge all the openvdb branches with the main so it will be in the next beta release.
Support LuxCoreRender project with salts and bounties
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: OpenVDB support

Post by Sharlybg »

Dade wrote: Mon Apr 09, 2018 4:54 pm I have now both the Linux and Windows versions working with OpenVDB ... the porting to Windows was the usual horrible pain but it is done. Tomorrow, I will merge all the openvdb branches with the main so it will be in the next beta release.
Why there is so much difficulties in working with Microsoft software (a company with trillion dollars) ?

Thanks You for This advance !
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenVDB support

Post by Dade »

Sharlybg wrote: Mon Apr 09, 2018 5:03 pm
Dade wrote: Mon Apr 09, 2018 4:54 pm I have now both the Linux and Windows versions working with OpenVDB ... the porting to Windows was the usual horrible pain but it is done. Tomorrow, I will merge all the openvdb branches with the main so it will be in the next beta release.
Why there is so much difficulties in working with Microsoft software (a company with trillion dollars) ?
Not to defend MS but, this time, we had to use OpenVDB v3.1 (when the latest version is v5.0 !) because is the version used by Blender and the latest to not require C++11 support (MS fault is here).
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenVDB support

Post by B.Y.O.B. »

I have started to work on support in BlendLuxCore however apparently it is non-trivial to find out the path of the cache files...
I can't find the relevant Python attribute in Blender or in the documentation. Have to look further.

Of course the current code already works with OpenVDB (the grid attributes in Blender hide the underlying caching mechanism), but it kinda defeats the point of having OpenVDB support in LuxCore.

By the way can we accelerate the export of the normal point cache with C++?
Have to investigate. I think we would need a C++ function "DefineDensityGridData()" (like DefineMesh etc.) because the main bottleneck seems to be that we currently pass a HUGE array to a property.
Post Reply