From LuxRender Wiki
LuxRender includes a flexible, powerful participating media system that controls how light behaves when it moves through objects or the space in-between objects.
When creating a scene that uses volumetric rendering, you create special "mediums" or volume shaders, which are then assigned to the interior and exterior of objects in the scene. The interior medium defines how light moves within the object, the exterior medium defines how light moves through the space between the object it just left and the next one it encounters.
The interior volume setting is primarily used to give absorption and internal scattering to the object it is assigned to. In most cases you will create a separate medium for each material you want to have internal absorption and scattering effects with. The exterior volume setting is generally used to provide atmospheric effects, and is kept the same for all objects in the scene.
Currently, volumes do not have a precedence system. This means that when light moves from one volume to another without passing through air (for example a liquid in a glass), you will need to assign a separate material to the surface where those volumes touch, using the volumes of those two objects as its interior and exterior volume.
When using exterior volumes, some care must be taken with planar meshes such as leaves or cloth. You must make sure to attach the exterior/atmosphere volume to both the interior AND exterior of the mesh, or else some paths involving the surface may confuse Lux as to which volume is which, leading to incorrect appearance for the mesh. (Do not try to use interior mediums planar meshes, it will not work). The reason for all of this is that exterior defines what is in front of the face, and interior defines what is behind it. In the case of a planar mesh/open shape, this would be the same air/water/fog/vacuum/etc on both sides, so both volumes must be that same air/water/fog/vacuum/etc. (leaving both of them blank counts as "matching" since LuxRender assumes a blank volume is just a vacuum. This should be done if you aren't using external scattering). Alternately, you can try using a "solidify/thickness" tool in your modeler to make the mesh a closed volume.
In some cases having the volume continue behind the plane is desired, such as using a "glass" plane as the surface of water in an opaque container. In this case, the volume will continue beyond the plane until it hits a solid object, which will give you volumetric water while only ever modeling the surface.
LuxRender always requires objects to have a surface material defined. If you want a "volume only" object, such as for a cloud or smoke simulation container, add a null material to the surface to make it transparent.
There are 3 different types of volume materials. All 3 are general-purpose "uber" shaders, just with varying complexity.
Clear is a simple volume that features refraction and absorption but no scattering. 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 (subsurface absorption) with little performance cost. However, this is not true subsurface scattering and may not look correct, especially when blocking bright light sources.
It has two properties, an index of refraction and an absorption color.
absorption color (sigma_a)
The absorption color determines how light is lost as it passes through the volume. This defines an attenuation rate, meaning that the color will be become more dark and saturated the farther it travels through the 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.
Since this is very counter-intuitive for many people, a special texture type is provided to simplify this, Color at Depth. This texture takes an RGB color and a distance of how far a light ray should travel through the volume before reaching that color. It will then output an absorption spectrum for you based on that data. If a ray travels exactly the given distance, it will match the color you set. If it travels a shorter distance, it will be lighter and less saturated than the given color. If it travels farther than the specified distance, it will be darker and more saturated. Unlike the normal absorption color, color at depth allows you to set a color and have your volume actually be that color. Its transmission-color value is also textureable, allowing things such as spectral colors at a particular depth.
It is also possible to set absorption using measured data, via the tabulateddata texture type. This should be attatched 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 (fresnel)
The refractive properties are defined by the fresnel value. It can accept a constant IOR value, or you can define more complex datasets with the fresnel textures
Not all materials support volume refraction. In fact, in LuxRender 1.3 (and previous versions), the only material that will use it is glass2, all others either do not account for refractions in the first place, or have their own simple IOR settings that will be used instead.
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 as the world volume, which will enable atmospheric scattering.
IMPORTANT: Atmospheric scattering is very light. To simulate it efficiently, you should use the "single" volume integrator, not "multi". This will greatly reduce the noise in the scene. The "multi" integrator should be used with heavy internal scattering (aka 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 (sigma_s)
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 strictly an RGB float like other color fields. You can specify values higher than 1. In fact, for heavy interior volumes you will often need to use values in the 30-100 range, or even higher. For atmospheric effects, a value of about .1 is plenty, and may even be too much. To help deal with this wide range of values, some exporters will present you with a set of RGB values and a "scale factor" that the RGB values will be multiplied by. So if you want a final coefficient around 100 with a blue tint, you could set the scale factor to 100, and use .9, .9, 1.0 as the RGB values. This will result in the final coefficient of 90, 90, 100.
Technically speaking, scattering color (also known as sigma_s) and absorption (also known as sigma_a) aren't so much colors, as probability values. To help understand them, you can think of them more simply as not being colors, just values or shades of grey. As a ray travels through the volume, one of two things can happen to it at any time. It can either be absorbed (losing its energy and disappearing) or it can be scattered (reflecting out in another direction). Sigma_a and sigma_s are the respective probabilities of these events occurring over a given travel distance. The higher they are, the shorter (on average) a ray needs to travel through the volume before an event occurs. For example, raising sigma_a increases the chance the average ray will be absorbed, thus darkening the volume. Raising sigma_s increases the chance of a scattering event, causing the volume to appear brighter and more dense.
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 (g)
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), negative values are more backward scattering (best for opaque particles). 0 is isotropic, meaning the light is scattered evenly in all directions.
You can see a screenshot of the setup in 3D space here.
The heterogeneous medium is the most powerful (and also the slowest) of the 3 medium 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 hetereogeneous volume can be used as the exterior medium as well, although this comes at a substantial performance cost (even 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.
The clear and homogeneous volumes evaluate volume properties once during a ray's transit (at the entry point). 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, heterogenous 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.
The heterogeneous volume has the same properties as the homogeneous volume, with one extra setting, 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.