diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl index 9de50246a40..3877c63d00a 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl @@ -37,7 +37,8 @@ void main() mat4 ModelViewMatrix = ViewMatrix * InstanceModelMatrix; - MV_pos = ModelViewMatrix * vec4(pos, 1.0); + vec4 pos_4d = vec4(pos, 1.0); + MV_pos = ModelViewMatrix * pos_4d; mat3 NormalMatrix = transpose(inverse(mat3(ModelViewMatrix))); @@ -60,4 +61,8 @@ void main() edgeClass = -1.0; // back-facing edge fCol = color; + +#ifdef USE_WORLD_CLIP_PLANES + world_clip_planes_calc_clip_distance((InstanceModelMatrix * vec4(pos, 1.0)).xyz); +#endif } |