Functions
Volume Rendering API

Functions

AI_API void AiShaderGlobalsSetVolumeAbsorption (const AtShaderGlobals *sg, const AtRGB &absorption)
 Set the absorption coefficient output of a volume shader. More...
 
AI_API void AiShaderGlobalsSetVolumeAttenuation (const AtShaderGlobals *sg, const AtRGB &attenuation)
 Set the attenuation coefficient output of a volume shader. More...
 
AI_API void AiShaderGlobalsSetVolumeEmission (const AtShaderGlobals *sg, const AtRGB &emission)
 Set the emission coefficient output of a volume shader. More...
 
AI_API void AiShaderGlobalsSetVolumeScattering (const AtShaderGlobals *sg, const AtRGB &scattering, float g=0.f)
 Set the scattering coefficient output of a volume shader. More...
 

Detailed Description

Function Documentation

AI_API void AiShaderGlobalsSetVolumeAbsorption ( const AtShaderGlobals sg,
const AtRGB absorption 
)

Set the absorption coefficient output of a volume shader.

The absorption coefficient is the rate at which the volume absorbs light that is traveling along the given direction at the given point. Any light that traverses a volume with a given absoprtion coefficient will be attenuated at a rate of:

attenuation = expf(-(scattering_coefficient + absorption_coefficient) * distance_travelled)

Parameters
sgshader globals that the volume shader was invoked with
absorptionabsorption coefficient
AI_API void AiShaderGlobalsSetVolumeAttenuation ( const AtShaderGlobals sg,
const AtRGB attenuation 
)

Set the attenuation coefficient output of a volume shader.

The attenuation coefficient is the rate at which the volume absorbs and/or out-scatters light that is traveling along the given direction at the given point. Any light that traverses a volume with a given attenuation coefficient will be attenuated at a rate of:

attenuation = expf(-attenuation_coefficient * distance_travelled)

Note
The volume's attenuation affects both its emission and its scattering, and for the volume to be energy conserving, the rate of scattering must not be higher than the rate of attenuation.
Parameters
sgshader globals that the volume shader was invoked with
attenuationattenuation coefficient
AI_API void AiShaderGlobalsSetVolumeEmission ( const AtShaderGlobals sg,
const AtRGB emission 
)

Set the emission coefficient output of a volume shader.

The emission coefficient is the rate at which the volume emits light along the given direction at the given point. Any ray that traverses a volume with a given emission coefficient will have radiance added at a rate of:

emission = emission_coefficient * distance_travelled

Note
The volume's emission is itself affected by the volume's attenuation.
Parameters
sgshader globals that the volume shader was invoked with
emissionemission coefficient
AI_API void AiShaderGlobalsSetVolumeScattering ( const AtShaderGlobals sg,
const AtRGB scattering,
float  g 
)

Set the scattering coefficient output of a volume shader.

The scattering coefficient is the rate at which the volume in-scatters radiance along the given direction at the given point, and the 'g' parameter is the Henyey-Greenstein phase at the given point. These coefficients are used for both direct and indirect light paths, and the amount of in-scattered radiance is:

scattering = scattering_coefficient * HenyeyGreensteinPhaseFunc(g, sg->Ld, sg->Rd) * radiance * distance_travelled

Note
The volume's scattering is itself affected by the volume's attenuation, and for the volume to be energy conserving, the rate of scattering must not be higher than the rate of attenuation.
Parameters
sgshader globals that the volume shader was invoked with
scatteringscattering coefficient
gHenyey-Greenstein phase, in the open interval (-1,+1) where negative values mean backward anisotropic scattering, positive values mean forward anisotropic scattering, zero means isotropic scattering

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com