我通常是一个自给自足的Google员工,但我找不到有关OpenGL着色器功能的任何文档texture2DRect()
.有没有人遇到过这个?
它被用在一些示例代码中,用于在openframeworks中编写着色器,所以我知道它存在,并且它有效,只是找不到任何官方文档.我在哪里可以了解更多关于此功能?
该函数用于对2D纹理矩形(NPOT纹理目标)进行采样,并在GL_ARB_texture_rectangle扩展名的 "OpenGL着色语言规范的版本1.10.59的附加内容"中指定.
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."
Run Code Online (Sandbox Code Playgroud)