ENABLE_ALLOW_NEGATIVE_Z -> Fixed picking of sinking object

This commit is contained in:
enricoturri1966 2021-07-20 11:02:04 +02:00
parent bf981ae049
commit b140709fa8
4 changed files with 53 additions and 2 deletions

View file

@ -0,0 +1,14 @@
#version 110
uniform vec4 uniform_color;
uniform bool viewed_from_top;
varying float world_pos_z;
void main()
{
if (viewed_from_top && world_pos_z < 0.0)
discard;
gl_FragColor = uniform_color;
}

View file

@ -0,0 +1,11 @@
#version 110
uniform mat4 world_matrix;
varying float world_pos_z;
void main()
{
world_pos_z = (world_matrix * gl_Vertex).z;
gl_Position = ftransform();
}