Cleanup: DRW: Remove one useless matrix multiplication
authorClément Foucault <foucault.clem@gmail.com>
Fri, 14 Jun 2019 16:21:34 +0000 (18:21 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 14 Jun 2019 17:17:06 +0000 (19:17 +0200)
source/blender/draw/modes/shaders/overlay_face_wireframe_vert.glsl

index 9022456..722f62d 100644 (file)
@@ -29,16 +29,14 @@ flat out float edgeSharpness;
 
 void main()
 {
-  mat4 projmat = ProjectionMatrix;
-
-  vec4 wpos = ModelMatrix * vec4(pos, 1.0);
-  gl_Position = projmat * (ViewMatrix * wpos);
+  vec3 wpos = point_object_to_world(pos);
+  gl_Position = point_world_to_ndc(wpos);
 
   vec3 wnor = normalize(normal_object_to_world(nor));
   facing_g = dot(wnor, ViewMatrixInverse[2].xyz);
   edgeSharpness_g = get_edge_sharpness(wd);
 
 #ifdef USE_WORLD_CLIP_PLANES
-  world_clip_planes_calc_clip_distance(wpos.xyz);
+  world_clip_planes_calc_clip_distance(wpos);
 #endif
 }