Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager.c
| Show First 20 Lines • Show All 2,424 Lines • ▼ Show 20 Lines | |||||
| static void draw_world_clip_planes_from_rv3d(GPUBatch *batch, const float world_clip_planes[6][4]) | static void draw_world_clip_planes_from_rv3d(GPUBatch *batch, const float world_clip_planes[6][4]) | ||||
| { | { | ||||
| GPU_batch_uniform_4fv_array(batch, "WorldClipPlanes", 6, world_clip_planes[0]); | GPU_batch_uniform_4fv_array(batch, "WorldClipPlanes", 6, world_clip_planes[0]); | ||||
| } | } | ||||
| /** | /** | ||||
| * Clears the Depth Buffer and draws only the specified object. | * Clears the Depth Buffer and draws only the specified object. | ||||
| */ | */ | ||||
| void DRW_draw_depth_object(ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object) | void DRW_draw_depth_object(Scene *scene, ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object) | ||||
| { | { | ||||
| RegionView3D *rv3d = region->regiondata; | RegionView3D *rv3d = region->regiondata; | ||||
| DRW_opengl_context_enable(); | DRW_opengl_context_enable(); | ||||
| GPU_matrix_projection_set(rv3d->winmat); | GPU_matrix_projection_set(rv3d->winmat); | ||||
| GPU_matrix_set(rv3d->viewmat); | GPU_matrix_set(rv3d->viewmat); | ||||
| GPU_matrix_mul(object->obmat); | GPU_matrix_mul(object->obmat); | ||||
| Show All 21 Lines | case OB_MESH: { | ||||
| if (object->mode & OB_MODE_EDIT) { | if (object->mode & OB_MODE_EDIT) { | ||||
| batch = DRW_mesh_batch_cache_get_edit_triangles(me); | batch = DRW_mesh_batch_cache_get_edit_triangles(me); | ||||
| } | } | ||||
| else { | else { | ||||
| batch = DRW_mesh_batch_cache_get_surface(me); | batch = DRW_mesh_batch_cache_get_surface(me); | ||||
| } | } | ||||
| DRW_mesh_batch_cache_create_requested(object, me, NULL, false, true); | DRW_mesh_batch_cache_create_requested(object, me, scene, false, true); | ||||
| const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : | const eGPUShaderConfig sh_cfg = world_clip_planes ? GPU_SHADER_CFG_CLIPPED : | ||||
| GPU_SHADER_CFG_DEFAULT; | GPU_SHADER_CFG_DEFAULT; | ||||
| GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_DEPTH_ONLY, sh_cfg); | GPU_batch_program_set_builtin_with_config(batch, GPU_SHADER_3D_DEPTH_ONLY, sh_cfg); | ||||
| if (world_clip_planes != NULL) { | if (world_clip_planes != NULL) { | ||||
| draw_world_clip_planes_from_rv3d(batch, world_clip_planes); | draw_world_clip_planes_from_rv3d(batch, world_clip_planes); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines | |||||