☰
✎ Water Caustics
bearbeiten
Bereit
Vertex Shader
Kopieren
attribute vec2 a_position; void main() { gl_Position = vec4(a_position, 0.0, 1.0); }
Fragment Shader
Kopieren
precision mediump float; uniform float u_time; uniform vec2 u_resolution; uniform float u_deltaTime; uniform vec2 u_mouseNorm; float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.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,0.0)), f.x), mix(hash(i+vec2(0.0,1.0)), hash(i+vec2(1.0,1.0)), f.x), f.y); } void main() { vec2 uv = gl_FragCoord.xy / u_resolution.xy; float t = u_time * 0.4; vec2 mouseOff = (u_mouseNorm - 0.5) * 0.1; float n = noise(uv*8.0 + t + mouseOff) + noise(uv*16.0 - t*0.7) * 0.5; vec3 water = vec3(0.0, 0.3, 0.5) + vec3(0.0, 0.4, 0.5) * n; vec3 caustic = vec3(1.0, 0.95, 0.8) * pow(n, 3.0) * 0.8; gl_FragColor = vec4(water + caustic, 1.0); }
💾 Speichern
⬇ Export JSON
← Zurück
Live-Vorschau
FPS: --
↻ Neu laden
⏸ Pause