Port aa to the epic shader

This commit is contained in:
rexim 2023-02-11 00:00:39 +07:00
parent 0a9c74525a
commit a4f280878a
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ vec3 hsl2rgb(vec3 c) {
void main() {
vec4 tc = texture(image, out_uv);
float d = tc.r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);
vec2 frag_uv = gl_FragCoord.xy / resolution;
vec4 rainbow = vec4(hsl2rgb(vec3((time + frag_uv.x + frag_uv.y), 0.5, 0.5)), 1.0);
gl_FragColor = tc.x * rainbow;
gl_FragColor = vec4(rainbow.rgb, alpha);
}