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