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;
133 &curves,
".selection", is_point_domain, is_valid);
136 const char *
error =
nullptr;
141 if (select_attr_buf.get()) {
144 curves_ps_->push_constant(
"is_point_domain", is_point_domain);
145 curves_ps_->bind_texture(
"selection_tx", select_attr_buf);
151 if (show_curves_cage_) {
155 sculpt_curve_cage_.draw(
geometry, handle);
161 if (!show_face_set_ && !show_mask_) {
167 if (sculpt_session ==
nullptr) {
187 switch (
pbvh->type()) {
190 if (!mesh.
attributes().contains(
".sculpt_face_set") &&
226 mesh_ps_->draw(
batch.batch, handle);
234 mesh_ps_->draw(sculpt_overlays, handle);
244 manager.submit(sculpt_curve_cage_,
view);
253 manager.submit(sculpt_mask_,
view);
257 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)
T & DRW_object_get_data_for_drawing(const Object &object)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
T get_internal_single() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
AttributeAccessor attributes() const
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
ResourceHandleRange unique_handle(const ObjectRef &ref)
detail::PassBase< command::DrawCommandBuf > Sub
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) 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)
void draw_on_render(gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
static void error(const char *str)
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, const char *&r_error, 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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh)
blender::gpu::VertBufPtr & DRW_curves_texture_for_evaluated_attribute(Curves *curves, StringRef name, bool &r_is_point_domain, bool &r_valid_attribute)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
struct SculptSession * sculpt
blender::Array< float > masks