Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLSL: "Invalid call of undeclared identifier 'texture2D'"

I'm on a Mac, using Swift, and using OpenGL 3.2. I'm also using XCode 6.1 Beta so I suppose that's the most likely explanation, because it doesn't seem to me like this makes sense.

I can't find any evidence that this shouldn't be supported, but this fragment shader is resulting in the error Invalid call of undeclared identifier 'texture2D' during compilation:

#version 150

uniform sampler2D usTexture;

in vec2 vTextureCoord;

out vec4 FragColor;

void main() {
  vec4 color = texture2D(usTexture, vTextureCoord);
  FragColor = color;
}
like image 340
Grumdrig Avatar asked Oct 08 '14 20:10

Grumdrig


1 Answers

Cripes. Finally found the answer right after I posted the question. texture2D has been replaced by texture.

like image 134
Grumdrig Avatar answered Sep 23 '22 10:09

Grumdrig