scene.volumes.<volume name>.absorption

Use this forum for general user support and related questions.
Post Reply
mick
Posts: 80
Joined: Mon May 21, 2018 7:57 pm

scene.volumes.<volume name>.absorption

Post by mick » 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?

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

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

Post by Dade » Tue Feb 05, 2019 11:03 am

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>").
Support LuxCoreRender project with salts and bounties

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

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

Post by B.Y.O.B. » 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.
Support LuxCoreRender project with salts and bounties

mick
Posts: 80
Joined: Mon May 21, 2018 7:57 pm

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

Post by mick » 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?

mick
Posts: 80
Joined: Mon May 21, 2018 7:57 pm

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

Post by mick » Tue Feb 05, 2019 7:01 pm

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?

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

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

Post by B.Y.O.B. » Tue Feb 05, 2019 7:06 pm

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.
Support LuxCoreRender project with salts and bounties

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

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

Post by Dade » Tue Feb 05, 2019 8:15 pm

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.
Support LuxCoreRender project with salts and bounties

mick
Posts: 80
Joined: Mon May 21, 2018 7:57 pm

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

Post by mick » Sat Feb 09, 2019 3:39 pm

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

mick
Posts: 80
Joined: Mon May 21, 2018 7:57 pm

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

Post by mick » 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.

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

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

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

Post by Dade » Mon Feb 11, 2019 8:30 am

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.
Support LuxCoreRender project with salts and bounties

Post Reply