Back to shaders

Shader test bench

Brushed Metal Anisotropy

stronghold-curated material glsl runnable fragment MIT
Source
runnable fragment

Complete GLSL fragment shader. Stronghold runs it directly when the browser can compile it.

Code

precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(float n){return fract(sin(n)*43758.5453);} 
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy;
 float row=floor(uv.y*520.0);
 float streak=hash(row)*0.18+hash(row+17.0)*0.08;
 float wave=0.08*sin(uv.x*46.0+hash(row)*6.283)+0.05*sin(uv.x*113.0+time*0.15);
 float shine=pow(max(0.0,1.0-abs(uv.y-0.48-wave)*3.2),3.0);
 vec3 base=mix(vec3(0.18,0.19,0.2),vec3(0.72,0.74,0.76),uv.x*0.35+0.35+streak);
 gl_FragColor=vec4(base+shine*vec3(0.42,0.5,0.58),1.0);
}