mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
ENABLE_ALLOW_NEGATIVE_Z -> Fixed picking of sinking object
This commit is contained in:
parent
bf981ae049
commit
b140709fa8
4 changed files with 53 additions and 2 deletions
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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue