Page 1 of 1

scene.volumes.<volume name>.absorption

Posted: Mon Feb 04, 2019 11:03 pm
by mick
What is scene.volumes.<volume name>.absorption exactly?

The ratio of power loss of a ray traveling 1 unit through that volume? So glass with a thickness of 1 and absorption of 1 is opaque?

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 11:03 am
by Dade
mick wrote: Mon Feb 04, 2019 11:03 pm What is scene.volumes.<volume name>.absorption exactly?

The ratio of power loss of a ray traveling 1 unit through that volume? So glass with a thickness of 1 and absorption of 1 is opaque?
Absorption isn't a linear phenomenon, it is exponential (aka Beer’s law): http://www.pbr-book.org/3ed-2018/Volume ... ml#eq:beer (http://www.pbr-book.org/3ed-2018/Light_ ... m-sampling)

So it is something like:

Transmittance = Exp(-<absorption> * <distance>)

For a clear volume, you have also to factor scattering for other types (instead of "<absorption>", it is "<absorption> + <scattering>").

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 11:13 am
by B.Y.O.B.
You can plug a colordepth texture into the volume's absorption slot for easier usage: https://github.com/LuxCoreRender/LuxCor ... th.cpp#L45
To explain the parameters: kt is the color of white light after travelling the distance d.

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 6:58 pm
by mick
Dade, thanks for the reply.
Dade wrote: Tue Feb 05, 2019 11:03 am Transmittance = Exp(-<absorption> * <distance>)
I'm aware that this must be an exponential function. But is it exactly that function with a base of e?
power_out = power_in * e^(-absorption * distance)

So with an absorption of 0.7 a glass plate with a thickness of 1 reduces the radiation from normal angle rays by roughly 50%.

This ignores kt and kr. kt=1 and kr=0 brings full transmission into the volume? At least for normal angle rays?

Is there any documentation about the underlying functions used?

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 7:01 pm
by mick
B.Y.O.B. wrote: Tue Feb 05, 2019 11:13 am You can plug a colordepth texture into the volume's absorption slot for easier usage: https://github.com/LuxCoreRender/LuxCor ... th.cpp#L45
To explain the parameters: kt is the color of white light after travelling the distance d.
I saw this in blender. But this parameter do not exist in the python API, right?

Also this not composition is not available via python, is it?

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 7:06 pm
by B.Y.O.B.
mick wrote: Tue Feb 05, 2019 7:01 pm I saw this in blender. But this parameter do not exist in the python API, right?

Also this not composition is not available via python, is it?
The whole Blender addon is written in Python. Only the mesh and hair export is done in C++, but only because that's faster - you could do it in Python as well. The colordepth texture is available from Python, like any other texture.
Here's the BlendLuxCore code: https://github.com/LuxCoreRender/BlendL ... __.py#L211
You will have to search for the helper functions "utils.create_props" and "utils.absorption_at_depth_scaled" to see the whole process, but I hope it helps.

Re: scene.volumes.<volume name>.absorption

Posted: Tue Feb 05, 2019 8:15 pm
by Dade
mick wrote: Tue Feb 05, 2019 6:58 pm Dade, thanks for the reply.
Dade wrote: Tue Feb 05, 2019 11:03 am Transmittance = Exp(-<absorption> * <distance>)
I'm aware that this must be an exponential function. But is it exactly that function with a base of e?
power_out = power_in * e^(-absorption * distance)

So with an absorption of 0.7 a glass plate with a thickness of 1 reduces the radiation from normal angle rays by roughly 50%.

This ignores kt and kr. kt=1 and kr=0 brings full transmission into the volume? At least for normal angle rays?

Is there any documentation about the underlying functions used?
It is exactly the same physic used by PBRT (the links I posted). It is probably the best documentation you can find.

The code for clear volumes is here: https://github.com/LuxCoreRender/LuxCor ... ar.cpp#L70

If you check the Exp() implementation (https://github.com/LuxCoreRender/LuxCor ... lor.h#L178), it is really e^x.

Re: scene.volumes.<volume name>.absorption

Posted: Sat Feb 09, 2019 3:39 pm
by mick
Thanks, Dade. With that references I should be able find out what I need.

Would please also take a look at my other problem: viewtopic.php?f=4&t=903

Thx

Re: scene.volumes.<volume name>.absorption

Posted: Sun Feb 10, 2019 11:24 pm
by mick
Sorry, I've to come back to this.

Code: Select all

Transmittance = Exp(-<absorption> * <distance>)
does not work for a distance < 1. I would have to specify an absorption > 1, which does neither work in Blender nor LuxCore SDL.

Is there a way to specify an absorption_depth in LuxCore SDL?

Re: scene.volumes.<volume name>.absorption

Posted: Mon Feb 11, 2019 8:30 am
by Dade
mick wrote: Sun Feb 10, 2019 11:24 pm Sorry, I've to come back to this.

Code: Select all

Transmittance = Exp(-<absorption> * <distance>)
does not work for a distance < 1. I would have to specify an absorption > 1, which does neither work in Blender nor LuxCore SDL.
scene.volumes.<volume name>.absorption parameter is clamped between [0, +Infinity] so a value > 1 is perfectly legal and usable in LuxCore SDL.