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());
57 mesh_fade_geometry_ps_ = ⊂
61 if (
state.do_pose_fade_geom) {
62 const float alpha =
state.overlay.xray_alpha_bone;
65 auto &sub = ps_.sub(
"fade_geometry.active");
66 sub.push_constant(
"ucolor",
color);
67 armature_fade_geometry_active_ps_ = ⊂
71 auto &sub = ps_.sub(
"fade_geometry");
72 sub.push_constant(
"ucolor",
color);
73 armature_fade_geometry_other_ps_ = ⊂
86 const Object *ob = ob_ref.object;
89 const bool draw_fade = draw_surface && overlay_should_fade_object(ob,
state.object_active);
91 const bool draw_bone_selection = (ob_ref.object->type ==
OB_MESH) &&
state.do_pose_fade_geom;
97 !
state.is_image_render;
99 if (use_sculpt_pbvh) {
103 sub.draw(
batch.batch, handle);
114 if (draw_bone_selection) {
118 is_driven_by_active_armature(ob_ref.object,
state) ?
119 *armature_fade_geometry_active_ps_ :
120 *armature_fade_geometry_other_ps_);
122 else if (draw_fade) {
123 fade_sync(manager, ob_ref,
state, *mesh_fade_geometry_ps_);
133 manager.generate_commands(ps_,
view);
143 manager.submit_only(ps_,
view);
151 static int effective_mode(
const Object *ob,
const Object *active_object)
155 return active_object->
mode & ob->
mode;
161 static bool overlay_should_fade_object(
const Object *ob,
const Object *active_object)
163 if (!active_object || !ob) {
171 if (active_object->
mode == effective_mode(ob, active_object)) {
178 static bool is_driven_by_active_armature(
Object *ob,
const State &
state)
186 if (ob_mesh_deform) {
188 return is_driven_by_active_armature(ob_mesh_deform,
state);
Object * BKE_modifiers_is_deformed_by_meshdeform(Object *ob)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
@ V3D_SHADING_BACKGROUND_THEME
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
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
bool DRW_object_is_renderable(const Object *ob)
@ DRW_STATE_DEPTH_LESS_EQUAL
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
detail::Pass< command::DrawMultiBuf > PassMain
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
gpu::Batch * DRW_cache_object_surface_get(Object *ob)
VecBase< float, 4 > float4