Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find documentation on the OpenGL shader function texture2DRect()?

Tags:

opengl

glsl

I'm normally a self-sufficient Googler, but I can't find any documentation on the OpenGL shader function texture2DRect(). Has anyone come across this before?

It's being used in some sample code for writing shaders in openframeworks, so I know it exists, and it works, just can't find any official docs on it. Where can I learn more about this function?

like image 401
Alan Avatar asked Dec 27 '22 17:12

Alan


1 Answers

That function is used to sample a 2D Texture Rectangle (A NPOT texture target), and it's specified in "Additions to version 1.10.59 of the OpenGL Shading Language specification" of the GL_ARB_texture_rectangle extension.:

Add to section 8.7 "Texture Lookup Functions"

Syntax:

    vec4 texture2DRect(sampler2DRect sampler, vec2 coord)
    vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord)
    vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord)

Description:

    "Use the texture coordinate coord to do a texture lookup in the
    rectangle texture currently bound to sampler.  For the projective
    ("Proj") version, the texture coordinate (coord.s, coord.t) is
    divided by the last component of coord.  The third component of
    coord is ignored for the vec4 coord variant.

    No "bias" parameter or "Lod" suffixed functions for rectangle
    textures are supported because mipmaps are not allowed for
    rectangular textures."
like image 154
Dr. Snoopy Avatar answered Feb 03 '23 12:02

Dr. Snoopy