Home Reference VEX VEX contexts 

fog vex context

Define a fog shader with a program that modifies the Cf, Of, or Af values to simulate atmospheric effects.

The purpose of a fog shader is to modify the Cf, Of or Af variables after the surface shader has completed its shading. You can use illuminance statements inside fog shaders.

Globals

Time (read-only)

The time at which the shading occurs, as a number from 0 (shutter open) to 1 (shutter close).

dPdz (read-only)

Floating point step size for volume rendering.

P (read-only)

Position of the point on the surface being shaded. In light or shadow shaders, the P variable contains the point on the light source.

Ng (read-only)

Geometric normal for the surface. This normal represents the “true” normal of the surface being shaded. For example, with Phong shading, the N variable represents the interpolated normal, while the Ng variable represents the true polygon normal.

L (read-only)

Vector from the point on the surface to the light source. The length of this vector represents the distance to the light source.

dPds (read-only)

Change in position with respect to the parametric s.

Pz (read-only)

Z component of the point being shaded.

I (read-only)

Direction from the eye to the point being shaded. This may or may not be a normalized vector.

Of

Final opacity for the surface. A value of {1,1,0} will be opaque in red/green, but let through blue light from behind. See opacity vs. alpha .

Eye (read-only)

Position of the eye.

dPdt (read-only)

Change in position with respect to the parametric t.

Cf

Final color for the surface. The vector represents the RGB color .

t (read-only)

Parametric t (sometimes called v) coordinate of the surface being shaded.

N (read-only)

Shading normal for the surface.

Cl

Light color.

s (read-only)

Parametric s (sometimes called u) coordinate of the surface being shaded.

Af

Final alpha for the surface. This is the value which is placed in the alpha channel of the output image. See opacity vs. alpha .