orcaslicer/resources/shaders/mm_gouraud.vs
zhou.xu 507a8a6d36 NEW: add overhang highlight area
overhang rgb=(200,0,0),remove supportType,do not save para after overhang operation preview

Change-Id: I947bbd9db264f00f0609b3f02140060f9a2621fb
(cherry picked from commit 796c4460fe998da206f9ca77973a20796fa1d3ca)
2023-07-07 17:25:51 +08:00

30 lines
932 B
GLSL

#version 110
const vec3 ZERO = vec3(0.0, 0.0, 0.0);
uniform mat4 volume_world_matrix;
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;
varying vec3 clipping_planes_dots;
varying vec4 model_pos;
varying vec4 world_pos;
struct SlopeDetection
{
bool actived;
float normal_z;
mat3 volume_world_normal_matrix;
};
uniform SlopeDetection slope;
void main()
{
model_pos = gl_Vertex;
// Point in homogenous coordinates.
world_pos = volume_world_matrix * gl_Vertex;
gl_Position = ftransform();
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
}