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

textureGather - gathers four texels from a texture

Declaration

gvec4textureGather(gsampler2Dsampler,vec2P,[intcomp]);gvec4textureGather(gsampler2DArraysampler,vec3P,[intcomp]);gvec4textureGather(gsamplerCubesampler,vec3P,[intcomp]);gvec4textureGather(gsamplerCubeArraysampler,vec4P,[intcomp]);gvec4textureGather(gsampler2DRectsampler,vec3P,[intcomp]);vec4textureGather(gsampler2DShadowsampler,vec2P,floatrefZ);vec4textureGather(gsampler2DArrayShadowsampler,vec3P,floatrefZ);vec4textureGather(gsamplerCubeShadowsampler,vec3P,floatrefZ);vec4textureGather(gsamplerCubeArrayShadowsampler,vec4P,floatrefZ);vec4textureGather(gsampler2DRectShadowsampler,vec3P,floatrefZ);

Description

textureGather returns the value:

               vec4(Sample_i0_j1(P, base).comp,
                    Sample_i1_j1(P, base).comp,
                    Sample_i1_j0(P, base).comp,
                    Sample_i0_j1(P, base).comp);

       If specified, the value of comp must ba constant integer expression with a value of 0, 1, 2, or 3,
       identifying the x, y, z or w component of the four-component vector lookup result for each texel,
       respectively. If comp is not specified, it is treated as 0, selecting the x component of each texel to
       generate the result.

Name

       textureGather - gathers four 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.

       comp
           Specifies the component of the source texture that will be used to generate the resulting vector.

       refZ
           Specifies the reference Z value used in the comparison for shadow forms.

See Also

texelFetch(), texelFetchOffset(), texture(), 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          │      │      │      │      │      │      │      │      │      │      │      │      │
       ├───────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureGather │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       └───────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also