shadowmap VEX function

The shadowmap function will treat the shadow map as if the image were rendered from a light source.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

See also: depthmap

  1. float shadowmap(string filename, vector Pndc, float spread, float bias, float quality)

  2. vector shadowmap(string , vector , float , float , float )

  3. float shadowmap(string , vector , float , float , float )

  4. vector shadowmap(string , vector , float , float , float )

  5. vector shadowmap(string , vector , vector , vector , vector , float , float , float )

The shadowmap function will treat the shadow map as if the image were rendered from a light source. You use this to access both depth maps and deep shadow maps. In both cases it returns a vector where each color component has the visibility of the light source to the point for that color.

Pndc is the position of the point being shaded in the NDC space of the light’s projection. spread is a softness control on the shadow. bias controls how accurate the depth samples need to be. quality is a general control to increase/decrease sampling, where 1 is default quality.

Note

This function returns the fractional amount of illumination which reaches the sample point. For example, if the point is fully in shadow, the return value will be 0, if it is fully illuminated, the return value will be 1.