Opengl 错误C1105:无法调用非函数
我使用了一个着色器,它在另一个程序(在相同的环境afaik中)中工作,但由于某些原因现在无法编译:Opengl 错误C1105:无法调用非函数,opengl,glsl,Opengl,Glsl,我使用了一个着色器,它在另一个程序(在相同的环境afaik中)中工作,但由于某些原因现在无法编译: // Vertex Shader #version 330 core layout(location = 0) in vec3 vertexPosition_modelspace; layout(location = 1) in vec2 vertexUV; out vec2 fragmentUV; uniform mat4 ortho_matrix; void main() { gl_P
// Vertex Shader
#version 330 core
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec2 vertexUV;
out vec2 fragmentUV;
uniform mat4 ortho_matrix;
void main()
{
gl_Position = ortho_matrix * vec4(vertexPosition_modelspace, 1);
fragmentUV = vertexUV;
}
// Fragment Shader
#version 330 core
in vec2 fragmentUV;
uniform sampler2D texture;
out vec4 color;
void main()
{
color.rgba = texture(texture, fragmentUV).rgba;
}
这是一个超级基本的着色器,现在它突然开始抛出错误
Windows 8.1
Nvidia GeForce 1080(这是一款新产品,可能是问题所在?)
这是Visual Studio正在输出的内容:
我很惊讶这是在不同的环境下编译的。您已将纹理命名为用于进行纹理查找的函数。您需要重命名uniform sampler2D纹理代码>指向其他内容
我很惊讶这是在不同的环境下编译的。您已将纹理命名为用于进行纹理查找的函数。您需要重命名uniform sampler2D纹理代码>到其他地方。现在我想这很明显,但我对GLSL还是新手。谢谢,我会尽快检查你的答案。现在我想这很明显,但我对GLSL还是新手。谢谢,我会尽我所能检查你的答案。
uniform sampler2D texture;
out vec4 color;
void main()
{
color.rgba = texture(texture, fragmentUV).rgba;
}