From b9f3d8911c1786eefa697ab31793183033089e23 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 19 May 2018 15:07:14 +0200 Subject: [PATCH] Add ether.glsl --- ether.glsl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ether.glsl diff --git a/ether.glsl b/ether.glsl new file mode 100644 index 0000000..2241edb --- /dev/null +++ b/ether.glsl @@ -0,0 +1,30 @@ +//Ether by nimitz (twitter: @stormoid) + +#define t iTime +mat2 m(float a){float c=cos(a), s=sin(a);return mat2(c,-s,s,c);} +float map(vec3 p){ + p.xz*= m(t*0.4);p.xy*= m(t*0.3); + vec3 q = p*2.+t; + return length(p+vec3(sin(t*0.7)))*log(length(p)+1.) + sin(q.x+sin(q.z+sin(q.y)))*0.5 - 1.; +} + +void mainImage( out vec4 fragColor, in vec2 fragCoord ){ +// vec2 p = fragCoord.xy/iResolution.y - vec2(.9,.5); + vec2 p = (fragCoord.xy / max(iResolution.y, iResolution.x)); + p *= 1.3; + p -= vec2(.9, 0); + + vec3 cl = vec3(0.); + float d = 2.5; + for(int i=0; i<=5; i++) { + vec3 p = vec3(0,0,5.) + normalize(vec3(p, -1.))*d; + float rz = map(p); + float f = clamp((rz - map(p+.1))*0.5, -.1, 1. ); + vec3 l = vec3(0.1,0.3,.4) + vec3(5., 2.5, 3.)*f; + cl = cl*l + (1.-smoothstep(0., 2.5, rz))*.7*l; + d += min(rz, 1.); + } + fragColor = vec4(cl, 1.); +} + +// https://www.shadertoy.com/view/MsjSW3