mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
SLA slices preview - wip 3
This commit is contained in:
@@ -8,10 +8,18 @@ varying vec2 intensity;
|
||||
varying vec3 delta_box_min;
|
||||
varying vec3 delta_box_max;
|
||||
|
||||
varying float world_z;
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
// x = min z, y = max z;
|
||||
uniform vec2 z_range;
|
||||
|
||||
void main()
|
||||
{
|
||||
if ((world_z < z_range.x) || (z_range.y < world_z))
|
||||
discard;
|
||||
|
||||
// if the fragment is outside the print volume -> use darker color
|
||||
vec3 color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? mix(uniform_color.rgb, ZERO, 0.3333) : uniform_color.rgb;
|
||||
gl_FragColor = vec4(vec3(intensity.y, intensity.y, intensity.y) + color * intensity.x, uniform_color.a);
|
||||
|
||||
@@ -34,6 +34,8 @@ varying vec2 intensity;
|
||||
varying vec3 delta_box_min;
|
||||
varying vec3 delta_box_max;
|
||||
|
||||
varying float world_z;
|
||||
|
||||
void main()
|
||||
{
|
||||
// First transform the normal into camera space and normalize the result.
|
||||
@@ -67,4 +69,5 @@ void main()
|
||||
}
|
||||
|
||||
gl_Position = ftransform();
|
||||
world_z = vec3(print_box.volume_world_matrix * gl_Vertex).z;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user