diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-12-04 03:31:36 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-12-05 00:32:17 +0300 |
commit | 6d3eb85f66ae93d9d4859ef3264f1a1b2ae4fa36 (patch) | |
tree | a18be546ae0daee539de83bcddea7ee4e2195e24 /source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl | |
parent | e203f69bc3eb0c3c77820d54821c2e71469f36d1 (diff) |
Overlay Engine: Simplify outline rendering by using the antialiasing pass
This use the overlay AA pass to antialias the selection outlines.
This also do all search and expand in one pass and reduce the computation
time and memory used (2 x 32bit/pixel buffer less).
Note that the aliasing is a bit worse than the old FXAA that we used to have.
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl index 46a2afc42fd..386e6d9e141 100644 --- a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl @@ -96,6 +96,8 @@ void main() fragColor = texelFetch(colorTex, center_texel, 0); + bool original_col_has_alpha = fragColor.a < 1.0; + float depth = texelFetch(depthTex, center_texel, 0).r; float dist_raw = texelFetch(lineTex, center_texel, 0).b; @@ -138,7 +140,7 @@ void main() #if 1 /* Fix aliasing issue with really dense meshes and 1 pixel sized lines. */ - if (dist_raw > 0.0 && line_kernel < 0.45) { + if (!original_col_has_alpha && dist_raw > 0.0 && line_kernel < 0.45) { vec4 lines = vec4(neightbor_line0.z, neightbor_line1.z, neightbor_line2.z, neightbor_line3.z); /* Count number of line neighbors. */ float blend = dot(vec4(0.25), step(0.001, lines)); |