Hi there.
I’m newbie in graphic programming and I’ve problem with my shaders. Probably it’s some detail, but I’m getting desperate.
Fragment shader:
#version 130
uniform vec4 vColorValue;
uniform sampler2D textureMap;
uniform float textureFlag;
in vec2 vTexCoords;
out vec4 vFragColor;
void main(void)
{
vec4 vWhite = vec4(1.0f, 1.0f, 1.0f, 1.0f);
vFragColor = mix(vColorValue, texture2D(textureMap, vTexCoords), textureFlag);
}
Vertex shader:
#version 130
uniform mat4 mvpMatrix;
uniform float textureFlag;
in vec4 vVertex;
in vec2 vTexCoordsIn;
out vec2 vTexCoords;
void main(void)
{
//vTexCoords = vTexCoordsIn; // PROBLEM LINE
gl_Position = mvpMatrix * vVertex;
}
It works, of course without textures, but when I uncommented PROBLEM LINE, nothing’s rendered, doesn’t matter if I want to show textured object, untextured, both…
Is it possible, that mistake is here or in another code?
Thx for any help :o
Edit: Mistake found after two days of searching and half an hour after posting this. It was in another code. I’d deleted that, but I’m probably blind or retarded so I can’t find how. So if somebody can, pls delete it.