From 9618cb23f9a52ca7b4e3c63e2bec6c5258e961d7 Mon Sep 17 00:00:00 2001 From: Sergio Gonzalez Date: Sat, 28 Jan 2017 16:27:32 -0600 Subject: [PATCH] transparent background AA was breaking on shitty ATI test card. remove --- LICENSE.txt | 2 +- src/postproc.f.glsl | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index eacabdee..fe760da3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Sergio Gonzalez +Copyright (c) 2015-2017 Sergio Gonzalez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/postproc.f.glsl b/src/postproc.f.glsl index 1855d2b3..b241f367 100644 --- a/src/postproc.f.glsl +++ b/src/postproc.f.glsl @@ -28,22 +28,12 @@ main() float ph = 1 / u_screen_size.y; vec2 coord = gl_FragCoord.xy / u_screen_size; - // Read neighboring pixels. If one of them is vec4(0), then do a different AA pass. Otherwise we - // would blend with a black background when we are exporting it as transparent. - int nz = 0; - nz += int(vec4(0) != texture(u_canvas, coord, 0)); - nz += int(vec4(0) != texture(u_canvas, coord + vec2(0, ph), 0)); - nz += int(vec4(0) != texture(u_canvas, coord + vec2(pw, 0), 0)); - nz += int(vec4(0) != texture(u_canvas, coord + vec2(0, -ph), 0)); - nz += int(vec4(0) != texture(u_canvas, coord + vec2(-pw, 0), 0)); + // TODO: When exporting to a transparent background, FXAA will blend-in the background color. + // Find a fix out_color = texture(u_canvas, coord, 0); - if ( nz != 5) { - out_color.a = out_color.a * (nz / 5.0); - } - else out_color.rgb = FxaaPixelShader( // Use noperspective interpolation here (turn off perspective interpolation). // {xy} = center of pixel