Fix #135652: Overlay: Overlays draw in front of mesh in Paint modes
This was caused by a missing prepass. Only early out if drawing the prepass, otherwise, run all checks. This is much safer.
This commit is contained in:
@@ -734,12 +734,16 @@ bool Instance::object_needs_prepass(const ObjectRef &ob_ref, bool in_paint_mode)
|
||||
|
||||
if (in_paint_mode) {
|
||||
/* Allow paint overlays to draw with depth equal test. */
|
||||
return object_is_rendered_transparent(ob_ref.object, state);
|
||||
if (object_is_rendered_transparent(ob_ref.object, state)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!state.xray_enabled) {
|
||||
/* Force depth prepass if depth buffer form render engine is not available. */
|
||||
return !state.is_render_depth_available && (ob_ref.object->dt >= OB_SOLID);
|
||||
if (!state.is_render_depth_available && (ob_ref.object->dt >= OB_SOLID)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user