diff --git a/Resources/Textures/Shaders/cooldown.swsl b/Resources/Textures/Shaders/cooldown.swsl index 9622b26968..990453ccd8 100644 --- a/Resources/Textures/Shaders/cooldown.swsl +++ b/Resources/Textures/Shaders/cooldown.swsl @@ -12,14 +12,18 @@ void fragment() { highp float angle = atan(delta.x, -delta.y) + PI; highp float dist = length(delta); +#ifdef HAS_DFDX highp float dist_fwidth = fwidth(dist) * 0.67; +#else + highp float dist_fwidth = 0.05; +#endif highp float dist_alpha = smoothstep(0.1-dist_fwidth, 0.1, abs(dist-0.35)); highp float angle_delta = (progress * PI * 2.0) - angle; highp float arc_length = angle_delta * dist; - highp float angle_alpha = progress > 0 ? smoothstep(dist_fwidth, 0.0, arc_length) : 0.0; + highp float angle_alpha = (progress > 0.0) ? smoothstep(dist_fwidth, 0.0, arc_length) : 0.0; - COLOR = vec4(col.xyz, 1-max(dist_alpha, angle_alpha)); + COLOR = vec4(col.xyz, 1.0 - max(dist_alpha, angle_alpha)); } diff --git a/Resources/Textures/Shaders/flashed_effect.swsl b/Resources/Textures/Shaders/flashed_effect.swsl index ca57300aba..0b15474b15 100644 --- a/Resources/Textures/Shaders/flashed_effect.swsl +++ b/Resources/Textures/Shaders/flashed_effect.swsl @@ -1,5 +1,5 @@ uniform highp float percentComplete; -uniform highp float fadeFalloffExp = 8.0; +const highp float fadeFalloffExp = 8.0; void fragment() { // Higher exponent -> stronger blinding effect diff --git a/Resources/Textures/Shaders/gradient_circle_mask.swsl b/Resources/Textures/Shaders/gradient_circle_mask.swsl index 7772fec725..800e19ef84 100644 --- a/Resources/Textures/Shaders/gradient_circle_mask.swsl +++ b/Resources/Textures/Shaders/gradient_circle_mask.swsl @@ -1,5 +1,5 @@ -uniform highp float percentagedistanceshow = 0.05; -uniform highp float gradientfalloffwidth = 3.0; +const highp float percentagedistanceshow = 0.05; +const highp float gradientfalloffwidth = 3.0; highp vec4 circle(in highp vec2 uv, in highp vec2 pos, highp float rad, in highp vec3 color) { highp float d = length(pos - uv) - rad; diff --git a/Resources/Textures/Shaders/outline.swsl b/Resources/Textures/Shaders/outline.swsl index 514669da88..945ac4bdb6 100644 --- a/Resources/Textures/Shaders/outline.swsl +++ b/Resources/Textures/Shaders/outline.swsl @@ -29,10 +29,10 @@ light_mode unshaded; //shader_type canvas_item; -uniform highp float outline_width = 2.0; +uniform highp float outline_width; // = 2.0; // TODO: implement that hint_color thingy. //uniform vec4 outline_color: hint_color; -uniform highp vec4 outline_color=vec4(1.0,0.0,0.0,0.33); +uniform highp vec4 outline_color; // =vec4(1.0,0.0,0.0,0.33); void fragment() { highp vec4 col = texture2D(TEXTURE, UV);