logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

texture - retrieves texels from a texture

Declaration

gvec4texture(gsampler1Dsampler,floatP,[floatbias]);gvec4texture(gsampler2Dsampler,vec2P,[floatbias]);gvec4texture(gsampler3Dsampler,vec3P,[floatbias]);gvec4texture(gsamplerCubesampler,vec3P,[floatbias]);floattexture(sampler1DShadowsampler,vec3P,[floatbias]);floattexture(sampler2DShadowsampler,vec3P,[floatbias]);floattexture(samplerCubeShadowsampler,vec3P,[floatbias]);gvec4texture(gsampler1DArraysampler,vec2P,[floatbias]);gvec4texture(gsampler2DArraysampler,vec3P,[floatbias]);gvec4texture(gsamplerCubeArraysampler,vec4P,[floatbias]);floattexture(sampler1DArrayShadowsampler,vec3P,[floatbias]);floattexture(gsampler2DArrayShadowsampler,vec4P,[floatbias]);gvec4texture(gsampler2DRectsampler,vec2P);floattexture(sampler2DRectShadowsampler,vec3P);floattexture(gsamplerCubeArrayShadowsampler,vec4P,floatcompare);

Description

texture samples texels from the texture bound to sampler at texture coordinate P. An optional bias,
       specified in bias is included in the level-of-detail computation that is used to choose mipmap(s) from
       which to sample.

       For shadow forms, when compare is present, it is used as Dsub and the array layer is specified in P.w.
       When compare is not present, the last component of P is used as Dsub and the array layer is specified in
       the second to last component of P. (The second component of P is unused for 1D shadow lookups.)

       For non-shadow variants, the array layer comes from the last component of P.

Name

       texture - retrieves texels from a texture

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.

       bias
           Specifies an optional bias to be applied during level-of-detail computation.

       compare
           Specifies the value to which the fetched texel will be compared when sampling from
           gsamplerCubeArrayShadow.

See Also

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

Version Support

       ┌─────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                             │        OpenGLShadingLanguageVersion                                            │
       ├─────────────────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name                        │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ texture                     │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ texture                     │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (gsampler2DRect{Shadow})    │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ texture (gsampler2DMS,      │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ gsampler2DMSArray)          │      │      │      │      │      │      │      │      │      │      │      │      │
       ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ texture                     │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (gsamplerCubeArray{Shadow}) │      │      │      │      │      │      │      │      │      │      │      │      │
       └─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also