1
0
Fork 0
2022-untitled-game/code/shaders/screen.glsl

41 lines
704 B
GLSL

//////////////////////////////////////////////////////////////////////////////
#ifdef VERTEX
layout (location = 0) in vec2 a_position;
layout (location = 1) in vec2 a_texcoord;
out vec2 v_texcoord;
void main()
{
v_texcoord = a_texcoord;
gl_Position = vec4(a_position, 0.0f, 1.0f);
}
#endif
//////////////////////////////////////////////////////////////////////////////
#ifdef FRAGMENT
in vec2 v_texcoord;
out vec4 f_color;
uniform sampler2D u_texture;
const float gamma = 2.2f;
void main()
{
vec4 color = texture(u_texture, v_texcoord);
f_color = vec4(pow(color.rgb, vec3(1.0f/gamma)), color.a);
}
#endif
//////////////////////////////////////////////////////////////////////////////