Cathy L.
2014-02-17 09:58:24 UTC
Hello
If I understand well, in the vertex shader, the gl_Position built-in
variable should get a clip-space value, that means a value between
[-1,-1,-1,1] and [1,1,1,1].
So if my vertex shader is
"
#version 330 core
main()
{
gl_Position=vec4(0,0,0,1);
}
"
and my fragment shader is
"
#version 330 core
out vec4 color;
main()
{
color=vec4(1,0,0,1);
}
"
for anything drawn with "glDrawArrays(...);" juste before swapping the
buffers,I should see a red point in the middle of the screen.
But it doesn't work, someone could explain me where is the mistake?
Thanks for the help
Cathy L.
If I understand well, in the vertex shader, the gl_Position built-in
variable should get a clip-space value, that means a value between
[-1,-1,-1,1] and [1,1,1,1].
So if my vertex shader is
"
#version 330 core
main()
{
gl_Position=vec4(0,0,0,1);
}
"
and my fragment shader is
"
#version 330 core
out vec4 color;
main()
{
color=vec4(1,0,0,1);
}
"
for anything drawn with "glDrawArrays(...);" juste before swapping the
buffers,I should see a red point in the middle of the screen.
But it doesn't work, someone could explain me where is the mistake?
Thanks for the help
Cathy L.