fix crt-guest-dr-venom-fast smoothing pass

This commit is contained in:
hizzlekizzle 2021-04-04 08:52:46 -05:00 committed by GitHub
parent 12fdb6562f
commit e5f2818021
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,8 +60,10 @@ layout(set = 0, binding = 2) uniform sampler2D Source;
float df (vec3 A, vec3 B)
{
float diff = abs(A-B); float m = max(max(diff.r,diff.g),diff.b);
return smoothstep(0.0, 0.99, m);
float diff = length(A-B);
float luma = clamp(length(0.5*min(A,B) + 0.25*(A+B) + 1e-8), 0.0001, 1.0);
float diff1 = diff/luma;
return 1.0 - clamp(7.0*(max(1.5*diff,diff1)-STH), 0.0, 1.0);
}
void main()
@ -79,4 +81,4 @@ void main()
float resx = dl; float resy = dr;
FragColor = vec4(resx,resy,1.0,1.0);
}
}