2024-01-12 05:03:35 +01:00
|
|
|
varying vec2 v_vTexcoord;
|
|
|
|
varying vec4 v_vColour;
|
|
|
|
|
2024-01-15 13:53:46 +01:00
|
|
|
uniform float exposure;
|
2024-01-12 05:03:35 +01:00
|
|
|
uniform float strength;
|
|
|
|
uniform float amplitude;
|
2024-01-15 13:53:46 +01:00
|
|
|
uniform float smoothness;
|
2024-01-12 05:03:35 +01:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec2 uv = v_vTexcoord;
|
2024-01-15 13:53:46 +01:00
|
|
|
|
|
|
|
vec2 _uv = v_vTexcoord - 0.5;
|
|
|
|
float dist = dot(_uv, _uv);
|
|
|
|
float ang = atan(_uv.y, _uv.x);
|
|
|
|
vec2 _sp = 0.5 + vec2(cos(ang), sin(ang)) * dist;
|
|
|
|
|
|
|
|
float smt = smoothness / 2.;
|
|
|
|
uv = mix(uv, _sp, smt);
|
|
|
|
|
|
|
|
uv *= 1.0 - uv.yx;
|
|
|
|
float vig = uv.x * uv.y * exposure;
|
2024-01-12 05:03:35 +01:00
|
|
|
|
2024-01-15 13:53:46 +01:00
|
|
|
vig = pow(vig, 0.25 + smt);
|
2024-01-12 05:03:35 +01:00
|
|
|
vig = clamp(vig, 0., 1.);
|
|
|
|
|
|
|
|
vec4 samp = texture2D( gm_BaseTexture, v_vTexcoord );
|
|
|
|
gl_FragColor = vec4(samp.rgb * (1. - ((1. - vig) * strength)), samp.a);
|
|
|
|
}
|