 
 vec2 map(in vec3 pos, in vec3 origin) {
 
-  vec2 res = vec2(.0, .0);
-
-  float transitionTime = 10.0;
+  vec2 res = vec2(.0);
+
+  float transitionTime = 10.;
   float end0 = 2.;
   float end1 = 14.;
   float end2 = 26.;


  tot /= float(4); // AA * AA

  gl_FragColor = vec4( tot, 1.0 );
}


vec2 castRay(in vec3 ro, in vec3 rd) {
  const int maxIterations = 64;
  float tmin = .02;
  float tmax = 50.;

  float t = tmin;
  float m = -1.;
  for( int i=0; i<maxIterations; i++ ) {
    float precis = .000001*t;
    vec2 res = map( ro+rd*t, ro );
    if( res.x<precis || t>tmax ) break;
    t += res.x;
    m = res.y;
  }

  if( t>tmax ) m=-1.;
  return vec2( t, m );
}


float softshadow(in vec3 ro, in vec3 rd, in float mint, in float tmax) {
  float res = 1.;
  float t = mint;

  for( int i=0; i<16; i++ ) {
    float h = map( ro + rd*t, ro ).x;
    res = min( res, 8.*h/t );
    t += clamp( h, .02, .10 );
    if( h<.001 || t>tmax ) break;
  }

  return clamp( res, .0, 1. );
}

vec3 calcNormal(in vec3 pos) {
  vec2 e = vec2(1.,-1.)*.5773*.0005;
  return normalize( e.xyy*map( pos + e.xyy, pos ).x +
    e.yyx*map( pos + e.yyx, pos ).x +
    e.yxy*map( pos + e.yxy, pos ).x +
