From ef746c20e66bf4582768e7fcc27dd5bc9c37c5c5 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Fri, 10 Jun 2022 15:58:10 +0200 Subject: [PATCH] :wrench: Remove implicit conversions --- resources/shaders/wisps.frag | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/shaders/wisps.frag b/resources/shaders/wisps.frag index 5171f2b..11daf9a 100644 --- a/resources/shaders/wisps.frag +++ b/resources/shaders/wisps.frag @@ -20,7 +20,7 @@ uniform float uScale; const float WISPS_RADIUS = 20.0; const float WISPS_SPEED = 10.0; const float WISPS_SPACING = 40.0 + WISPS_RADIUS; -const int WISPS_LAYERS = 8; +const float WISPS_LAYERS = 8.0; const float WISPS_IN_TIME = 0.5; const float WINDOW_OUT_TIME = 1.0; const float SCALING = 0.9; @@ -78,8 +78,8 @@ void main() { vec2 uv = (iTexCoord.st - 0.5) / mix(1.0, 0.5, progress) + 0.5; uv /= uScale; float wisps = 0.0; - for (float i = 0; i < WISPS_LAYERS; ++i) { - wisps += getWisps(uv * 0.3, WISPS_SPACING, uSeed * (i + 1)); + for (float i = 0.0; i < WISPS_LAYERS; ++i) { + wisps += getWisps(uv * 0.3, WISPS_SPACING, uSeed * (i + 1.0)); } // Compute shrinking edge mask. @@ -92,7 +92,8 @@ void main() { float windowOut = smoothstep(0.0, 1.0, clamp(progress / WINDOW_OUT_TIME, 0.0, 1.0)); // Use a noise function to dissolve the window. - float noise = smoothstep(1.0, 0.0, abs(2.0 * simplex2DFractal(uv * uSize / 250) - 1.0)); + float noise = + smoothstep(1.0, 0.0, abs(2.0 * simplex2DFractal(uv * uSize / 250.0) - 1.0)); float windowMask = 1.0 - (windowOut < 0.5 ? mix(0.0, noise, windowOut * 2.0) : mix(noise, 1.0, windowOut * 2.0 - 1.0)); oColor.a *= windowMask * mask;