Created
March 10, 2025 10:44
-
-
Save hathibelagal-dev/bf83ddd04566ef54d107f4cd01687a67 to your computer and use it in GitHub Desktop.
Just a beautiful, aesthetic shader try to portray a turbulent ocean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec3 hsv(float h, float s, float v) { | |
vec3 c = vec3(h * 6.0, s, v); | |
vec3 step = vec3(5.0, 3.0, 1.0); | |
vec3 rgb = clamp(abs(mod(c.x + step, 6.0) - 3.0) - 1.0, 0.0, 1.0); | |
rgb = rgb * rgb * (3.0 - 2.0 * rgb); | |
return v * mix(vec3(1.0), rgb, s); | |
} | |
void mainImage(out vec4 fragColor, in vec2 FC) | |
{ | |
float i, e, R, s; | |
float t=iTime; | |
vec4 o = vec4(0.0); | |
vec3 q, p, d = vec3(FC.xy/iResolution.xy - vec2(.6, .5), .7); | |
for(q.zx -= 1.; i++ < 60.;) { | |
o.rgb += hsv(0.15 + sin(t * 0.5) * 0.1, | |
0.3 + cos(t) * 0.2, | |
min(e * s, 0.9 - e) / 30.); | |
s = 1.; | |
p = q += d * e * R * 0.08; | |
p = vec3(log2(R = length(p)) - t * 1.2, | |
exp(1.5 - p.z/R) + sin(t * 2.) * 0.3, | |
atan(p.y, p.x) + cos(t * 1.5 + R) * 0.4); | |
for(e = --p.y; s < 5e2; s += s) { | |
vec3 sp = sin(p.zxy * s + t) * 1.2 - 0.6; | |
vec3 cp = 1. - cos(p.yxz * s + t * 0.7); | |
e += sin(dot(sp, cp)) / (s * 0.8); | |
} | |
} | |
fragColor = o; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment