Page MenuHome

Fix two bugs mentioned in T56865 (Spring weight paint bugs)
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Oct 24 2018, 3:35 PM.

Details

Summary

The bugs are:

  • Fix bad depth test on weight paint while an armature is in pose mode.
  • Fix selection of bones not working properly if the option In Front is enabled.

To draw an object with OB_DRAWXRAY, the pose mode engine calls the GPU_framebuffer_clear_depth(dfbl->default_fb, 1.0f) which clears the depth of the default framebuffer that is used by all other engines.
So the solution is to move that engine to the end of the list.

Note: Since the workbench engine has its own framebuffer for XRAY, it may be a good idea to move this framebuffer to DefaultFramebufferList so that it can be used by other engines.

Diff Detail

Repository
rB Blender
Branch
blender2.8_fix_bone_selection (branched from blender2.8)
Build Status
Buildable 2291
Build 2291: arc lint + arc unit

Event Timeline

  • Fix selection of bones`In Front` not working properly.
Clément Foucault (fclem) requested changes to this revision.Oct 30 2018, 6:30 PM

I don't see any problem with the fact of reordering the engines.

But I do see a problem using the glDepthRange trick. I would prefer that you just use a clean depth buffer for that. But in my tests, it was not working for some reason.

So if you put glDepthRange in GPU_state.c and add a big XXX in the comment I will accept it.

source/blender/draw/modes/object_mode.c
2991

The rule of thumb is to avoid gl* calls directly in the engines. Instead use a wrapper inside the GPU module. This will make things easier if we one day decide to implement other backends.

This revision now requires changes to proceed.Oct 30 2018, 6:30 PM
  • partial fix committed in rBbf5ba496989e;
  • Create and use GPU_depth_range;
  • XXX in coment.
Germano Cavalcante (mano-wii) marked an inline comment as done.Oct 30 2018, 7:26 PM
This revision is now accepted and ready to land.Oct 30 2018, 7:27 PM
This revision was automatically updated to reflect the committed changes.