     lin += .25*fre*vec3(1.)*occ;
     col = col*lin;
 
-    col = mix( col, vec3(.0), 1.-exp( -.002*t*t*t ) );
+    // fog
+    col = mix( col, vec3(.0), 1.-exp( -.001*t*t*t ) );
+
+    /*
+    float fade = 1. - min(1., (a - 2.)  / 8.);
+    col = mix( col, vec3(.0), fade );
+    */
   }
 
   return vec3( clamp(col,.0,1.) );

  return mod(p,c)-.5*c;
}

// Rotate around a coordinate axis (i.e. in a plane perpendicular to that axis) by angle <a>.
// Read like this: R(p.xz, a) rotates "x towards z".
// This is fast if <a> is a compile-time constant and slower (but still practical) if not.
vec2 pR(vec2 p, float a) {
	return cos(a)*p + sin(a)*vec2(p.y, -p.x);
}

/*
vec3 opTwist(vec3 p) {
  float  c = cos(p.y);
  float  s = sin(p.y);
  mat2   m = mat2(c,-s,s,c);
  return vec3(m*p.xz,p.y);
}
*/

float fCapsule(vec3 p, float r, float c) {
	return mix(length(p.xz) - r, length(vec3(p.x, abs(p.y) - c, p.z)) - r, step(c, abs(p.y)));



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

  for( int i=0; i<16; i++ ) {
