Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-05-22 15:02:36 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-05-22 15:50:23 +0300
commit083f932a252c1a88b85999188ff1aeccc87eab66 (patch)
treefb4d37dbb15b9640d6937ce644e702779e618b4b
parent53781d577148e1fcedb45ba6fdfac1b4f42a33b9 (diff)
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
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_effect_fxaa_frag.glsl3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_fxaa_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_fxaa_frag.glsl
index 46b0361245b..092878e43aa 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_effect_fxaa_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_fxaa_frag.glsl
@@ -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;
}