Volumetrics issues

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
daros
Posts: 280
Joined: Thu Dec 12, 2019 3:25 pm
Location: inside human language
Contact:

Re: Volumetrics issues

Post by daros »

Thanks dade, Monday we are going to implement your advice. Thanks for your patience.
View 01 1600x800_1.jpg
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Volumetrics issues

Post by B.Y.O.B. »

Maybe we could use an in-depth, technical guide to volume setup to help users of the LuxCore API understand the system better? (Of course, the question is who has time to write it)
daros
Posts: 280
Joined: Thu Dec 12, 2019 3:25 pm
Location: inside human language
Contact:

Re: Volumetrics issues

Post by daros »

I think that my programmer, Bartosz, which now knows very well how the volumes work in Luxcore could do it. It should not take him more as 20 minutes to write down the rules. I will ask him monday.
Taka
Donor
Donor
Posts: 65
Joined: Wed Mar 20, 2019 7:24 pm

Re: Volumetrics issues

Post by Taka »

daros wrote: Sun Oct 17, 2021 8:55 am I think that my programmer, Bartosz, which now knows very well how the volumes work in Luxcore could do it. It should not take him more as 20 minutes to write down the rules. I will ask him monday.
That'd be really helpful!
User avatar
DionXein
Posts: 81
Joined: Mon Jun 01, 2020 10:22 am

Re: Volumetrics issues

Post by DionXein »

daros wrote: Sun Oct 17, 2021 8:55 am I think that my programmer, Bartosz, which now knows very well how the volumes work in Luxcore could do it. It should not take him more as 20 minutes to write down the rules. I will ask him monday.
Cool, can you post link here, then it will be ready?
daros
Posts: 280
Joined: Thu Dec 12, 2019 3:25 pm
Location: inside human language
Contact:

Re: Volumetrics issues

Post by daros »

we completed the implementation of dade's latest instructions yesterday and yes it seems to work well. This monday bartek will write down a few lines about how the volumes have to be set accordingly to different situations.
bartek_zgo
Posts: 116
Joined: Mon Oct 26, 2020 11:42 am

Re: Volumetrics issues

Post by bartek_zgo »

I will try to write some brief summary.
In Luxcore first we add some volume definition:

Code: Select all

scene.volumes.fogVolume.type = "homogeneous"
scene.volumes.fogVolume.absorption = "0 0 0"
scene.volumes.fogVolume.scattering = "0.02 0.02 0.02"
scene.volumes.fogVolume.asymmetry = "0 0 0"
scene.volumes.fogVolume.multiscattering = 0
scene.volumes.fogVolume.priority = 0
scene.volumes.fogVolume.ior = "1"
Then we have to assign this volume to some objects in the scene. To find out where we have to assign this volume we have to understand the logic that is behind this. To create the volume effect the light ray that is travelling threw the scene has to be “tagged” with the volume.
Let’s assume that we are using path tracing. At first the ray starts from the camera. If the camera is inside the volume we assign the volume to the camera:

Code: Select all

scene.camera.volume = "fogVolume"
Then the ray hits some surface. In that case we have opportunity to assign or change the volume. If the camera is outside volume this is the first possibility to tag the ray with volume.
If we want to create more complex effect like a foggy day and some space that is filled with smoke we can tag the ray with different volume inside the space.

Code: Select all

scene.materials.smoke_box_material.volume.interior = "smokeVolume"
scene.materials.smoke_box_material.volume.exterior = "fogVolume"
The situation is more complex for BiDir. In this situation the ray may start from camera or light source. If the light ray starts from the light source and arrives to camera without hitting any object, it will not have any information about volume. So in that case we have to add information about volume to light source:

Code: Select all

scene.lights.lightName.volume = "envVolume"
or if we are using geometrical lights:

Code: Select all

scene.materials.emmitter_material.volume.interior = "fogVolume"
scene.materials.emmitter_material.volume.exterior = "fogVolume"
That is the theory.
From practical point of view if we want to create a fog effect in the scene (one type of fog for the entire scene) we have to follow those simple steps.

1. Create a box that will enclose the entire scene because we don’t want to have infinite volume. Then assign volume to that box:

Code: Select all

scene.materials.fogVolume_material.type = "null"
scene.materials.fogVolume_material.volume.interior = "fogVolume"
2. Now we have to understand if we have to assign volume to the camera. We assign volume to the camera ONLY if the camera is inside the volume.

Code: Select all

scene.camera.autovolume.enable = 0
scene.camera.volume = "fogVolume"
3. We assign volume to all light sources that are inside fog. Sun and environment are always outside volume so we do not change it.

Code: Select all

scene.lights.lightName.volume = "fogVolume"
or if we are using geometrical lights:

Code: Select all

scene.materials.emmitter_material.volume.interior = "fogVolume"
scene.materials.emmitter_material.volume.exterior = "fogVolume"

If I made any mistake, please correct.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Volumetrics issues

Post by B.Y.O.B. »

Thanks for this summary, it will definitely be useful for others.
Post Reply