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 @@
void frag()
{
float radius = vig_radius;
vec4 origColor = texture2D_0(TexCoord);
vec2 uv = TexCoord.xy;
vec2 center = vec2(0.5);
vec4 bg = origColor;
uv *= 1.0 - uv.yx;
float vig = uv.x*uv.y * vig_strenght;
uv *= 1.0 - uv.yx;
float vig = uv.x * uv.y * vig_strenght;
vig = pow(vig, vig_radius);
vec4 vigmixcolor = vec4(vig_color,vig) * vec4(vig);
gl_FragColor = vec4(mix(origColor,vigmixcolor,1.0-vig));
vec4 vigColor = vec4(vig_color.xyz, vig) * vig;
gl_FragColor = mix(origColor, vigColor, 1.0 - vig);
}
]]></FragmentShader>
</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