Author Topic: VDB - Shadow bug and emission question  (Read 3411 times)

2018-05-22, 15:24:25

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Hello,
I have a very small experience with .vdb file.
With PhoenixFD I have created a simple exploadion (with the preset tool), inport the .vdb file in Corona and try to play.



As you can see:

(*) there is a problem with the shadow
(*) I'm not able to create a nice "emission" shader

Here you can download the files:

--- DOWNLOAD---

Where is the problem?  =)




2018-05-22, 15:39:13
Reply #1

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
This looks like a bug I noticed (and reported internally) yesterday - if there is a light inside the CoronaVolumeGrid object (the bounding box for it, not necessarily inside the part with voxels) and if there is an object (such as a plane) also inside the CoronaVolumeGrid, then lighting seems to be incorrect.

2018-05-22, 15:43:50
Reply #2

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Thank you TOm. And, what about shader? Are you able to create a nice "Explosion Emission light"? =)

2018-05-22, 16:28:17
Reply #3

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
Well, there's no shader in the conventional sense, it's all built into the CoronaVolumeGrid object. I've had it working fine, just need to select the correct data to use to drive the Emission, Temperature being the most likely one to use (the hotter it is, the more it glows). Then adjusting the Scale and maybe the gradient in the Grid mapping if you want to adjust the colors and how they fade off. Of course you could drive it using Density, Velocity, or any of the other parameters too, but Temperature is the one that would work best for Emission.

2018-05-22, 16:44:29
Reply #4

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Hi Tom, yes, I knew this, but thank you for the explanation =) It will be useful. But, if you open my file (you will find .max file and .vdb file) I' not able to create a "nice" result", even if I use temperature channel or other channels for the Emission. Only with Smoke_phx channel (llok at the image above) I have a nice and correct preview (point clouds viewport), but the rendering is awful :/ . Feel free to "play" ;-)
PS: the "Velocity" channel look like completely broken.
« Last Edit: 2018-05-22, 16:49:14 by cecofuli »

2018-05-22, 16:56:13
Reply #5

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Ok, the problem of the shadows, tt's not a bug.The plane and the CoronaVolumeGrid object are both exactly on 0.00. If you move the CoronaVolumeGrid object at 0.01, the "bug" is solved =)

2018-05-22, 16:57:23
Reply #6

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
Never tested with Phoenix FD output, just the free OpenVDB files from over on the OpenVDB site - the explosion from there worked as expected for me. Will see if I get time to take a look at the scene, but can't promise, as the next Academy is coming up and looking into how Phoenix saves OpenVDB files could be complex ;) My first thought would be to check the Scale, as not sure if different applications write different high / low values for their metadata.

2018-05-22, 16:58:23
Reply #7

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
On the bug, yes, if the plane (or presumably any object) intersects the OpenVDB, then this happens - does sound like the one I reported internally. Have added a note there to point at this forum post as another example of it, btw!

2018-05-22, 17:15:30
Reply #8

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Ok, I tried to download the explosion from

http://www.openvdb.org/download/

And the Temperature channel is ok.
I think something is wrong inside the PhoenixFD .vdb file... But I don't know where it can be the problem. I'm not expert in VFX ^_^




2018-05-22, 17:18:45
Reply #9

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
Join the club :) I did want to try creating something from Phoenix, as I wanted to test an animated OpenVDB and I can't find an example anywhere online (if anyone knows of one, let me know!) - but I have no idea how Phoenix FD exports to OpenVDB nor the details of what export settings there are, and how that changes how we import it - all new territory since the functionality has never existed for us before haha!

If anyone knows more about exporting to OpenVDB from various applications (should be possible from Blender and Houdini too for example), feel free to share info, knowledge and experiences! And to test CoronaVolumeGrid of course!

2018-05-22, 17:25:43
Reply #10

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Ohh.. with PhonexiFD is very simple:

(*) Select a teapot and use PhoenixFD toolbar by pressing the  "Explosion Sim" button. PhoenixFd will do everything for us.
(*) Select the Grid and, in the rollout "Grid" decrease the resolution (to speed-up the test).
(*) In the rollout "Output" select the directory and the .vdb format"
(*) In the Simulation rollout, click... "Simulate".
(*) If you prefer to see the point clouds, in the "Preview" rollout, press "GPU Preview".

That's all =)

2018-05-22, 17:55:36
Reply #11

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Ok,
here we can download a very simple and fast (low res) .vdb sequence of explosion created with PhoenixFD with default settings.
Try to obtain a nice rendering with CoronaVolumeGrid, if you can ^_^.

--- DOWNLOAD ---










2018-05-22, 18:39:27
Reply #12

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
So did some testing on a sim from Phoenix FD here, and it is indeed the scaling of the Temperature. Not sure if there's a way to adjust it on export from Phoenix, but on import I had to use very small values in the Emission Scale, and in the Input Scaling (I ran Auto-scale first too), and fairly dark colors, and very low positions on the grid - see attached image.

Since it works in a much more "expected" way with the sample OpenVDB files, and can be made to work by adjusting the settings for a Phoenix FD exported OpenVDB, I am thinking this is related to how Phoenix is writing out the temperature rather than a bug or issue with CoronaVolumeGrid.

2018-05-22, 18:41:36
Reply #13

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 3503
    • View Profile
PS - without that 0 level point in the Grid at above the halfway mark that keeps everything at the zero until quite far along the scale, the non-flame parts of the CoronaVolumeGrid will also emit light and ruin the effect - so again seems to be how the Temperature is being scaled from the Phoenix FD export.

2018-05-22, 18:53:43
Reply #14

cecofuli

  • Active Users
  • **
  • Posts: 1571
    • View Profile
    • www.francescolegrenzi.com
Thank you so much Tom. Maybe it's a bug in the way how Corona reads Phoenix temperature's value. I don't think it's Phoenix problem =)
« Last Edit: 2018-05-22, 18:59:58 by cecofuli »