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?
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."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With