纹理采样函数
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,
[float bias]);
gvec4 texture(