- Fixed the GammaCorrectionFilter so it properly works with multisampling, will be used as a fall back to upcoming Gamma Correction implementation
- Removed luma - Passed inverse gamma instead of gamma to avoid doing a division for each pixel in the shaderexperimental
parent
1a68fc9c30
commit
0967f39b83
@ -1,23 +1,16 @@ |
|||||||
uniform sampler2D m_Texture; |
uniform sampler2D m_Texture; |
||||||
varying vec2 texCoord; |
varying vec2 texCoord; |
||||||
|
|
||||||
uniform float m_gamma; |
uniform float m_InvGamma; |
||||||
|
|
||||||
vec3 gamma(vec3 L,float gamma) |
vec3 gamma(vec3 L,float invGamma){ |
||||||
{ |
return pow(L, vec3(invGamma)); |
||||||
return pow(L, vec3(1.0 / gamma)); |
|
||||||
} |
} |
||||||
|
|
||||||
void main() { |
void main() { |
||||||
vec4 texVal = texture2D(m_Texture, texCoord); |
vec4 texVal = texture2D(m_Texture, texCoord); |
||||||
|
|
||||||
if(m_gamma > 0.0) |
texVal.rgb = gamma(texVal.rgb , m_InvGamma); |
||||||
{ |
|
||||||
texVal.rgb = gamma(texVal.rgb , m_gamma); |
|
||||||
} |
|
||||||
#ifdef COMPUTE_LUMA |
|
||||||
texVal.a = dot(texVal.rgb, vec3(0.299, 0.587, 0.114)); |
|
||||||
#endif |
|
||||||
|
|
||||||
gl_FragColor = texVal; |
gl_FragColor = texVal; |
||||||
} |
} |
Loading…
Reference in new issue