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