fog
VEX context

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.

Note

Fog shading is generally obsolete.
Use volume primitives instead.

Globals

vector

Cf

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

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.

float

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.

vector

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.

float

Pz

Read only

Z component of the point being shaded.

vector

I

Read only

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

vector

dPds

Read only

Change in position with respect to the parametric s.

vector

dPdt

Read only

Change in position with respect to the parametric t.

vector

N

Read only

Shading normal for the surface.

vector

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.

vector

Cl

Light color.

vector

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.

vector

Eye

Read only

Position of the eye.

float

s

Read only

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

float

t

Read only

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

float

Time

Read only

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

Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives. This is the periodic simplex noise

Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives.