35 const bool do_edit_mesh_fade_geom = !
state.xray_enabled &&
state.show_fade_inactive();
36 enabled_ =
state.is_space_v3d() && (do_edit_mesh_fade_geom ||
state.do_pose_fade_geom) &&
47 state.clipping_plane_count);
48 ps_.shader_set(res.shaders->uniform_color.get());
59 mesh_fade_geometry_ps_ = ⊂
63 if (
state.do_pose_fade_geom) {
64 const float alpha =
state.overlay.xray_alpha_bone;
67 auto &sub = ps_.sub(
"fade_geometry.active");
68 sub.push_constant(
"ucolor",
color);
69 armature_fade_geometry_active_ps_ = ⊂
73 auto &sub = ps_.sub(
"fade_geometry");
74 sub.push_constant(
"ucolor",
color);
75 armature_fade_geometry_other_ps_ = ⊂
88 const Object *ob = ob_ref.object;
91 const bool draw_fade = draw_surface && overlay_should_fade_object(ob,
state.object_active);
93 const bool draw_bone_selection = (ob_ref.object->type ==
OB_MESH) &&
state.do_pose_fade_geom;
99 !
state.is_image_render;
101 if (use_sculpt_pbvh) {
105 sub.draw(batch.batch, handle);
116 if (draw_bone_selection) {
120 is_driven_by_active_armature(ob_ref.object,
state) ?
121 *armature_fade_geometry_active_ps_ :
122 *armature_fade_geometry_other_ps_);
124 else if (draw_fade) {
125 fade_sync(manager, ob_ref,
state, *mesh_fade_geometry_ps_);
135 manager.generate_commands(ps_, view);
145 manager.submit_only(ps_, view);
153 static int effective_mode(
const Object *ob,
const Object *active_object)
157 return active_object->
mode & ob->
mode;
163 static bool overlay_should_fade_object(
const Object *ob,
const Object *active_object)
165 if (!active_object || !ob) {
173 if (active_object->
mode == effective_mode(ob, active_object)) {
180 static bool is_driven_by_active_armature(Object *ob,
const State &
state)
188 if (ob_mesh_deform) {
190 return is_driven_by_active_armature(ob_mesh_deform,
state);
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
ResourceHandleRange unique_handle(const ObjectRef &ref)
void push_constant(const char *name, const float &data)
detail::PassBase< command::DrawMultiBuf > Sub
static bool is_pose_mode(const Object *armature_ob, const State &state)
void pre_draw(Manager &manager, View &view) final
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
void begin_sync(Resources &res, const State &state) final
void draw(Framebuffer &framebuffer, Manager &manager, View &view) final
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
detail::Pass< command::DrawMultiBuf > PassMain
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
gpu::Batch * DRW_cache_object_surface_get(Object *ob)
void GPU_framebuffer_bind(gpu::FrameBuffer *fb)
bool DRW_object_is_renderable(const Object *ob)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
@ DRW_STATE_DEPTH_LESS_EQUAL
@ V3D_SHADING_BACKGROUND_THEME
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
Object * BKE_modifiers_is_deformed_by_meshdeform(Object *ob)