Java gl着色器语法错误
我在第10行有一个语法错误Java gl着色器语法错误,java,syntax,glsl,shader,Java,Syntax,Glsl,Shader,我在第10行有一个语法错误 ERROR: 0:10: 'void' : syntax error syntax error 以下是着色器: #version 330 in vec3 position; in vec2 textureCoordinates; out vec2 pass_textureCoordinates; uniform mat4 transformationMatrix void main(void) { gl_Position = transformat
ERROR: 0:10: 'void' : syntax error syntax error
以下是着色器:
#version 330
in vec3 position;
in vec2 textureCoordinates;
out vec2 pass_textureCoordinates;
uniform mat4 transformationMatrix
void main(void) {
gl_Position = transformationMatrix * vec4(position, 1);
pass_textureCoordinates = textureCoordinates;
}
我搜索了一会儿,语法似乎正确问题不在于void本身,而是void前面缺少一个分号:
注意,在GLSL中,任何声明都必须以分号完成
看
或者。试着用void main{。我已经这么做了……还是个错误
uniform mat4 transformationMatrix; // <--- add the missing ;