mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
ENABLE_ALLOW_NEGATIVE_Z -> Fixed picking of sinking object
This commit is contained in:
14
resources/shaders/picking.fs
Normal file
14
resources/shaders/picking.fs
Normal 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;
|
||||
}
|
||||
11
resources/shaders/picking.vs
Normal file
11
resources/shaders/picking.vs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user