mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-26 10:13:14 +08:00
Fix legacy glsl shaders
By @smartavionics
This commit is contained in:
parent
687f598d81
commit
b2fc155c3b
@ -12,6 +12,13 @@ vertex =
|
||||
}
|
||||
|
||||
fragment =
|
||||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif // GL_FRAGMENT_PRECISION_HIGH
|
||||
#endif // GL_ES
|
||||
uniform vec4 u_color;
|
||||
|
||||
void main()
|
||||
|
@ -52,11 +52,11 @@ fragment =
|
||||
|
||||
result = layer0 * layer0.a + result * (1.0 - layer0.a);
|
||||
|
||||
float intersection_count = texture2D(u_layer2, v_uvs).r * 51; // (1 / .02) + 1 (+1 magically fixes issues with high intersection count models)
|
||||
float intersection_count = texture2D(u_layer2, v_uvs).r * 51.0; // (1 / .02) + 1 (+1 magically fixes issues with high intersection count models)
|
||||
float rest = mod(intersection_count + .01, 2.0);
|
||||
if (rest > 1.0 && rest < 1.5 && intersection_count < 49)
|
||||
if (rest > 1.0 && rest < 1.5 && intersection_count < 49.0)
|
||||
{
|
||||
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * texture(u_xray_error, v_uvs * u_xray_error_scale);
|
||||
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * texture2D(u_xray_error, v_uvs * u_xray_error_scale);
|
||||
}
|
||||
|
||||
vec4 sum = vec4(0.0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user