From 436131e9f4d2cfb83bdb3faf56622c10fd322dde Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:55:19 +1300 Subject: [PATCH] Fix compat mode stealth shader (#11833) --- Resources/Textures/Shaders/stealth.swsl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Resources/Textures/Shaders/stealth.swsl b/Resources/Textures/Shaders/stealth.swsl index fc85dcf5d8..ba4a4db3c2 100644 --- a/Resources/Textures/Shaders/stealth.swsl +++ b/Resources/Textures/Shaders/stealth.swsl @@ -9,28 +9,28 @@ const mediump float distance_scale = 0.125; void fragment() { - vec4 sprite = zTexture(UV); + highp vec4 sprite = zTexture(UV); if (sprite.a == 0.0) { discard; } // get distortion magnitude. hand crafted from a random jumble of trig functions - vec2 coords = (FRAGCOORD.xy + reference) * distance_scale; - float w = sin(TIME + (coords.x + coords.y + 2.0*sin(TIME*time_scale) * sin(TIME*time_scale + coords.x - coords.y)) ); + highp vec2 coords = (FRAGCOORD.xy + reference) * distance_scale; + highp float w = sin(TIME + (coords.x + coords.y + 2.0*sin(TIME*time_scale) * sin(TIME*time_scale + coords.x - coords.y)) ); // visualize distortion via: - // COLOR = vec4(w,w,w,1); + // COLOR = vec4(w,w,w,1.0); - w *= (3 + visibility * 2); + w *= (3.0 + visibility * 2.0); - vec4 background = zTextureSpec(SCREEN_TEXTURE, ( FRAGCOORD.xy + vec2(w) ) * SCREEN_PIXEL_SIZE ); + highp vec4 background = zTextureSpec(SCREEN_TEXTURE, ( FRAGCOORD.xy + vec2(w) ) * SCREEN_PIXEL_SIZE ); - float alpha; - if (visibility>0) + lowp float alpha; + if (visibility>0.0) alpha = sprite.a * visibility; else - alpha = 0; + alpha = 0.0; COLOR.xyz = mix(background.xyz, sprite.xyz, alpha); COLOR.a = 1.0;