在哪里可以找到有关OpenGL着色器函数texture2DRect()的文档? [英] Where can I find documentation on the OpenGL shader function texture2DRect()?

查看:165
本文介绍了在哪里可以找到有关OpenGL着色器函数texture2DRect()的文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常是一个自给自足的Googler,但是我找不到有关OpenGL着色器功能texture2DRect()的任何文档.有人遇到过这个吗?

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?

它在一些示例代码中用于在openframeworks中编写着色器,因此我知道它的存在,并且它可以工作,只是找不到任何正式文档.在哪里可以了解有关此功能的更多信息?

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?

推荐答案

该函数用于对2D纹理矩形(NPOT纹理目标)进行采样,并在"OpenGL着色语言的1.10.59版本的附加内容"中进行了指定 GL_ARB_texture_rectangle扩展.:

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."

这篇关于在哪里可以找到有关OpenGL着色器函数texture2DRect()的文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆