2022-08-01 23:11:10 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
2022-08-02 16:35:50 +00:00
|
|
|
const float gamma = 2.2f;
|
2022-08-01 23:11:10 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 color = texture(u_texture, v_texcoord);
|
|
|
|
|
|
|
|
f_color = vec4(pow(color.rgb, vec3(1.0f/gamma)), color.a);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|