Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-29 11:57:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-29 12:27:28 +0300
commit851d58b34f11f73403729d595116a1b189093821 (patch)
treed625e9c374953cc2630e4292aae3ac62df3f6894 /source/blender/draw/modes
parent68ae1f4958e24906992a3207726c0031de9524b5 (diff)
DRW: support clipping for all lamp types
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r--source/blender/draw/modes/object_mode.c20
-rw-r--r--source/blender/draw/modes/shaders/common_world_clip_lib.glsl2
2 files changed, 11 insertions, 11 deletions
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)
{