 	float advancement = max(0.0, atime_target-0.1);
 	outpos += vdir*advancement;
 #endif
-	float RENDER_MAXTIME = 10000.0;
 #ifdef BEAMER
 	float atime_cast = cast_ray(outpos, ray_dir, frnorm, RENDER_MAXTIME, fcol);
 	if(atime_cast == RENDER_MAXTIME)


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

uint world_get_geom(ivec3 pos, int layer)
{


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