medfall

A super great game engine
Log | Files | Refs

flat_vertex_colours.glsl (359B)


      1 #ifdef VERTEX_SHADER
      2 
      3 in vec3 position;
      4 in vec3 colour;
      5 
      6 out vec3 frag_colour;
      7 
      8 layout( std140 ) uniform view {
      9 	mat4 V;
     10 	mat4 P;
     11 };
     12 
     13 void main() {
     14 	gl_Position = P * V * vec4( position, 1.0 );
     15 	frag_colour = colour;
     16 }
     17 
     18 #else
     19 
     20 in vec3 frag_colour;
     21 
     22 out vec4 screen_colour;
     23 
     24 void main() {
     25 	screen_colour = vec4( linear_to_srgb( frag_colour ), 1.0 );
     26 }
     27 
     28 #endif