Views
AtmosphereShaders
From Odwiki
In mantra and RenderMan complient renderers, atmosphere shaders are used to globally modulate the results of SurfaceShader execution.
On entry to the atmosphere shader, the Cf/Ci and Of/Oi variables are initialized with the results of the surface shader. The atmosphere shader can modify these values in any way it chooses.
A simple depth-cue atmosphere shader (written in VEX) might look something like:
atmosphere
depthcue(float near=.1, far=100)
{
Cf *= smooth(near, far, P.z);
}
Of course, an atmosphere shader doesn't have to simulate fog effects, it can modify the Cf variable in any way it chooses. For example:
atmosphere
negative()
{
Cf = 1-Cf;
}



