DRW: Selection Occlusion #105498

Merged
Clément Foucault merged 16 commits from bonj/blender:retopology-select into main 2023-04-09 08:08:13 +02:00

16 Commits

Author SHA1 Message Date
Clément Foucault 4e5f6ea692 Merge branch 'main' into retopology-select 2023-04-09 07:42:26 +02:00
Jorijn de Graaf 3213371cfe Add comments explaining why ID isn't set for depth
Clément wanted some comments here.
2023-04-08 21:27:25 +02:00
Jorijn de Graaf 981294301b Remove unused "id" uniform from shgrp_occlude
This is consistent with how unused uniforms are used elsewhere (for example "sizeVertex").
Alternatively I would add the uniform for the depth only group too, and then add a comment for both explaining that it's unused, but I think that this is cleaner.
2023-04-08 21:14:56 +02:00
Jorijn de Graaf 2aed76c6b2 Merge branch 'main' into retopology-select 2023-03-30 23:59:06 +02:00
Jorijn de Graaf 273c4c6991 Improve retopology overlay tooltip
buildbot/vexp-code-patch-coordinator Build done. Details
As Julien mentioned, it was a pretty useless tooltip before.
It also mentions selection occlusion now.
2023-03-29 22:45:06 +02:00
Jorijn de Graaf 24038c4938 Remove unnecessary RETOPOLOGY_OCCLUSION macro
It's only used in two places and Germano didn't like it, so I'll just get rid of it.
2023-03-29 16:58:23 +02:00
Jorijn de Graaf f543885071 Use continue for depsgraph iterator
This does the same thing, but may be a bit easier to read in terms of which comment is about which piece of code.
2023-03-29 16:54:47 +02:00
Jorijn de Graaf be37244aba Merge branch 'main' into retopology-select 2023-03-28 22:53:53 +02:00
Jorijn de Graaf 3336c1b45e Check both retopology and xray for selection occlusion
There's no need to use selection occlusion when xray is enabled, since it doesn't work anyway (and is a nice way of disabling selection occlusion without disabling the retopology overlay).
Since it's used in multiple places I decided to make a define, though only for v3d, not one that takes overlay because xray lives in shading.
2023-03-28 22:48:42 +02:00
Jorijn de Graaf 00cafbe04e Check if retopology is enabled for depsgraph iterator
This is more efficient than checking it for every object, and perhaps easier to read too, because it indicates what the depsgraph iterator is for.
2023-03-28 21:42:53 +02:00
Jorijn de Graaf a7a5f04530 Use retopology offset for selection depth group
I forgot this one in the last commit, whoops.
2023-03-28 21:03:19 +02:00
Jorijn de Graaf 3a85a0d907 Offset selection mesh towards view
Instead of offsetting background objects away.
This way it perfectly matches the edit overlay, which matters when clipping is involved.
2023-03-28 20:30:13 +02:00
Jorijn de Graaf 6424637919 Add comment explaining object type and mode checks
Hopefully this explains well enough what the code is doing.
2023-03-28 18:22:17 +02:00
Jorijn de Graaf f8c26304d7 Draw occluders separately from edit meshes
First it draws the objects from the selection context object list like it used to, because apparently the order matters.
Then it draws non-edit objects from the depsgraph iterator; the order doesn't matter here because it's only for the depth pass.
2023-03-27 23:42:20 +02:00
Jorijn de Graaf 38293cd17c Use retopology offset for selection occlusion
Instead of offsetting edit meshes towards the view, I'm offsetting non-edit meshes away from the view.
Otherwise identical to how the retopology overlay works.
2023-03-25 16:17:51 +01:00
Jorijn de Graaf e9488dafe4 Use non-edit objects to occlude selection
The selection engine now uses the depsgraph iterator instead of the list of objects stored in the selection context.
Objects that are not in edit mode are drawn into a separate shading group, which is part of the depth only pass.
2023-03-25 16:17:51 +01:00