Browse

Ether

by Mewatools

Procedural generated image using distance field.

Source Code
// Adapted to Mewa by Hugo 2021 (hugo@mewatools.com)
// Ether by nimitz 2014 (twitter: @stormoid)
// https://www.shadertoy.com/view/MsjSW3
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// Contact the author for other licensing options

shaderSource = "
    #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 - vec2(.9,.5);
        vec3 cl = vec3(0.);
        float d = uDelta; // initial value 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 = uColor + vec3(5., 2.5, 3.)*f;
            cl = cl*l + smoothstep(2.5, .0, rz)*.7*l;
    		d += min(rz, 1.);
    	}
        fragColor = vec4(cl, 1.);
    }";

node = ShaderNode( shaderSource, "Ether" );
node.addShaderInput("iResolution");
node.setHelpPage("https://www.shadertoy.com/view/MsjSW3");

// controls
deltaControl = node.addFloatControl("uDelta", 2.5);
deltaControl.setName("Delta");
deltaControl.setStep(0.01);
deltaControl.setRange(-2, 7);

colorControl = node.addColorControl( "uColor", 0.1, 0.3, 0.4 );
colorControl.setName("Color");

node.finishAdding();



File Details
  • Last Update: November 29th, 2020
  • Category:
  • License: