Difference between revisions of "LuxCoreRender Volumes"

From LuxCoreRender Wiki
Jump to navigation Jump to search
Line 26: Line 26:




Clear is a simple volume that features refraction and absorption. It is primarily meant to be used with clear materials, such as colored glass. It can also be used to add some extra realism to translucent material with little performance cost. It has two properties, an index of refraction(IOR) and an absorption color.  
Clear is a simple volume that features refraction and absorption. It is primarily meant to be used with clear materials, such as colored glass. It can also be used to add some extra realism to translucent materials with little performance cost. It has two properties, an index of refraction(IOR) and an absorption color.  




''' Absorption Color '''
''' Absorption Color '''


The absorption color determines how light is lost(absorbed) as it passes through the volume. This defines an attenuation rate, meaning that the color will be become darker and more saturated the farther it travels through the volume. Your exporter should have a ''Color at Depth'' setting which will make the volume match the absorption color at the depth you specify.
This is the main color of the volume. It determines how light is lost(absorbed) as it passes through the volume, making the color darker and more saturated the farther it travels through the volume. Your exporter will have a ''Color at Depth'' setting which will make the volume match the absorption color at the depth you specify.


<!-- It also means that this color control will seem to work "backwards". If you specify the raw absorption color as red, it will remove red light, leaving you with a cyan volume.
<!-- It also means that this color control will seem to work "backwards". If you specify the raw absorption color as red, it will remove red light, leaving you with a cyan volume.
Line 39: Line 39:
<!--
<!--
It is also possible to set absorption using measured data, via the tabulated data texture type. This should be attached to the absorption color channel without using color at depth. If your file uses a unit other than meters for distances, the absorption color output should be scaled to compensate using the scale texture.  -->
It is also possible to set absorption using measured data, via the tabulated data texture type. This should be attached to the absorption color channel without using color at depth. If your file uses a unit other than meters for distances, the absorption color output should be scaled to compensate using the scale texture.  -->


''' Index of Refraction '''
''' Index of Refraction '''


The refractive properties are defined by the IOR value. <!--fresnel value --> Your exporter will have some preset ready for the most common volumes.
The refractive properties are defined by the IOR value. <!--fresnel value --> Your exporter will have some preset ready for the most common volumes.It's important to note that the only material that will use this IOR setting is [[LuxCoreRender_Materials_Glass|glass]]. The other transmissive materials([[LuxCoreRender_Materials_Null|null]], [[LuxCoreRender_Materials_Matte_Translucent|matte translucent]] and [[LuxCoreRender_Materials_Glossy_Translucent|glossy translucent]]) do not support refraction.
 
It's important to note that the only material that will use this IOR setting is [[LuxCoreRender_Materials_Glass|glass]]. The other transmissive materials(null, matte translucent and glossy translucent) do not support refraction.




Line 69: Line 66:


As to why these are colors values, that becomes simple to explain: they are wavelength dependent. Rather than being a constant value for all frequencies of light, they allow different values for different colors of light. For example, making sigma_a yellow increases the chance that yellow light will be lost compared to other colors, causing the volume to take on the color of the remaining light (in this case, it's yellow's complement, purple). -->
As to why these are colors values, that becomes simple to explain: they are wavelength dependent. Rather than being a constant value for all frequencies of light, they allow different values for different colors of light. For example, making sigma_a yellow increases the chance that yellow light will be lost compared to other colors, causing the volume to take on the color of the remaining light (in this case, it's yellow's complement, purple). -->


''' Scattering asymmetry '''
''' Scattering asymmetry '''


The asymmetry value is a number between -1 and +1 that determines if the scattering is primarily forward (light is scattered in the same direction as the ray was traveling) or backwards (light is scattered back towards where the ray came from). Positive values are more forward scattering (best for clear particles) and negative values are more backward scattering (best for opaque particles). 0 is isotropic, meaning the light is scattered evenly in all directions.
The asymmetry value determines the scattering direction. A positive value is primarily forward scattering (light is scattered in the same direction as the ray was traveling) and a negative value is backwards (light is scattered back towards where the ray came from). Clear particles have a more forward scattering and opaque particles a more backwards scattering. The default value 0 scatters light evenly in all directions. Range: -1 to +1.


<!--
<!--
You can see a screenshot of the setup in 3D space here.  -->
You can see a screenshot of the setup in 3D space here.  -->




=== Heterogeneous Volume ===
=== Heterogeneous Volume ===


The heterogeneous medium is the most powerful (and also the slowest) of the three volume types. It has the same functionality as the homogeneous volume, but it also includes ray-marching support. This means it can deal with volumes with varying internal properties, such as clouds, smoke, and ground-hugging fog.
The heterogeneous volume is the most powerful (and also the slowest) of the three volume types. It has the same functionality as the homogeneous volume, but it also includes ray-marching support. This means it can deal with volumes with varying internal properties, such as clouds, smoke, and ground-hugging fog. It has the same properties as the homogeneous volume, with one extra setting, step size.  


The heterogeneous volume can be used as the exterior medium as well, although this comes at a substantial performance cost (even when not using multiscatter) <!--with the "single" volume integrator--> and is not recommended in most cases. A dedicated "volume container" object should be used when rendering things such as clouds or fog. A simple cube with a null material works fine as a container.
The heterogeneous volume can be used as the exterior volume as well, although this comes at a substantial performance cost (even when not using multiscatter) <!--with the "single" volume integrator--> and is not recommended in most cases.  


The clear and homogeneous volumes evaluate volume properties only once as it enters the volume. They assume these properties hold constant all the way to other side of the volume. For volumes that are continuous, this is a helpful optimization. However, if the volume is not continuous (such as a cloud), this causes blurred details and the edges of the volume container to become visible. In order to handle changing details, heterogeneous subdivides the volume transit path into several sub-paths (a process known as ray-marching) and evaluates the properties again at each sub-point.
The clear and homogeneous volumes evaluate volume properties only once as it enters the volume. They assume these properties hold constant all the way to other side of the volume. For volumes that are continuous, this is a helpful optimization. However, if the volume is not continuous (such as a cloud), this causes blurred details and the edges of the volume container to become visible. In order to handle changing details, heterogeneous subdivides the volume transit path into several sub-paths (a process known as ray-marching) and evaluates the properties again at each sub-point.  


<!--
<!--
There are several textures to support the heterogeneous medium by providing data of volume structures. The "exponential" texture will create a rising gradient to produce ground-fog. The "cloud" texture (not to be confused with the "blender_clouds" perlin noise texture) is a procedural cloud generator for weather effects. The "densitygrid" texture can load voxel datasets for custom volume shapes. All three of these textures have a float output type. They should be used to control a "mix" or "band" texture varying between black and the desired scattering or absorption color. Both scattering and absorption must be textured, one is not auto-scaled by the other. -->
There are several textures to support the heterogeneous medium by providing data of volume structures. The "exponential" texture will create a rising gradient to produce ground-fog. The "cloud" texture (not to be confused with the "blender_clouds" perlin noise texture) is a procedural cloud generator for weather effects. The "densitygrid" texture can load voxel datasets for custom volume shapes. All three of these textures have a float output type. They should be used to control a "mix" or "band" texture varying between black and the desired scattering or absorption color. Both scattering and absorption must be textured, one is not auto-scaled by the other. -->
The heterogeneous volume has the same properties as the homogeneous volume, with one extra setting, step size.


''' Step Size '''
''' Step Size '''


Step size defines the spacing between the ray-marching sub paths, in meters. Smaller steps will show greater volume detail, but are slower to render. Setting too large of steps may result in a blocky or noisy appearance of the volume.
Step size defines the spacing between the ray-marching sub paths, in meters. Smaller steps will show greater volume detail, but are slower to render. Setting too large of steps may result in a blocky or noisy appearance of the volume.

Revision as of 09:10, 16 December 2017

LuxCoreRender includes a flexible and powerful volume system that controls how light behaves when it moves through objects or the space in-between objects. With it you can create visible sun rays in a dusty room or orange juice or anything in between. Three types of volumes are available to simulate a wide range of volumetric effects.


Volume Types

Clear Volume

Clear is a simple volume that features refraction and absorption. It is primarily meant to be used with clear materials, such as colored glass. It can also be used to add some extra realism to translucent materials with little performance cost. It has two properties, an index of refraction(IOR) and an absorption color.


Absorption Color

This is the main color of the volume. It determines how light is lost(absorbed) as it passes through the volume, making the color darker and more saturated the farther it travels through the volume. Your exporter will have a Color at Depth setting which will make the volume match the absorption color at the depth you specify.


Index of Refraction

The refractive properties are defined by the IOR value. Your exporter will have some preset ready for the most common volumes.It's important to note that the only material that will use this IOR setting is glass. The other transmissive materials(null, matte translucent and glossy translucent) do not support refraction.


Homogeneous Volume

The homogeneous volume represents a volume with an even distribution of microscopic particles. When used as an interior volume, it can be used for subsurface scattering (SSS) or cloudy liquids. It can also be used for atmospheric scattering.

Please note that atmospheric scattering is very light. Set Scattering Color to full white and try setting Scattering Scale to 0.001. To simulate it efficiently, you should keep multiscattering disabled in your exporter. This will greatly reduce the noise in the scene. Multiscattering should be used with heavy scattering volumes, such as milk or orange juice to simulate subsurface scattering (SSS).

Homogeneous uses the same index of refraction and absorption parameters as the clear volume. In addition to those, it has two extra parameters, scattering color and scattering asymmetry.


Scattering Color

The scattering color determines the color and density of the particles. Higher values are denser. This control can also affect the color of your volume, but that will be determined primarily by the absorption color.

While the scattering color has red, green, and blue values, it is not limited to this range. You can specify values higher than 1 (pure white). In fact, for heavy interior volumes you will often need to use values in the 30-1000 range. To help deal with this wide range of values, your exporter will present you with a set of RGB values and a "scale factor" that the RGB values will be multiplied by.


Scattering asymmetry

The asymmetry value determines the scattering direction. A positive value is primarily forward scattering (light is scattered in the same direction as the ray was traveling) and a negative value is backwards (light is scattered back towards where the ray came from). Clear particles have a more forward scattering and opaque particles a more backwards scattering. The default value 0 scatters light evenly in all directions. Range: -1 to +1.


Heterogeneous Volume

The heterogeneous volume is the most powerful (and also the slowest) of the three volume types. It has the same functionality as the homogeneous volume, but it also includes ray-marching support. This means it can deal with volumes with varying internal properties, such as clouds, smoke, and ground-hugging fog. It has the same properties as the homogeneous volume, with one extra setting, step size.

The heterogeneous volume can be used as the exterior volume as well, although this comes at a substantial performance cost (even when not using multiscatter) and is not recommended in most cases.

The clear and homogeneous volumes evaluate volume properties only once as it enters the volume. They assume these properties hold constant all the way to other side of the volume. For volumes that are continuous, this is a helpful optimization. However, if the volume is not continuous (such as a cloud), this causes blurred details and the edges of the volume container to become visible. In order to handle changing details, heterogeneous subdivides the volume transit path into several sub-paths (a process known as ray-marching) and evaluates the properties again at each sub-point.


Step Size

Step size defines the spacing between the ray-marching sub paths, in meters. Smaller steps will show greater volume detail, but are slower to render. Setting too large of steps may result in a blocky or noisy appearance of the volume.