runnable fragment

Dune Height Lines

stronghold-curated material glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(13.1,117.7)))*43758.5453);} float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+1.0),f.x),f.y);} 
float fbm(vec2 p){float v=0.0,a=.5;for(int i=0;i<5;i++){v+=a*noise(p);p*=2.;a*=.5;}return v;}
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y; float h=fbm(uv*4.0+vec2(time*.015,0)); float ridges=sin((uv.x*2.5+h*1.4)*28.0); float crest=smoothstep(.65,1.0,ridges); vec3 sand=mix(vec3(.45,.28,.11),vec3(.95,.72,.38),h); gl_FragColor=vec4(sand+crest*.16,1.0);
}
runnable fragment

Fragment

zero-x7444ff-shader-art material glsl runnable fragment MIT
code snippet
precision mediump float;
uniform sampler2D uTexture;
uniform float uTextureFrequency;
uniform float u_time;
uniform float uHslTimeFrequency;
uniform float uHslHue;
uniform float uHslHueOffset;
uniform float uHslHueFrequency; 
uniform float uHslLightness; 
uniform float uHslLightnessVariation; 
uniform float uHslLightnessFrequency; 
uniform float uTextureOffset; 

runnable fragment

Topographic Contour Terrain

stronghold-curated pattern glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(113.5,271.9)))*43758.5453);} 
float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+1.0),f.x),f.y);} 
float fbm(vec2 p){float v=0.0,a=0.5;for(int i=0;i<5;i++){v+=a*noise(p);p*=2.0;a*=0.5;}return v;}
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y;
 float h=fbm(uv*4.0+0.05*sin(time));
 float lines=1.0-smoothstep(0.0,0.035,abs(fract(h*12.0)-0.5));
 vec3 land=mix(vec3(0.05,0.13,0.08),vec3(0.72,0.55,0.28),h);
 gl_FragColor=vec4(land+lines*vec3(0.9,0.85,0.55),1.0);
}