• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform sampler2D m_Texture;
2varying vec2 texCoord;
3
4uniform float m_gamma;
5
6vec3 gamma(vec3 L,float gamma)
7{
8	return pow(L, vec3(1.0 / gamma));
9}
10
11void main() {
12    vec4 texVal = texture2D(m_Texture, texCoord);
13
14 	if(m_gamma > 0.0)
15 	{
16    	texVal.rgb = gamma(texVal.rgb , m_gamma);
17 	}
18 	#ifdef COMPUTE_LUMA
19 		texVal.a = dot(texVal.rgb, vec3(0.299, 0.587, 0.114));
20 	#endif
21
22    gl_FragColor = texVal;
23}