我收到以下错误:
WARNING: uniforms initializing is allowed from GLSL version 1.20
WARNING: Only GLSL version > 110 allows postfix "F" or "f" for float
虽然我知道如何解决这个问题,但我想知道为什么会发生这种情况,因为发生这种情况的机器有 OpenGL 3.1 和 GLSL 1.4:
12:40:58 [INFO] Intel(R) HD Graphics Family
12:40:58 [INFO] OpenGL 3.1.0 - Build 8.15.10.2509
编辑:有问题的着色器是一个片段着色器(没有顶点着色器):
uniform sampler2D sampler;
uniform sampler2D bump;
uniform float imageSize;
uniform float range = 50;
void main() {
vec2 pos = gl_TexCoord[0].xy;
float height = texture2D(bump, gl_TexCoord[0].xy).r - 0.5;
pos.y += height * range / imageSize;
gl_FragColor = texture2D(sampler, pos);
//gl_FragColor = texture2D(sampler, pos) * (1 + (height - 0.3f) * 25);
}