<<< Using separate shaders | Index | GLSL #version number >>> |
Vertex shader:
#version 300
in vec4 s_vPosition;
void main () {
// The value of s_vPosition should be between -1.0 and +1.0
gl_Position = s_vPosition;
}
Fragment shader:
#version 300
out vec4 s_vColor;
void main () {
// All pixels will be red:
fColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}
<<< Using separate shaders | Index | GLSL #version number >>> |