mm_contour.vs 388 B

1234567891011121314
  1. #version 110
  2. uniform mat4 view_model_matrix;
  3. uniform mat4 projection_matrix;
  4. attribute vec3 v_position;
  5. void main()
  6. {
  7. // Add small epsilon to z to solve z-fighting between painted triangles and contour lines.
  8. vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
  9. clip_position.z -= 0.00001 * abs(clip_position.w);
  10. gl_Position = clip_position;
  11. }