Workbench: FXAA Artifacts

When using FXAA when rendering to an image the alpha channel was not
correct what lead to visual artifacts.

These artifacts come from the FXAA function that overwrites the alpha
channel with the original Luma of the texel. In the shader this can be
turned on or off. But at the end it always overwrites the alpha with the
luminance.

We didn't use this feature, but the alpha of the resulting pixel still
contained the luma value what lead to render artifacts.
By overwriting the alpha channel with the original alpha we remove these
artifacts.

Reviewed By: fclem

Maniphest Tasks: T64947

Differential Revision: https://developer.blender.org/D4924
This commit is contained in:
Jeroen Bakker 2019-05-22 14:02:36 +02:00
parent 53781d5771
commit 083f932a25
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,9 @@ uniform vec2 invertedViewportSize;
void main()
{
ivec2 texel = ivec2(gl_FragCoord.xy);
float alpha = texelFetch(colorBuffer, texel, 0).a;
FragColor = FxaaPixelShader(
uvcoordsvar.st, colorBuffer, invertedViewportSize, 1.0, 0.166, 0.0833);
FragColor.a = alpha;
}