【发布时间】:2017-10-05 21:09:50
【问题描述】:
我的片段着色器出现以下错误:
编译日志:ERROR: 0:7: 'texture' : syntax error: syntax error
着色器是这样写的:
#version 300 es
in mediump vec2 texCoord;
out mediump vec4 fColor;
uniform sampler texture;
void main(void) {
fColor = texture(texture, texCoord);
}
为什么我会收到错误消息?
【问题讨论】:
-
你的意思是:fColor = texture2D(texture, texCoord) ?
-
显然 texture2d 在 glsl 3.0 中发生了变化