Skip to content

Instantly share code, notes, and snippets.

@peeweek
Created December 26, 2021 16:25
Show Gist options
  • Save peeweek/79023525ac3d51891c6aa8f77510e762 to your computer and use it in GitHub Desktop.
Save peeweek/79023525ac3d51891c6aa8f77510e762 to your computer and use it in GitHub Desktop.
Flames live wallpaper (for use with Android shader editor)
// Flames live wallpaper (c)2021 thomas iche
// for use with android shader editor (https://github.com/markusfisch/ShaderEditor)
// LICENSE : WTF Public License (http://www.wtfpl.net/)
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform float time;
uniform sampler2D noise;
uniform vec2 offset;
void main(void) {
float mx = max(resolution.x, resolution.y);
vec2 uv = gl_FragCoord.xy / mx;
vec2 center = resolution / mx * vec2(0.5 - offset.x,0.6);
float t = time * 1.0;
vec2 off = t * vec2(0.0, -0.009);
float d = texture2D(noise, off+ uv*0.03).r;
d += (texture2D(noise, off+ uv*0.07).r - 0.5) * 0.5;
d += (texture2D(noise, off+ uv*0.11).r - 0.5) * 0.3;
d = mix(5.0,10.0, d);
d = sin(t - d * distance(uv, center)) * 0.5 +0.5;
d = clamp(d,0.0,1.0);
d = pow(d,1.5);
float g = 1.0-pow(abs(2.0*(uv.y-0.5)),1.2);
vec3 a =vec3(0.1,0.05,0.2);
vec3 b =vec3(2.0,0.9,0.3);
gl_FragColor = vec4(mix(a,b,d)*g,1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment