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) {
153 if (handle.
raw == 0u) {
158 select::ID select_id = use_material_slot_selection_ ?
163 mesh_ps_->draw(geom, handle, select_id.
get());
179 select::ID select_id = use_material_slot_selection_ ?
188 mesh_ps_->draw(
batch.batch, handle, select_id.
get());
198 bool is_solid = ob_ref.object->dt >=
OB_SOLID ||
209 !
state.is_image_render;
211 if (use_sculpt_pbvh) {
216 gpu::Batch *geom_single =
nullptr;
220 switch (ob_ref.object->type) {
222 if (use_material_slot_selection_) {
231 if (res.is_selection() && !use_material_slot_selection_ &&
236 manager.unique_handle(ob_ref),
237 res.select_id(ob_ref).get());
243 if (!res.is_selection()) {
251 if (geom_single ==
nullptr) {
257 pass = pointcloud_ps_;
264 if (!res.is_selection() &&
state.is_render_depth_available) {
269 GreasePencil::draw_grease_pencil(res,
273 manager.unique_handle(ob_ref),
274 res.select_id(ob_ref));
280 if (pass ==
nullptr) {
290 if (geom_list[material_id] ==
nullptr) {
294 select::ID select_id = use_material_slot_selection_ ?
295 res.select_id(ob_ref, (material_id + 1) << 16) :
296 res.select_id(ob_ref);
297 if (res.is_selection() && (pass == mesh_ps_)) {
303 pass->
draw(geom_list[material_id], res_handle, select_id.
get());
314 manager.generate_commands(ps_,
view);
324 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(GPUFrameBuffer *fb)
constexpr IndexRange index_range() const
ResourceHandle resource_handle_for_psys(const ObjectRef &ref, const float4x4 &model_matrix)
ResourceHandleRange resource_handle_for_sculpt(const ObjectRef &ref)
void draw(gpu::Batch *batch, uint instance_len=-1, uint vertex_len=-1, uint vertex_first=-1, ResourceHandleRange handle={0}, uint custom_id=0)
void draw_expand(gpu::Batch *batch, GPUPrimType primitive_type, uint primitive_len, uint instance_len, uint vertex_len=-1, uint vertex_first=-1, ResourceHandleRange handle={0}, uint custom_id=0)
detail::PassBase< command::DrawMultiBuf > Sub
void begin_sync(Resources &res, const State &state) final
void draw_on_render(GPUFrameBuffer *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 @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 batch
detail::Pass< command::DrawCommandBuf > PassSimple
gpu::Batch * curves_sub_pass_setup(PassMain::Sub &ps, const Scene *scene, Object *ob, GPUMaterial *gpu_material=nullptr)
detail::Pass< command::DrawMultiBuf > PassMain
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)
float4x4 DRW_particles_dupli_matrix_get(const ObjectRef &ob_ref)
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)