Page MenuHome

Armature Objects with "In Front" enabled are not being anti-aliased.
Open, Confirmed, MediumPublic


System Information
Operating system: Windows 10 64 bit
Graphics card: Nvidia GTX 750 Ti

Blender Version
Broken: (2.80, 98f00a3eb526, blender2.7, 2019-03-30)

Short description of error
Armature objects, which have "In Front" (formerly "X-Ray") enabled in the object properties do not receive anti-aliasing.
For regular mesh objects, this does not affect the anti-aliasing.

Exact steps for others to reproduce the error

The file shows, from left to right:
(1) armature object
(2) armature object with "In Front" enabled
(3) mesh object
(4) mesh object with "In Front" enabled

1, 3, 4 are anti-aliased.
2 is not.



Event Timeline

I can not reproduce this on my end (Linux, AMD).

Both bone objects are not AAd:

@Clément Foucault (fclem) you can reproduce this with a nvidia card?

I can reproduce It when I use "OPEN GL multi sampling" in user preference.

without "in front" multi sampling work. but with "in front" multi sampling not work about armature bone.

Sebastian Parborg (zeddb) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

@Clément Foucault (fclem) is seems like normal mesh objects in the viewport are not affected by the multi sampling setting? Only certain objects like bones.

I don't quite understand this area of anti-aliasing but adding 'MULTISAMPLE_SYNC_ENABLE` and MULTISAMPLE_SYNC_DISABLE before and after the corresponding draw passes, seems to solve the problem.

diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 9fc11e4f36f..0b113c4287c 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -3887,6 +3887,8 @@ static void OBJECT_draw_scene(void *vedata)
       GPU_framebuffer_clear_depth(fbl->ghost_fb, 1.0f);
+      MULTISAMPLE_SYNC_ENABLE(dfbl, dtxl);
     else if (DRW_state_is_select()) {
       /* XXX `GPU_depth_range` is not a perfect solution
@@ -3904,7 +3906,10 @@ static void OBJECT_draw_scene(void *vedata)
-    if (DRW_state_is_select()) {
+    if (DRW_state_is_fbo()) {
+      MULTISAMPLE_SYNC_DISABLE(dfbl, dtxl);
+    }
+    else if (DRW_state_is_select()) {
       GPU_depth_range(0.0f, 1.0f);

This is done for performance reasons. The Overlay engine unification would take care of this.