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... | |
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)
sg | shader globals that the volume shader was invoked with |
absorption | absorption 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)
sg | shader globals that the volume shader was invoked with |
attenuation | attenuation 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
sg | shader globals that the volume shader was invoked with |
emission | emission 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
sg | shader globals that the volume shader was invoked with |
scattering | scattering coefficient |
g | Henyey-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 |