2022-03-21 12:10:47 +00:00
|
|
|
#version 140
|
2022-02-28 09:41:01 +00:00
|
|
|
|
2022-03-04 07:54:23 +00:00
|
|
|
uniform mat4 view_model_matrix;
|
|
|
|
uniform mat4 projection_matrix;
|
2022-04-07 10:59:11 +00:00
|
|
|
uniform float offset;
|
2022-02-28 09:41:01 +00:00
|
|
|
|
2022-03-21 12:10:47 +00:00
|
|
|
in vec3 v_position;
|
|
|
|
|
2022-02-28 09:41:01 +00:00
|
|
|
void main()
|
|
|
|
{
|
2022-04-07 08:40:33 +00:00
|
|
|
// Add small epsilon to z to solve z-fighting between painted triangles and contour lines.
|
|
|
|
vec4 clip_position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
2022-04-07 10:59:11 +00:00
|
|
|
clip_position.z -= offset * abs(clip_position.w);
|
2022-04-07 08:40:33 +00:00
|
|
|
gl_Position = clip_position;
|
2022-02-28 09:41:01 +00:00
|
|
|
}
|