Graphics Reference
In-Depth Information
vec4 shadow1D( sampler1DShadow sampler,
vec3 coord [, float bias])
vec4 shadow2D( sampler2DShadow sampler,
vec3 coord [, float bias])
vec4 shadow1DProj( sampler1DShadow sampler,
vec4 coord [, float bias])
vec4 shadow2DProj( sampler2DShadow sampler,
vec4 coord [, float bias])
vec4 shadow1DLod( sampler1DShadow sampler,
vec3 coord, float lod)
vec4 shadow2DLod( sampler2DShadow sampler,
vec3 coord, float lod)
vec4 shadow1DProjLod( sampler1DShadow sampler,
vec4 coord, float lod)
vec4 shadow2DProjLod( sampler2DShadow sampler,
vec4 coord, float lod)
Use the texture coordinate coord to do a
depth comparison lookup on the depth
texture bound to sampler , as described
in Section 3.8.14 of Version 1.4 of the
OpenGL specification. The third compo-
nent of coord (coord.p) is used as the R
value. The texture bound to sampler must
be a depth texture, or results are unde-
fined. For the projective (Proj) version
of each built-in, the texture coordinate
is divided by coord.q , giving a depth
value R of coord.p/coord.q . The second
component of coord is ignored for the 1D
variants.
Fragment Processing Functions
GLSL fragment shaders can antialias procedural textures using a variety of
techniques, including analytic prefiltering. To support this, GLSL includes
functions that let you calculate the gradient of any parameter in screen space,
and a function that gives you a value for the upper bound of the width of the
sampling filter needed to eliminate aliasing.
Returns the derivative in x using local differencing for the input
argument p .
genType dFdx(genType p)
Returns the derivative in y using local differencing for the input
argument p .
genType dFdy(genType p)
These two functions are commonly used to estimate the filter width used to antialias procedural tex-
tures. It is assumed that the expression is being evaluated in parallel on a SIMD array, so that at any
given point in time the value of the function is known at the grid points represented by the array.
Local differencing between array elements can therefore be used to derive dFdx , dFdy , etc.
Returns the sum of the absolute derivative in x and y using local
differencing for the input argument p ,
abs(dFdx(p)) + abs(dFdy(p));
genType fwidth(genType p)
Search WWH ::




Custom Search