texture vs texture2D in GLSL

后端 未结 1 1228
小蘑菇
小蘑菇 2020-12-25 12:11

When sampling a 2D texture in GLSL (a uniform sampler2D), the texture function is used and the dimension is inferred from the sampler (2D in this c

相关标签:
1条回答
  • 2020-12-25 12:15

    Yes, 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.

    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.

    0 讨论(0)
提交回复
热议问题