medfall

A super great game engine
Log | Files | Refs

flat_textured.glsl (412B)


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