Want to have a diffuse air inside a room and clear air outside

Use this forum for general user support and related questions.
lighting_freak
Posts: 157
Joined: Thu Jan 18, 2018 6:02 pm

Want to have a diffuse air inside a room and clear air outside

Post by lighting_freak » Wed Jan 02, 2019 6:34 pm

Hi all, and a happy New Year to everyone.

I'm trying to create a room setup with visible sun beams inside (like dust).
I've reached this result with a scattering volume with 0 scattering scale and it shows a clear sky through the windows.
No_scatter.jpg
As soon as I add a little scatter (here 0,001) the sky becomes blurry white. It seems that the volume outside becomes diffuse too.
0_001_scatter.jpg
There is the sample file, I hope you could help me.
Diffuse_World_Volume.blend
(1.01 MiB) Downloaded 58 times
Thank you
BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

CodeHD
Posts: 182
Joined: Tue Dec 11, 2018 12:38 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by CodeHD » Wed Jan 02, 2019 6:39 pm

Hi and happy new year to you too ;)

The recommendation that is often given here is to create a cube (or similar) that encloses your room, and give that cube a null material + homogeneous internal volume. external volume = world volume = clear.
You then have to be careful to get material priorities right as to not "overwrite" any of your objects by it, e.g. glass windows.

Hope this helps.

lighting_freak
Posts: 157
Joined: Thu Jan 18, 2018 6:02 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by lighting_freak » Thu Jan 03, 2019 5:46 pm

Thanks for your hint, but what is wrong with my logic?

I put the camera into my diffuse volume and all light that enters the scene should run through the windows.
The windows itself are separated into internal and external surfaces.
The internal faces have a glass to diffuse air volume interface.
The external surfaces point from glass into "nothing" (so world volume).
The world volume has been unset (so clean clear air).

I don't like the box idea. It may causes troubles with more complex geometries...

BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

CodeHD
Posts: 182
Joined: Tue Dec 11, 2018 12:38 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by CodeHD » Thu Jan 03, 2019 6:32 pm

just realised you uploaded a blend-file already yesterday, so I had a look at it.

The way you set it up doesn't seem to me like something that should work, in any case it's quite strange.
I have to say I don't feel like an expert in volume stuff yet, but here are my thoughts:

- First, "unsetting the world volume" doesn't mean it is clean air, it is rather determined automatically.
- Your window setup is probably bound to cause trouble. If you really want to have different surfaces, don't overlap a cube with a plane. Give the cubic glass two materials and assign it to the surfaces accordingly. In your way, the plane might be ignored by floating point errors, ore counted twice (into plane, out of plane, then into glass, out of glass). Together with the fact that you did not set an exterior volume for the glass, this (or any of this) might make the homogeneous air the de-facto world-volume.
- I see your logic that the rays are only to scatter after the window, but it doesn't seem to be a clean way to set it up. I really think you should go for the box approach.
- In any case, given that beam visibility exists in nature with one (pretty) homogeneous world voume, you might try to lower the scattering scale even further. You should also combine this with a forward scattering asymmetry (positive value), which is how dust scattering behaves.

CodeHD
Posts: 182
Joined: Tue Dec 11, 2018 12:38 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by CodeHD » Thu Jan 03, 2019 7:05 pm

Here, I roughly set it up and got this result:
dustairtest.png
In the blend file, you will notice I changed your windows to make them a full body again, with the two different face-materials as I mentioned. It is just for demonstration though, you can delete the "glas2" material to get the same result.
Attachments
Diffuse_World_Volume_chd.blend
(1.04 MiB) Downloaded 56 times

lighting_freak
Posts: 157
Joined: Thu Jan 18, 2018 6:02 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by lighting_freak » Fri Jan 04, 2019 9:11 pm

Hi CodeHD,

I've tested your box approach. It works and delives pretty much the result that I wanted to see.
Nevertheless I'd like to find a box-free solution (for more complex scenes - far away from arch-vis application)

With your advice I've joined the two elements that separated inside and outside of the window (well and deleted the box).
World volume and camera volume is not touched. Now I'm receiving this result:
Sun_beams_V02.jpg
It looks like half of one window does what I'd like it to do. All the others seem to be handled like a clear volume everywhere.
This is the corresponding Blend file:
Diffuse_World_Volume_l_f.blend
(1.07 MiB) Downloaded 63 times
BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease

CodeHD
Posts: 182
Joined: Tue Dec 11, 2018 12:38 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by CodeHD » Sat Jan 05, 2019 2:55 pm

The half window beam happens where the rays coming from the sun through the window hit the second windows inside the room. Now at this point I am not sure anymore how to explain everything, due to a lack of knowledge of the source code. Rememeber that in a BiDir path tracer, rays are initiated at both the camera and the light source. It is sufficient here to give the second window a glass-to-dust transition to see the beam. It all depends on when which rays have the volume evaluated.
I tried some other "workaround"-ideas I had to get it to work the way you want it to, but didn't suceed.

Btw., in your new file, the interior windows were not fixed correctly, your old glass-to-dust plane does not overlap with the remaining glas-box. Also, I would run a "remove doubles" after joining to really fuse them back into one object.

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

Re: Want to have a diffuse air inside a room and clear air outside

Post by B.Y.O.B. » Sat Jan 05, 2019 3:00 pm

IIRC with Bidir you currently have the problem that you can't define a starting volume for light sources (apart from meshlights).
So you have to resort to tricks like boxes in some cases because of this oversight/missing feature.
For the unidirectional engines this doesn't matter because all rays start from the camera there.
Support LuxCoreRender project with salts and bounties

CodeHD
Posts: 182
Joined: Tue Dec 11, 2018 12:38 pm

Re: Want to have a diffuse air inside a room and clear air outside

Post by CodeHD » Sat Jan 05, 2019 4:01 pm

This makes me think of another aspect of this. In a previous post i wrote:
CodeHD wrote:
Thu Jan 03, 2019 6:32 pm
- In any case, given that beam visibility exists in nature with one (pretty) homogeneous world voume, you might try to lower the scattering scale even further. You should also combine this with a forward scattering asymmetry (positive value), which is how dust scattering behaves.
I might have been a bit quick with that thought. What I meant to refer to was that sometimes in real life we see beams of sunlight shining through some holes, and that the Earth's atmosphere is fairly homogeneous. However, we don't see beams as strongly as in the previous render examples in a well lit room with 6 windows in broad daylight. You would need some fog for that, and so you couldn't see very far. In other cases, e.g. some rays through a few leaves, there is a higher contrast involded, or also more forward scattering. If we think on bigger scales, the Earths atmosphere is not actually infinite, so a small amount of scatter still leaves it mostly transparent.

The question this leads me to is this: When I set a world volume in LuxCore, over what distance is sunlight evaluated outisde my objects? If I have a laser source, the beam begins at the object, but this is not the case with the Sun lamp (?). If it is computed too far out, I could never get a clear sky appearance with even the smallest scattering scale.

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

Re: Want to have a diffuse air inside a room and clear air outside

Post by B.Y.O.B. » Sat Jan 05, 2019 4:24 pm

I think the sun is placed on a bounding sphere that encloses all meshes in the scene, plus some margin. Look into the sun lamp code to see how it is calculated exactly.
Support LuxCoreRender project with salts and bounties

Post Reply