Cleanup chromatic aberration shader

This commit is contained in:
Moritz Brückner 2020-11-28 23:13:32 +01:00
parent 3f51b35b89
commit 4cef68c818

View file

@ -45,9 +45,10 @@ void main() {
int num_iter = compoChromaticSamples;
#endif
// Spectral
if (compoChromaticType == 1) {
float reci_num_iter_f = 1.0 / float(num_iter);
if (compoChromaticType == 1) {
vec2 resolution = vec2(1,1);
vec2 uv = (texCoord.xy/resolution.xy);
vec4 sumcol = vec4(0.0);
@ -61,15 +62,14 @@ void main() {
}
fragColor = sumcol / sumw;
}
} else {
// Simple
else {
vec3 col = vec3(0.0);
col.x = texture(tex, texCoord + ((vec2(0.0, 1.0) * max_distort) / vec2(1000.0))).x;
col.y = texture(tex, texCoord + ((vec2(-0.85, -0.5) * max_distort) / vec2(1000.0))).y;
col.z = texture(tex, texCoord + ((vec2(0.85, -0.5) * max_distort) / vec2(1000.0))).z;
fragColor = vec4(col.x, col.y, col.z, fragColor.w);
}
}