Volumetrics issues
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Re: Volumetrics issues
Thanks dade, Monday we are going to implement your advice. Thanks for your patience.
Re: Volumetrics issues
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)
Re: Volumetrics issues
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.
Re: Volumetrics issues
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.
-
- Posts: 117
- Joined: Mon Oct 26, 2020 11:42 am
Re: Volumetrics issues
I will try to write some brief summary.
In Luxcore first we add some volume definition:
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:
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.
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:
or if we are using geometrical lights:
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:
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.
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.
or if we are using geometrical lights:
If I made any mistake, please correct.
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"
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"
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"
Code: Select all
scene.lights.lightName.volume = "envVolume"
Code: Select all
scene.materials.emmitter_material.volume.interior = "fogVolume"
scene.materials.emmitter_material.volume.exterior = "fogVolume"
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"
Code: Select all
scene.camera.autovolume.enable = 0
scene.camera.volume = "fogVolume"
Code: Select all
scene.lights.lightName.volume = "fogVolume"
Code: Select all
scene.materials.emmitter_material.volume.interior = "fogVolume"
scene.materials.emmitter_material.volume.exterior = "fogVolume"
If I made any mistake, please correct.
Re: Volumetrics issues
Thanks for this summary, it will definitely be useful for others.