Commit 4b07117d authored by Mahmoud's avatar Mahmoud

Update vignette effect shader

to make it work fine with the new vec4 color type. Also optimized the
frag shader a bit by removing unnecessary calculations.
parent 7f67fa15
...@@ -15,20 +15,18 @@ ...@@ -15,20 +15,18 @@
void frag() void frag()
{ {
float radius = vig_radius;
vec4 origColor = texture2D_0(TexCoord); vec4 origColor = texture2D_0(TexCoord);
vec2 uv = TexCoord.xy; vec2 uv = TexCoord.xy;
vec2 center = vec2(0.5); vec2 center = vec2(0.5);
vec4 bg = origColor; vec4 bg = origColor;
uv *= 1.0 - uv.yx; uv *= 1.0 - uv.yx;
float vig = uv.x*uv.y * vig_strenght; float vig = uv.x * uv.y * vig_strenght;
vig = pow(vig, vig_radius); vig = pow(vig, vig_radius);
vec4 vigmixcolor = vec4(vig_color,vig) * vec4(vig); vec4 vigColor = vec4(vig_color.xyz, vig) * vig;
gl_FragColor = vec4(mix(origColor,vigmixcolor,1.0-vig)); gl_FragColor = mix(origColor, vigColor, 1.0 - vig);
} }
]]></FragmentShader> ]]></FragmentShader>
</Shader> </Shader>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment