OpenVDB support

Discussion related to the Engine functionality, implementations and API.
User avatar
B.Y.O.B.
Developer
Posts: 1112
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenVDB support

Post by B.Y.O.B. » Thu Apr 12, 2018 2:44 pm

Great!
These are my timings:

Old:

Code: Select all

[Smoke Domain] Beginning smoke export (channel: density)
[Smoke Domain] conversion from bpy_prop_array to Python list took 0.640s
>>> Smoke Export total time: 15.671s
New:

Code: Select all

[Smoke Domain] Beginning smoke export (channel: density)
[Smoke Domain] conversion from bpy_prop_array to Python list took 0.610s
>>> Smoke Export total time: 3.480s
(Tests with a grid with 13,141,440 floats)

But currently I'm still converting the bpy_prop_array to a list like we did before.
If I try to pass the bpy_prop_array to AddAllFloat directly, I get this error:

Code: Select all

Wrong data type for the list of values of method GetArray(): bpy_prop_array
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1089
Joined: Mon Dec 04, 2017 8:36 pm

Re: OpenVDB support

Post by Dade » Thu Apr 12, 2018 2:59 pm

B.Y.O.B. wrote:
Thu Apr 12, 2018 2:44 pm
But currently I'm still converting the bpy_prop_array to a list like we did before.
If I try to pass the bpy_prop_array to AddAllFloat directly, I get this error:

Code: Select all

Wrong data type for the list of values of method GetArray(): bpy_prop_array
Bah, they don't offer Python buffer interface, can you post a test scene, so I can run the tests here and check if I can directly read from bpy_prop_array.
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1112
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenVDB support

Post by B.Y.O.B. » Thu Apr 12, 2018 3:24 pm

Here.
But if it's too much trouble - 0.6 seconds on 13 Mio. floats is OK I think.

You have to checkout the branch byp_prop_array in BlendLuxCore to get the error.
Attachments
bpy_prop_array.blend
(106.22 KiB) Downloaded 25 times
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1089
Joined: Mon Dec 04, 2017 8:36 pm

Re: OpenVDB support

Post by Dade » Fri Apr 13, 2018 2:57 pm

B.Y.O.B. wrote:
Thu Apr 12, 2018 3:24 pm
But if it's too much trouble - 0.6 seconds on 13 Mio. floats is OK I think.
Ok, I see, it is just a "list(grid)". Do you need an AddAllFloat with stride ? To read 3 float (aka RGB) and skip one (aka Alpha).
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1112
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenVDB support

Post by B.Y.O.B. » Fri Apr 13, 2018 3:03 pm

Dade wrote:
Fri Apr 13, 2018 2:57 pm
Ok, I see, it is just a "list(grid)". Do you need an AddAllFloat with stride ? To read 3 float (aka RGB) and skip one (aka Alpha).
Would make color grid export faster, yes.
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1089
Joined: Mon Dec 04, 2017 8:36 pm

Re: OpenVDB support

Post by Dade » Fri Apr 13, 2018 3:24 pm

B.Y.O.B. wrote:
Fri Apr 13, 2018 3:03 pm
Dade wrote:
Fri Apr 13, 2018 2:57 pm
Ok, I see, it is just a "list(grid)". Do you need an AddAllFloat with stride ? To read 3 float (aka RGB) and skip one (aka Alpha).
Would make color grid export faster, yes.
Ok, I added the support for ".AddAllFloat(list, 3, 1)" (it will read 3 float and skip one). And I guess we can can close this chapter for the moment.
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1112
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenVDB support

Post by B.Y.O.B. » Fri Apr 13, 2018 3:42 pm

You used u_int instead of unsigned int, will this cause problems on Windows again?

edit: Guess not, it was there before.
Support LuxCoreRender project with salts and bounties

Post Reply