37 PassSimple sculpt_mask_ = {
"SculptMaskAndFaceSet"};
41 PassSimple sculpt_curve_cage_ = {
"SculptCage"};
43 bool show_curves_cage_ =
false;
44 bool show_face_set_ =
false;
45 bool show_mask_ =
false;
50 show_curves_cage_ =
state.show_sculpt_curves_cage();
51 show_face_set_ =
state.show_sculpt_face_sets();
52 show_mask_ =
state.show_sculpt_mask();
55 !
state.is_depth_only_drawing &&
57 (show_curves_cage_ || show_face_set_ || show_mask_);
62 sculpt_curve_cage_.init();
66 float curve_cage_opacity = show_curves_cage_ ?
state.overlay.sculpt_curves_cage_opacity : 0.0f;
67 float face_set_opacity = show_face_set_ ?
state.overlay.sculpt_mode_face_sets_opacity : 0.0f;
68 float mask_opacity = show_mask_ ?
state.overlay.sculpt_mode_mask_opacity : 0.0f;
75 auto &sub = sculpt_mask_.sub(
"Mesh");
77 state.clipping_plane_count);
78 sub.shader_set(res.shaders->sculpt_mesh.get());
79 sub.push_constant(
"mask_opacity", mask_opacity);
80 sub.push_constant(
"face_sets_opacity", face_set_opacity);
84 auto &sub = sculpt_mask_.sub(
"Curves");
86 state.clipping_plane_count);
87 sub.shader_set(res.shaders->sculpt_curves.get());
88 sub.push_constant(
"selection_opacity", mask_opacity);
93 auto &pass = sculpt_curve_cage_;
96 state.clipping_plane_count);
97 pass.shader_set(res.shaders->sculpt_curves_cage.get());
100 pass.push_constant(
"opacity", curve_cage_opacity);
113 switch (ob_ref.object->type) {
128 if (show_mask_ && !everything_selected(curves)) {
130 bool is_point_domain;
132 &curves,
".selection", &is_point_domain);
133 if (select_attr_buf) {
136 if (*select_attr_buf) {
139 curves_ps_->push_constant(
"is_point_domain", is_point_domain);
140 curves_ps_->bind_texture(
"selection_tx", *select_attr_buf);
146 if (show_curves_cage_) {
150 sculpt_curve_cage_.draw(
geometry, handle);
156 if (!show_face_set_ && !show_mask_) {
162 if (sculpt_session ==
nullptr) {
182 switch (
pbvh->type()) {
185 if (!mesh.
attributes().contains(
".sculpt_face_set") &&
221 mesh_ps_->draw(
batch.batch, handle);
229 mesh_ps_->draw(sculpt_overlays, handle);
239 manager.submit(sculpt_curve_cage_,
view);
248 manager.submit(sculpt_mask_,
view);
252 bool everything_selected(const ::Curves &curves_id)
Low-level operations for curves.
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
A BVH for high poly meshes.
#define BLI_assert_unreachable()
T * DEG_get_original(T *id)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
T get_internal_single() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
AttributeAccessor attributes() const
ResourceHandleRange unique_handle(const ObjectRef &ref)
ResourceHandleRange resource_handle_for_sculpt(const ObjectRef &ref)
detail::PassBase< command::DrawCommandBuf > Sub
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
void draw_on_render(GPUFrameBuffer *framebuffer, Manager &manager, View &view) final
void mesh_sync(Manager &manager, const ObjectRef &ob_ref, const State &state)
void draw_line(Framebuffer &framebuffer, Manager &manager, View &view) final
void begin_sync(Resources &res, const State &state) final
void curves_sync(Manager &manager, const ObjectRef &ob_ref, const State &state)
Mesh & DRW_object_get_data_for_drawing(const Object &object)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
struct @242053044010324116347033273112253060004051364061::@051143074301336237271216303350234260141112266062 batch
pbvh::Tree * pbvh_get(Object &object)
detail::Pass< command::DrawCommandBuf > PassSimple
gpu::Batch * curves_sub_pass_setup(PassMain::Sub &ps, const Scene *scene, Object *ob, GPUMaterial *gpu_material=nullptr)
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
blender::gpu::Batch * DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves)
gpu::VertBuf ** DRW_curves_texture_for_evaluated_attribute(Curves *curves, StringRef name, bool *r_is_point_domain)
blender::gpu::Batch * DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh)
struct SculptSession * sculpt
blender::Array< float > masks