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-05-30 13:02:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-30 13:02:05 +0300
commit671827549a3d013a2037e0b9814708214c59271c (patch)
tree7f15acb0cfbc4a5ad6b49cd072d9c7564f8df95b /source/blender/gpu/shaders
parent8cc1154aa257f1cc7fe6c5e0d139cdc0afd6b604 (diff)
3D View: Support light probe data clipping
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl
index edcff5e5d87..130f46e1e33 100644
--- a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl
@@ -1,5 +1,8 @@
uniform mat4 ViewProjectionMatrix;
+#ifdef USE_WORLD_CLIP_PLANES
+uniform mat4 ModelMatrix;
+#endif
uniform int baseId;
/* ---- Instantiated Attrs ---- */
@@ -18,6 +21,11 @@ flat out uint finalId;
void main()
{
- gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pos * size, 1.0);
+ vec4 pos_4d = vec4(pos * size, 1.0);
+ gl_Position = ViewProjectionMatrix * InstanceModelMatrix * pos_4d;
finalId = uint(baseId + callId);
+
+#ifdef USE_WORLD_CLIP_PLANES
+ world_clip_planes_calc_clip_distance((ModelMatrix * InstanceModelMatrix * pos_4d).xyz);
+#endif
}