PBR rendering of volumes

   12373   16   1
User Avatar
Member
789 posts
Joined: April 2020
Offline
Hello all,

I would like to implement a participating medium for a volume in Mantra. The firdt things I would like to look at are light scattering and “Glowing”.

Is this available in some form?

Any help is appreciated.

Thanks,
Koen
User Avatar
Member
12461 posts
Joined: July 2005
Offline
If you use the VEX Volume Cloud shader, it has support for isotropic() VEX function which supports isotropic scattering of light within a volume.

Don't use the material in the Material Palette; they haven't added isotropic() to it (yet).

Post some results
Jason
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
789 posts
Joined: April 2020
Offline
I'll look into that,

Thanks Jason!

images will follow shortly :-)
User Avatar
Member
1533 posts
Joined: March 2020
Offline
o cool, does this mean we will be getting some pbr SSS shaders soon?

jason
HOD fx and lighting @ blackginger
https://vimeo.com/jasonslabber [vimeo.com]
User Avatar
Member
789 posts
Joined: April 2020
Offline
Hello Jason,

You seem to be very well skilled in uncovering semi hidden and undocumented features :-). I have found the call to isotropic in the code for the vex volume cloud. I could not find documentation on this function. In the vex volume, it takes no arguments, that would probably mean it gets info from the volume.

I would guess that the absorbtion is simply related to the density. If I would like to add scattering, how would I define the scattering coefficient?

Thanks,
Koen
User Avatar
Member
12461 posts
Joined: July 2005
Offline
koen
Hello Jason,
You seem to be very well skilled in uncovering semi hidden and undocumented features :-).

Years of scouring the development Journals has made me a great scavenger, a sort of Fisher King

koen
I have found the call to isotropic in the code for the vex volume cloud. I could not find documentation on this function. In the vex volume, it takes no arguments, that would probably mean it gets info from the volume.

I would guess that the absorbtion is simply related to the density. If I would like to add scattering, how would I define the scattering coefficient?

AFAIK, the scattering coefficient is directly related to the density of the Volume, you're right. The big difference with rendering Volumes with scattering is that now the scattering works across a heterogeneous medium as opposed to a homogeneous medium (varying vs. constant density). What you're probably lacking is a control to cheat that apparent density, yes? I wonder if the light's Shadow Density can provide that control? Another control to boost the scattering contribution, perhaps?
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
789 posts
Joined: April 2020
Offline
Hey Jason,

In a heterogeneous medium, I would like to control three phenomena,
Absorption, Emission and Scattering.

The combined effect of Absorption and out-scattering seems to be controlled by the density, eg. how much light continues on the current path.

I am not quit sure how to account for the in-scattering, the lighting up of surrounding volume because of the light scatterd. To use this I would have to split the attenuation in its constituent parts. Currently however, I am interested most in controlling the emission (because I am looking at explosions) Is there a field in the volume I can set to control how much energy is added to the system by a voxel?

Thanks for your help!

Koen
User Avatar
Member
12461 posts
Joined: July 2005
Offline
Hi again,
koen
In a heterogeneous medium, I would like to control three phenomena,
Absorption, Emission and Scattering.

The combined effect of Absorption and out-scattering seems to be controlled by the density, eg. how much light continues on the current path.

It would seem that a factor on the isotropic() component would give you some control over the apparent absorption and out-scattering, wouldn't it? Although I think would still be nice to somehow cheat/replace the density of the medium - it's scary to think how easy it would be to add far more light to the volume than what originally entered it and getting into a glowing mess.

As for “how much light continues on the current path”, I might be on the wrong path here, but are you talking about introducing a phase, to emulate single scattering? (sorry, the terms in-scattering is a little vague to me). I suppose this would not longer be called isotropic scattering then.

koen
Currently however, I am interested most in controlling the emission (because I am looking at explosions) Is there a field in the volume I can set to control how much energy is added to the system by a voxel?

As for emission, this should be be able to be handled by just adding in some colour, no? As you would with a hard surface where you can just set a constant colour and it would provide illumination by indirect diffuse reflection. Using photons would be a lot more efficient (hopefully), but I'm not even sure photons are aware of volumes yet.

This warrants a few tests At least while we wait for SESI to set us on the straight and narrow..
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
789 posts
Joined: April 2020
Offline
True, time to just run some tests.

With in-scattering I mean the incoming scattering from neighboring volume, so the “out scatter” of one place is the“in-scatter” for another. But I have to admit I am no expert, I'll have to read up a little. But I definitely want to keep it iso-tropic, I'm having a hard enough time already on simple surfaces with an-isotropic behaviour :-)

I had not thought of just piping in color values over 1, again, let the trials begin :-)

Thanks again,
Koen
User Avatar
Member
12461 posts
Joined: July 2005
Offline
You know, I've just been playing with this and I'm getting very odd results with 9.5.225 that make me think that PBR Volumes are broken. They only seem to accept illumination from one light source - and to boot I'm seeing no scattering. I'm going to update to the latest and try again.

Aw, I've reached my maximum upload quota of 20mb or I'd post images. :cry:
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
12461 posts
Joined: July 2005
Offline
9.5.248's results are the same, I'm afraid. Have you have any more luck?

I'm not sure what's going on :-/
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
789 posts
Joined: April 2020
Offline
I ran some quick test in 9.5.225 this morning, I might have to look into PBR rendering in Mantra a bit more before I get usefull results. Also the rendering time did not go up significantly, indicating to me there is no scatterign going on :-)

Attachments:
mod_billowy_smoke.jpg (6.7 KB)
vex_cloud_pbr.jpg (11.4 KB)
vex_cloud_micro_polygon.jpg (6.5 KB)

User Avatar
Member
1002 posts
Joined: July 2005
Offline
Some limited rendering of volumes in PBR is available in 9.5. The limitations are:
- No support in gallery material shaders
- No emissive volume support
- No photon support
- Only isotropic scattering

Attached is an example using 2 lights. This uses the VEX volume cloud shader, which is set up to correctly render volumes with PBR. PBR uses opacity in a similar way to micropolygon rendering, but you should *not* premultiply the bsdf by the opacity before exporting it (see the VEX volume cloud shader for how to do this in VEX.)

Attachments:
pbr_volume.hip (368.4 KB)
pbr_volume.jpg (28.8 KB)

User Avatar
Member
12461 posts
Joined: July 2005
Offline
Thanks Andrew,

I was wondering if you could clear something else up for me?

I've sent a narrow beam of light through the Volume and I notice two things:

*) If I turn up the intensity of the beam (from 1 to 50), I don't see any deeper scattering of light into the Volume. I'd expect to see the beam bleed into the Volume further. Am I wrong in my expectations?

*) BUG: In the attached file, if I set the /obj/spotlight1 cone down to 10 degrees, the beam totally vanishes. I can get it to re-appear if I turn off the other lights in the scene, but there is definitely something awry.

Gah! Still can't attach stuff. I'll probably have to post elsewhere..
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
789 posts
Joined: April 2020
Offline
Thanks Andrew,
Great to have a working example to disect!

Koen
User Avatar
Member
1002 posts
Joined: July 2005
Offline
jason_iversen
Thanks Andrew,
*) If I turn up the intensity of the beam (from 1 to 50), I don't see any deeper scattering of light into the Volume. I'd expect to see the beam bleed into the Volume further. Am I wrong in my expectations?

Increasing the intensity of the light will just increase the brightness of the illuminated parts of the volume - it won't cause any additional scattering. If you want extra diffuse bounces, it's necessary to increase the “diffuse limit” on the mantra ROP (PBR tab). However, isotropic scattering does not lead to very interesting multi-scattering effects.

jason_iversen
*) BUG: In the attached file, if I set the /obj/spotlight1 cone down to 10 degrees, the beam totally vanishes. I can get it to re-appear if I turn off the other lights in the scene, but there is definitely something awry.

Please submit a bug for this.

Andrew
User Avatar
Member
12461 posts
Joined: July 2005
Offline
andrewc
Increasing the intensity of the light will just increase the brightness of the illuminated parts of the volume - it won't cause any additional scattering.

Ah, I assumed that your scattering was the Jensen-style exponential extinction, which (if I understand it correctly) should allow the light to be visible deeper into the medium. However, I'm picking up that you're using a different model - or have a cutoff distance, perhaps?

jason_iversen
*) BUG: In the attached file, if I set the /obj/spotlight1 cone down to 10 degrees, the beam totally vanishes. I can get it to re-appear if I turn off the other lights in the scene, but there is definitely something awry.

Please submit a bug for this.

Submitted.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
  • Quick Links