Empty Images occlude mesh vertices and edges in edit mode
Open, ConfirmedPublic

Description

Blender Version
Broken: 85a97449051a (blender2.8 HEAD)
Worked: ?

Short description of error
In editmesh mode, mesh edges and vertices are occluded by empty images even when they are partially transparent.

Exact steps for others to reproduce the error

  • Just open the simple file and rotate around:

As you will see, when the object is in edit mesh mode, its edges and vertices are occluded by the empty image. Its faces show fine though. The empty image is set to partial transparency.

Details

Type
Bug
Dalai Felinto (dfelinto) moved this task from Backlog to General Bugs on the BF Blender: 2.8 board.
Dalai Felinto (dfelinto) triaged this task as Confirmed priority.

Assigning to Jacques since he was working on it. Feel free to pass it on to @Clément Foucault (fclem).

Looks like the empty image drawn before the mesh selection overlay. Unfortunately I still don't understand how drawing transparent things works when they are not drawn background first... So I don't know how to fix this.

@Clément Foucault (fclem): I know we talked about that for a moment last week but I still don't quite get it.. It would be nice if you could send me a link to some learning material on the topic.

@Jacques Lucke (JacquesLucke) just don't write to the depth buffer for these. We don't really care for the order of overlapping transparent image empties. If you want you can sort them based on their origins. There is a function for that actually: DRW_pass_sort_shgroup_z(). Maybe do that for only for transparent images.

The problem here is not when there multiple image empties but that the mesh selection overlay is hidden behind a transparent image empty.

If you don't write to the depth buffer they will not occlude the mesh selection.

I think I even tried this and then other things were looking wrong, but I'll check that again tomorrow.

ok, when I just disable writing to the depth buffer I get these tow problems:

The mesh wire and the image empties are currently in the same draw pass. Should we separate the images out into a separate draw pass so that we can sort them independently of the other non-mesh stuff?
It just feels like simply disabling writing to the depth buffer will only cause other bug reports in the future..

Yes do a special pass for transparent image empties.

@Jacques Lucke (JacquesLucke) just don't write to the depth buffer for these. We don't really care for the order of overlapping transparent image empties. If you want you can sort them based on their origins. There is a function for that actually: DRW_pass_sort_shgroup_z(). Maybe do that for only for transparent images.

You cannot have everything. Transparency, Occlusion, Dithering. You must choose the lesser evil.