// 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