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:
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl
index f32c47bcec3..31b359dbe6d 100644
--- a/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_instance_camera_vert.glsl
@@ -1,5 +1,8 @@
uniform mat4 ViewProjectionMatrix;
+#ifdef USE_WORLD_CLIP_PLANES
+uniform mat4 ModelMatrix;
+#endif
/* ---- Instantiated Attrs ---- */
in float pos;
@@ -44,12 +47,11 @@ void main()
pPos = vec3(0.0);
}
- vec4 wPos = InstanceModelMatrix * vec4(pPos, 1.0);
- gl_Position = ViewProjectionMatrix * wPos;
+ gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pPos, 1.0);
finalColor = vec4(color, 1.0);
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance(wPos.xyz);
+ world_clip_planes_calc_clip_distance((ModelMatrix * InstanceModelMatrix * vec4(pPos, 1.0)).xyz);
#endif
}