I am developing OpenGL ES 2.0.0 and GLSL ES 1.0.0.
I am currently showing a screen square for the screen, and now I'm trying to apply a texture.
I am having problems using changing "in vertex and fragment shaders, getting an error message:
- Failed to compile vertex shader - 0(3) : error C5060: out can't be used with non-varying tex_varying in vec4 texture_coord ; in vec4 position ; out vec2 tex_varying ; uniform mat4 translate ; void main ( ) { gl_Position = translate * position ; tex_varying = texture_coord . xy ; }
I have read the documentation and cannot understand what I am doing wrong.
Here is the code.
Vertex:
attribute vec4 position; attribute vec4 texture_coord; varying vec2 tex_varying; uniform mat4 translate; void main() { gl_Position = translate * position; tex_varying = texture_coord.xy; }
Fragment:
varying vec2 tex_varying; uniform sampler2D texture; void main() { gl_FragColor = texture2D(texture, tex_varying); }
RESOLVED: This is a late answer, but I have long decided to solve this problem - in case someone else encounters a problem. It turns out that "tex_varying" is reserved by Nvidia! Just renaming tex_varying solved the problem.
Greetings.
source share