From ffd968a26826108ca9fb23d46ed5789260852eb7 Mon Sep 17 00:00:00 2001 From: Ritabrata Das Date: Wed, 9 Sep 2026 21:07:21 +0530 Subject: intial commit --- assets/shader/snow.fs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 assets/shader/snow.fs (limited to 'assets/shader') diff --git a/assets/shader/snow.fs b/assets/shader/snow.fs new file mode 100644 index 0000000..acb4a59 --- /dev/null +++ b/assets/shader/snow.fs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andrew Baldwin (twitter: baldand, www: http://thndl.com) +// License = Attribution-NonCommercial-ShareAlike (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US) + +// "Just snow" +// Simple (but not cheap) snow made from multiple parallax layers with randomly positioned +// flakes and directions. Also includes a DoF effect. Pan around with mouse. + +#define LIGHT_SNOW // Comment this out for a blizzard + +#ifdef LIGHT_SNOW + #define LAYERS 50 + #define DEPTH .5 + #define WIDTH .3 + #define SPEED .6 +#else // BLIZZARD + #define LAYERS 200 + #define DEPTH .1 + #define WIDTH .8 + #define SPEED 1.5 +#endif + +precision mediump float; + +uniform float iTime; +uniform vec2 iResolution; +uniform vec2 iMouse; + +void main() +{ + const mat3 p = mat3(13.323122,23.5112,21.71123,21.1212,28.7312,11.9312,21.8112,14.7212,61.3934); + vec2 uv = iMouse.xy/iResolution.xy + vec2(1.,iResolution.y/iResolution.x)*gl_FragCoord.xy / iResolution.xy; + vec3 acc = vec3(0.0); + float dof = 5.*sin(iTime*.1); + for (int i=0;i