简体   繁体   English

GLSL奇怪的编译错误

[英]GLSL strange compilation errors

I have searched on the web but cannot find the reason why it is doing this. 我在网上搜索过,但找不到执行此操作的原因。 I have my vertex and fragment shaders here: 我的顶点和片段着色器在这里:

// Vertex Shader
#version 150 core

in vec3 position;

out vec3 color;

void main(void) {

gl_Position = vec4(position.x, position,y, position.z, 1.0);

color = vec3(position.x + 1.0, position,y + 1.0, position.z + 1.0);

}

And: 和:

//Fragment Shader
#version 150 core

in vec3 color;

out vec4 finalColor;

void main(void) {

finalColor = vec4(1.0, 0.0, 0.0, 1.0);

}

I looked over it several times and while it serves no real purpose as a shader it still doesn't have any visible errors in the code. 我查看了好几次,虽然它没有真正用作着色器的目的,但是在代码中仍然没有任何可见的错误。 Whe I try to compile it I get the following error: 当我尝试编译它时,出现以下错误:

ERROR: 0:5: 'y' : undeclared identifier 错误:0:5:“ y”:未声明的标识符

ERROR: 0:5: 'constructor' : too many arguments 错误:0:5:“构造函数”:参数过多

ERROR: 0:6: 'constructor' : too many arguments Strange enough I get the error on either the vertex or fragment shader depending on which one I plug into glCompileShader() first. 错误:0:6:'构造函数':参数过多奇怪的是,我在顶点着色器或片段着色器上都遇到了错误,具体取决于我首先插入glCompileShader() I have tried swapping version numbers but it didn't work and I no longer feel like programming today >.> 我尝试过交换版本号,但是它不起作用,并且我今天不再想要编程>。>

position , y lol. 位置大声笑。 You have a comma instead of a period. 您使用逗号而不是句点。 it should be position**.**y. 应该是位置**。** y。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM