纹理采样函数
texture2D() is deprecated as of (at least) OpenGL 3.3; see page 99 of the 3.30 GLSL specification. It will continue to be supported in OpenGL compatibility profiles to avoid breaking existing code, but its usage in new code is strongly discouraged.
Between glsl 120 and 130 they changed the function to texture and made it accept every kind of samplers, not just a sampler2D.
EDIT: The details are slightly different for OpenGL ES, but the end result is the same: texture2D() was deprecated and replaced by texture() in OpenGL ES 3.0; see section 8.8 of the 3.0 GLSL ES specification.
gvec4 texture( gsampler1D sampler,
float P,
&n
OpenGL中texture2D被texture替代

在OpenGL 3.3及以上版本,texture2D()函数被弃用,建议使用新的texture()函数替代。texture()函数接受各种类型的sampler,支持1D、2D、3D及Cube等纹理类型,并且可以设置bias参数进行LOD计算。在OpenGL ES 3.0中,类似的改动也发生了,texture2D()被替换为texture()。
最低0.47元/天 解锁文章
6525

被折叠的 条评论
为什么被折叠?



