Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Opengl 错误C1105:无法调用非函数_Opengl_Glsl - Fatal编程技术网

Opengl 错误C1105:无法调用非函数

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

我使用了一个着色器,它在另一个程序(在相同的环境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_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;
}