 
 vec2 castRay(in vec3 ro, in vec3 rd) {
   const int maxIterations = 64;
-  float tmin = 0.02;
-  float tmax = 50.0;
+  float tmin = .02;
+  float tmax = 50.;
 
   float t = tmin;
-  float m = -1.0;
+  float m = -1.;
   for( int i=0; i<maxIterations; i++ ) {
-    float precis = 0.000001*t;
+    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.0;
+  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.0;
+  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.0*h/t );
-    t += clamp( h, 0.02, 0.10 );
-    if( h<0.001 || t>tmax ) break;
-  }
-
-  return clamp( res, 0.0, 1.0 );
+    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.0,-1.0)*0.5773*0.0005;
+  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 +

}

vec3 opRep(vec3 p, vec3 c) {
  return mod(p,c)-0.5*c;
}

vec3 opTwist(vec3 p) {

}

float calcAO(in vec3 pos, in vec3 nor) {
  float occ = .0;
  float sca = 1.;

  for(int i=0; i<5; i++) {
    float hr = .01 + .12*float(i)/4.;
    vec3 aopos =  nor * hr + pos;
    float dd = map( aopos, pos ).x;
    occ += -(dd-hr)*sca;
    sca *= .95;
  }

  return clamp( 1. - 3.*occ, .0, 1. );
}

vec3 render(in vec3 ro, in vec3 rd) {
  vec3 col = vec3(.0);
  //vec3 col = vec3(.05, .05, .05) +rd.y*.1;
  vec2 res = castRay(ro,rd);
  float t = res.x;
  float m = res.y;
  if( m>-.5 ) {
    vec3 pos = ro + t*rd;
    vec3 nor = calcNormal( pos );
    vec3 ref = reflect( rd, nor );

    // material
    col = .45 + .35*sin( vec3(.05,.08,.10)*(m-1.0) );
    /*
    if( m<1.5 ) {
      float f = mod( floor(5.0*pos.z) + floor(5.0*pos.x), 2.0);
      col = .3 + .1*f*vec3(1.0);
    }
    */

    // lighitng. Seems Lighit
    float occ = calcAO( pos, nor );
    vec3  lig = normalize( vec3(-.4, .7, -.6) );
    float amb = clamp( .5+.5*nor.y, .0, 1. );
    float dif = clamp( dot( nor, lig ), .0, 1. );
    float bac = clamp( dot( nor, normalize(vec3(-lig.x,.0,-lig.z))), .0, 1. )*clamp( 1.-pos.y,.0,1.);
    float dom = smoothstep( -.1, .1, ref.y );
    float fre = pow( clamp(1.+dot(nor,rd),.0,1.), 2. );
    float spe = pow(clamp( dot( ref, lig ), .0, 1. ),16.);

    dif *= softshadow( pos, lig, .02, 2.5 );
    dom *= softshadow( pos, ref, .02, 2.5 );

    vec3 lin = vec3(.0);
    lin += 1.3*dif*vec3(1.,.8,.55);
    lin += 2.*spe*vec3(1.,.9,.7)*dif;
    lin += .4*amb*vec3(.4,.6,1.)*occ;
    lin += .5*dom*vec3(.4,.6,1.)*occ;
    lin += .5*bac*vec3(.25,.25,.25)*occ;
    lin += .25*fre*vec3(1.,1.,1.)*occ;
    col = col*lin;

    col = mix( col, vec3(.8,.9,1.), 1.-exp( -.0002*t*t*t ) );
  }

  return vec3( clamp(col,.0,1.) );
}

mat3 setCamera(in vec3 ro, in vec3 ta, float cr) {
	vec3 cw = normalize(ta-ro);
	vec3 cp = vec3(sin(cr), cos(cr),.0);
	vec3 cu = normalize( cross(cw,cp) );
	vec3 cv = normalize( cross(cu,cw) );

