 
 	// sunlight + moonlight
 	// TODO: adjustable angle + colour
-	if(false){
+	if(true){
 		const vec3 SUNLIGHT = vec3(-1.0, 0.2, 0.2);
 		vec3 cast_pos, cast_norm;
 		vec4 cast_col;
 		cast_pos = outpos - frnorm*0.1;
-		float cast_time = cast_ray(cast_pos, SUNLIGHT, cast_norm, RENDER_MAXTIME, cast_col);
-
-		if(cast_time >= RENDER_MAXTIME*0.9)
+		float cast_time = cast_ray(cast_pos, SUNLIGHT, cast_norm, RENDER_MAXTIME*2.0, cast_col);
+
+		if(cast_time >= RENDER_MAXTIME)
 			diffamb += vec3(0.8, 0.8, 0.8)*max(0.0, -dot(normalize(SUNLIGHT),frnorm));
 
 	}


		// if out of range, stop
#ifdef BEAMER
		if(any(lessThan(cell, ivec3(0)))) return atime;
		if(any(greaterThanEqual(cell<<layer, ivec3(256,512,512)))) return atime;
#else
		if(any(lessThan(cell, ivec3(0)))) return maxtime;
		if(any(greaterThanEqual(cell<<layer, ivec3(256,512,512)))) return maxtime;


const int MAX_LAYER = 5;
const float EPSILON = 0.0001;
float RENDER_MAXTIME = 10000.0;

uint world_get_geom(ivec3 pos, int layer)
{
