diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl index d9a0ffbbdac..5bd29c55e42 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_distance_line_vert.glsl @@ -18,13 +18,14 @@ void main() { float len = end - start; vec3 sta = vec3(0.0, 0.0, -start); - vec4 pos_4d = vec4(pos * -len + sta, 1.0); - gl_Position = ViewProjectionMatrix * InstanceModelMatrix * pos_4d; + vec4 wPos = InstanceModelMatrix * vec4(pos * -len + sta, 1.0); + + gl_Position = ViewProjectionMatrix * wPos; gl_PointSize = size; finalColor = vec4(color, 1.0); #ifdef USE_WORLD_CLIP_PLANES - world_clip_planes_calc_clip_distance((InstanceModelMatrix * pos_4d).xyz); + world_clip_planes_calc_clip_distance(wPos.xyz); #endif } |