Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

textureGrad - perform a texture lookup with explicit gradients

Declaration

gvec4textureGrad(gsampler1Dsampler,floatP,floatdPdx,floatdPdy);gvec4textureGrad(gsampler2Dsampler,vec2P,vec2dPdx,vec2dPdy);gvec4textureGrad(gsampler3Dsampler,vec3P,vec3dPdx,vec3dPdy);gvec4textureGrad(gsamplerCubesampler,vec3P,vec3dPdx,vec3dPdy);gvec4textureGrad(gsampler2DRectsampler,vec2P,vec2dPdx,vec2dPdy);floattextureGrad(gsampler2DRectShadowsampler,vec2P,vec2dPdx,vec2dPdy);floattextureGrad(sampler1DShadowsampler,vec3P,floatdPdx,floatdPdy);floattextureGrad(sampler2DShadowsampler,vec3P,vec2dPdx,vec2dPdy);gvec4textureGrad(gsampler1DArraysampler,vec2P,floatdPdx,floatdPdy);gvec4textureGrad(gsampler2DArraysampler,vec3P,vec2dPdx,vec2dPdy);floattextureGrad(sampler1DArrayShadowsampler,vec3P,floatdPdx,floatdPdy);gvec4textureGrad(gsamplerCubeArraysampler,vec4P,vec3dPdx,vec3dPdy);

Description

textureGrad performs a texture lookup at coordinate P from the texture bound to sampler with explicit
       texture coordinate gradiends as specified in dPdx and dPdy. Set:

       δs δx = δP δx   for a 1D texture,  δP.s δx   otherwise

       δs δy = δP δy   for a 1D texture,  δP.s δy   otherwise

       δt δx = 0.0   for a 1D texture,  δP.t δx otherwise

       δt δy = 0.0   for a 1D texture,  δP.t δy   otherwise

       δr δx = 0.0   for a 1D or 2D texture,  δP.p δx   otherwise

       δr δy = 0.0   for a 1D or 2D texture,  δP.p δy   otherwise

       For the cube version, the partial derivatives of P are assumed to be in the coordinate system used before
       texture coordinates are projected onto the appropriate cube face.

Name

       textureGrad - perform a texture lookup with explicit gradients

Parameters

sampler
           Specifies the sampler to which the texture from which texels will be retrieved is bound.

       P
           Specifies the texture coordinates at which texture will be sampled.

       dPdx
           Specifies the partial derivative of P with respect to window x.

       dPdy
           Specifies the partial derivative of P with respect to window y.

See Also

texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(),
       textureGatherOffsets(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(),
       textureProj(), textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(),
       textureProjOffset(), textureQueryLod(), textureSize()

Version Support

       ┌──────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                          │        OpenGLShadingLanguageVersion                                            │
       ├──────────────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function                 │ 1.10 │ 1.20 │ 1.30 │ 1.40 │ 1.50 │ 3.30 │ 4.00 │ 4.10 │ 4.20 │ 4.30 │ 4.40 │ 4.50 │
       │ Name                     │      │      │      │      │      │      │      │      │      │      │      │      │
       ├──────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureGrad              │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├──────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureGrad              │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (gsampler2DRect{Shadow}) │      │      │      │      │      │      │      │      │      │      │      │      │
       ├──────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureGrad              │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (gsamplerCubeArray)      │      │      │      │      │      │      │      │      │      │      │      │      │
       └──────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also