41 ps_.shader_set(res.shaders->mesh_edit_depth.get());
42 ps_.push_constant(
"retopology_offset", 0.0f);
43 ps_.draw(res.shapes.image_quad.get());
53 manager.submit(ps_,
view);
71 bool use_material_slot_selection_ =
false;
83 pointcloud_ps_ =
nullptr;
87 use_material_slot_selection_ =
state.is_material_select;
89 bool use_cull = res.globals_buf.backface_culling;
96 state.clipping_plane_count);
99 auto &sub = ps_.sub(
"Mesh");
100 sub.shader_set(res.is_selection() ? res.shaders->depth_mesh_conservative.get() :
101 res.shaders->depth_mesh.get());
105 auto &sub = ps_.sub(
"MeshFlat");
106 sub.shader_set(res.shaders->depth_mesh.get());
107 mesh_flat_ps_ = ⊂
110 auto &sub = ps_.sub(
"Hair");
111 sub.shader_set(res.shaders->depth_mesh.get());
115 auto &sub = ps_.sub(
"Curves");
116 sub.shader_set(res.shaders->depth_curves.get());
120 auto &sub = ps_.sub(
"PointCloud");
121 sub.shader_set(res.shaders->depth_pointcloud.get());
122 pointcloud_ps_ = ⊂
125 auto &sub = ps_.sub(
"GreasePencil");
126 sub.shader_set(res.shaders->depth_grease_pencil.get());
127 grease_pencil_ps_ = ⊂
133 if (
state.skip_particles) {
157 select::ID select_id = use_material_slot_selection_ ?
162 mesh_ps_->draw(geom, handle, select_id.
get());
178 select::ID select_id = use_material_slot_selection_ ?
187 mesh_ps_->draw(
batch.batch, handle, select_id.
get());
197 bool is_solid = ob_ref.object->dt >=
OB_SOLID ||
208 !
state.is_image_render;
210 if (use_sculpt_pbvh) {
215 gpu::Batch *geom_single =
nullptr;
219 switch (ob_ref.object->type) {
221 if (use_material_slot_selection_) {
230 if (res.is_selection() && !use_material_slot_selection_ &&
235 manager.unique_handle(ob_ref),
236 res.select_id(ob_ref).get());
242 if (!res.is_selection()) {
250 if (geom_single ==
nullptr) {
256 pass = pointcloud_ps_;
259 const char *
error =
nullptr;
267 if (!res.is_selection() &&
state.is_render_depth_available) {
272 GreasePencil::draw_grease_pencil(res,
276 manager.unique_handle(ob_ref),
277 res.select_id(ob_ref));
283 if (pass ==
nullptr) {
293 if (geom_list[material_id] ==
nullptr) {
297 select::ID select_id = use_material_slot_selection_ ?
298 res.select_id(ob_ref, (material_id + 1) << 16) :
299 res.select_id(ob_ref);
300 if (res.is_selection() && (pass == mesh_ps_)) {
306 pass->
draw(geom_list[material_id], res_handle, select_id.
get());
317 manager.generate_commands(ps_,
view);
327 manager.submit_only(ps_,
view);
int BKE_object_material_used_with_fallback_eval(const Object &ob)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
#define LISTBASE_FOREACH(type, var, list)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
constexpr IndexRange index_range() const
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
ResourceHandleRange unique_handle_for_sculpt(const ObjectRef &ref)
float4x4 particles_matrix() const
void draw_expand(gpu::Batch *batch, GPUPrimType primitive_type, uint primitive_len, uint instance_len, uint vertex_len, uint vertex_first, ResourceIndexRange res_index={}, uint custom_id=0)
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceIndexRange res_index={}, uint custom_id=0)
detail::PassBase< command::DrawMultiBuf > Sub
void begin_sync(Resources &res, const State &state) final
void draw_on_render(gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final
void sculpt_sync(Manager &manager, const ObjectRef &ob_ref, Resources &res)
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) final
void begin_sync(Resources &res, const State &state) final
void draw_line(Framebuffer &framebuffer, Manager &manager, View &view) final
void pre_draw(Manager &manager, View &view) final
void particle_sync(Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state)
bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys)
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_DEPTH_LESS_EQUAL
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
static void error(const char *str)
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
gpu::Batch * curves_sub_pass_setup(PassMain::Sub &ps, const Scene *scene, Object *ob, const char *&r_error, GPUMaterial *gpu_material=nullptr)
gpu::Batch * pointcloud_sub_pass_setup(PassMain::Sub &sub_ps, Object *object, GPUMaterial *gpu_material=nullptr)
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
Span< gpu::Batch * > DRW_cache_mesh_surface_shaded_get(Object *ob, const Span< const GPUMaterial * > materials)
gpu::Batch * DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
gpu::Batch * DRW_cache_volume_selection_surface_get(Object *ob)
gpu::Batch * DRW_cache_mesh_surface_get(Object *ob)
gpu::Batch * DRW_cache_mesh_all_edges_get(Object *ob)
static int flat_axis_index_get(const Object *ob)
bool is_selection() const
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)