mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 21:58:03 -06:00
GCodeViewer -> 1st iteration of rendering of extrude toolpaths as solid
This commit is contained in:
parent
2783653369
commit
ba9c3a74ed
7 changed files with 303 additions and 112 deletions
|
@ -1,8 +1,8 @@
|
|||
#version 110
|
||||
|
||||
uniform vec3 uniform_color;
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(uniform_color, 1.0);
|
||||
gl_FragColor = uniform_color;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
// version 120 is needed for gl_PointCoord
|
||||
#version 120
|
||||
|
||||
uniform vec3 uniform_color;
|
||||
uniform vec4 uniform_color;
|
||||
uniform float percent_outline_radius;
|
||||
uniform float percent_center_radius;
|
||||
|
||||
vec4 hardcoded_color(float radius, vec3 color)
|
||||
{
|
||||
return ((radius < 0.15) || (radius > 0.85)) ? vec4(0.5 * color, 1.0) : vec4(color, 1.0);
|
||||
}
|
||||
|
||||
vec4 customizable_color(float radius, vec3 color)
|
||||
vec4 customizable_color(float radius, vec4 color)
|
||||
{
|
||||
return ((radius < percent_center_radius) || (radius > 1.0 - percent_outline_radius)) ?
|
||||
vec4(0.5 * color, 1.0) : vec4(color, 1.0);
|
||||
vec4(0.5 * color.rgb, color.a) : color;
|
||||
}
|
||||
|
||||
void main()
|
||||
|
|
|
@ -6,7 +6,7 @@ const vec3 LIGHT_FRONT_DIR = vec3(0.0, 0.0, 1.0);
|
|||
|
||||
// x = ambient, y = top diffuse, z = front diffuse, w = global
|
||||
uniform vec4 light_intensity;
|
||||
uniform vec3 uniform_color;
|
||||
uniform vec4 uniform_color;
|
||||
|
||||
varying vec3 eye_position;
|
||||
varying vec3 eye_normal;
|
||||
|
@ -27,5 +27,5 @@ void main()
|
|||
NdotL = abs(dot(normal, LIGHT_FRONT_DIR));
|
||||
intensity += NdotL * light_intensity.z;
|
||||
|
||||
gl_FragColor = vec4(uniform_color * light_intensity.w * intensity, 1.0);
|
||||
gl_FragColor = vec4(uniform_color.rgb * light_intensity.w * intensity, uniform_color.a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue