From 851d58b34f11f73403729d595116a1b189093821 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Jan 2019 19:57:35 +1100 Subject: DRW: support clipping for all lamp types --- source/blender/draw/modes/object_mode.c | 20 ++++++++++---------- .../draw/modes/shaders/common_world_clip_lib.glsl | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/draw/modes') diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index ed047b93f9f..a64d7f288ca 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1252,12 +1252,12 @@ static void OBJECT_cache_init(void *vedata) sgl->camera_focus = shgroup_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_single_line_get(); - sgl->camera_clip = shgroup_distance_lines_instance(sgl->non_meshes, geom); - sgl->camera_mist = shgroup_distance_lines_instance(sgl->non_meshes, geom); + sgl->camera_clip = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); + sgl->camera_mist = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_single_line_endpoints_get(); - sgl->camera_clip_points = shgroup_distance_lines_instance(sgl->non_meshes, geom); - sgl->camera_mist_points = shgroup_distance_lines_instance(sgl->non_meshes, geom); + sgl->camera_clip_points = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); + sgl->camera_mist_points = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_quad_get(); sgl->camera_stereo_plane = shgroup_instance_alpha(sgl->non_meshes, geom, draw_ctx->shader_slot); @@ -1310,7 +1310,7 @@ static void OBJECT_cache_init(void *vedata) /* start with buflimit because we don't want stipples */ geom = DRW_cache_single_line_get(); - sgl->lamp_buflimit = shgroup_distance_lines_instance(sgl->non_meshes, geom); + sgl->lamp_buflimit = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); sgl->lamp_center = shgroup_dynpoints_uniform_color(sgl->non_meshes, gb->colorLampNoAlpha, &gb->sizeLampCenter, draw_ctx->shader_slot); @@ -1322,8 +1322,8 @@ static void OBJECT_cache_init(void *vedata) geom = DRW_cache_lamp_sunrays_get(); sgl->lamp_sunrays = shgroup_instance_screenspace(sgl->non_meshes, geom, &gb->sizeLampCircle, draw_ctx->shader_slot); - sgl->lamp_groundline = shgroup_groundlines_uniform_color(sgl->non_meshes, gb->colorLamp); - sgl->lamp_groundpoint = shgroup_groundpoints_uniform_color(sgl->non_meshes, gb->colorLamp); + sgl->lamp_groundline = shgroup_groundlines_uniform_color(sgl->non_meshes, gb->colorLamp, draw_ctx->shader_slot); + sgl->lamp_groundpoint = shgroup_groundpoints_uniform_color(sgl->non_meshes, gb->colorLamp, draw_ctx->shader_slot); geom = DRW_cache_screenspace_circle_get(); sgl->lamp_area_sphere = shgroup_instance_screen_aligned(sgl->non_meshes, geom, draw_ctx->shader_slot); @@ -1338,13 +1338,13 @@ static void OBJECT_cache_init(void *vedata) sgl->lamp_hemi = shgroup_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_single_line_get(); - sgl->lamp_distance = shgroup_distance_lines_instance(sgl->non_meshes, geom); + sgl->lamp_distance = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_single_line_endpoints_get(); - sgl->lamp_buflimit_points = shgroup_distance_lines_instance(sgl->non_meshes, geom); + sgl->lamp_buflimit_points = shgroup_distance_lines_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_lamp_spot_get(); - sgl->lamp_spot_cone = shgroup_spot_instance(sgl->non_meshes, geom); + sgl->lamp_spot_cone = shgroup_spot_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); geom = DRW_cache_circle_get(); sgl->lamp_spot_blend = shgroup_instance(sgl->non_meshes, geom, draw_ctx->shader_slot); diff --git a/source/blender/draw/modes/shaders/common_world_clip_lib.glsl b/source/blender/draw/modes/shaders/common_world_clip_lib.glsl index b889780751e..6964b2a0c39 100644 --- a/source/blender/draw/modes/shaders/common_world_clip_lib.glsl +++ b/source/blender/draw/modes/shaders/common_world_clip_lib.glsl @@ -1,5 +1,5 @@ #ifdef USE_WORLD_CLIP_PLANES -#ifdef GPU_VERTEX_SHADER +#if defined(GPU_VERTEX_SHADER) || defined(GPU_GEOMETRY_SHADER) uniform vec4 WorldClipPlanes[6]; void world_clip_planes_calc_clip_distance(vec3 wpos) { -- cgit v1.2.3