29 bool enabled_ =
false;
36 const bool do_edit_mesh_fade_geom = !
state.xray_enabled &&
38 enabled_ =
state.v3d && (do_edit_mesh_fade_geom ||
state.do_pose_fade_geom) &&
39 (selection_type_ == SelectionType::DISABLED);
49 state.clipping_plane_count);
54 color[3] =
state.overlay.fade_alpha;
59 mesh_fade_geometry_ps_ = ⊂
63 if (
state.do_pose_fade_geom) {
64 const float alpha =
state.overlay.xray_alpha_bone;
65 float4 color = {0.0f, 0.0f, 0.0f, alpha};
67 auto &sub = ps_.
sub(
"fade_geometry.active");
69 armature_fade_geometry_active_ps_ = ⊂
72 color[3] =
powf(alpha, 4);
73 auto &sub = ps_.
sub(
"fade_geometry");
75 armature_fade_geometry_other_ps_ = ⊂
88 const bool draw_fade = draw_surface && overlay_should_fade_object(ob,
state.object_active);
98 if (use_sculpt_pbvh) {
102 sub.draw(
batch.batch, handle);
113 if (draw_bone_selection) {
117 is_driven_by_active_armature(ob_ref.
object,
state) ?
118 *armature_fade_geometry_active_ps_ :
119 *armature_fade_geometry_other_ps_);
121 else if (draw_fade) {
122 fade_sync(manager, ob_ref,
state, *mesh_fade_geometry_ps_);
129 manager.
submit(ps_, view);
133 static bool overlay_should_fade_object(
const Object *ob,
const Object *active_object)
135 if (!active_object || !ob) {
143 if ((active_object->
mode & ob->
mode) != 0) {
150 static bool is_driven_by_active_armature(
Object *ob,
const State &
state)
158 if (ob_mesh_deform) {
160 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
@ V3D_OVERLAY_FADE_INACTIVE
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
ResourceHandle unique_handle(const ObjectRef &ref)
ResourceHandle resource_handle_for_sculpt(const ObjectRef &ref)
void submit(PassSimple &pass, View &view)
PassBase< DrawCommandBufType > & sub(const char *name)
void state_set(DRWState state, int clip_plane_count=0)
void push_constant(const char *name, const float &data)
void shader_set(GPUShader *shader)
static bool is_pose_mode(const Object *armature_ob, const State &state)
void object_sync(Manager &manager, const ObjectRef &ob_ref, const State &state)
void begin_sync(Resources &res, const State &state)
Fade(const SelectionType selection_type_)
void draw(Framebuffer &framebuffer, Manager &manager, View &view)
blender::gpu::Batch * DRW_cache_object_surface_get(Object *ob)
bool DRW_object_is_renderable(const Object *ob)
bool DRW_state_is_image_render()
@ DRW_STATE_DEPTH_LESS_EQUAL
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
float4 background_color_get(const State &state)