 
 	if(test_mesh)
 	{
+		trace_plane(shadow_mode
+			, vec3(0.0, 1.0, 0.0), -3.0
+			, vec3(0.9, 0.9, 0.9)
+			, vec3(0.1, 0.1, 0.1)
+			);
+
 		trace_donut(shadow_mode, vec3(0.0, 0.0, -4.0), vec3(0.0, 0.0, 1.0), 1.0, 0.5, vec3(1.0, 0.0, 1.0));
 		/*
 		vec3 dsign = sign(wdir);

#version 150
const bool do_debug = false;
const bool do_kdtree = true;
const bool do_shadow = false;
const bool do_bbox = true;

const bool do_kd_restart = false;

	float etime = -nopos*nodir;
	//if(etime < EPSILON) return; // *** SKIP if casting in wrong direction

	// Project position onto the plane
	vec3 epoint = wpos - enorm*etime;

	// Caluclate requirements for our double-triangle motion
	vec3 pdir = normalize(epoint - epos);
	float prad = length(epoint - epos);
	float pcos = dot(pdir, wdir);

	// Now for some trigonometric horror
	float psin = sqrt(1.0 - pcos*pcos);
	float K = pcos*prad; // Tangent distance
	//float tA = psin*prad;
	float tA = sqrt(prad*prad - K*K); // Time to tangent
	float tB = sqrt(radx*radx - K*K); // Time from tangent to border

	float ptime = tA+tB; 
	//vec3 ppos = epos + normalize(proj_pdir*(ptime))*(radh+radd);

	// Trace sphere
	{
		float old_ttime = ttime;
		vec3 ppos = epoint + proj_pdir*(ptime);
		ppos = epos + normalize(ppos - epos)*radx;
		trace_sphere(1, shadow_mode, ppos, radd);
		if((!shadow_mode) && ttime != old_ttime)
			shade_sphere(ppos, ecol);
	}
	if(false){
		float old_ttime = ttime;
		vec3 ppos = epoint + proj_pdir*(tA-tB);
		ppos = epos + normalize(ppos - epos)*radx;
		trace_sphere(1, shadow_mode, ppos, radd);
		if((!shadow_mode) && ttime != old_ttime)
			shade_sphere(ppos, ecol);
	}
}

void trace_plane(bool shadow_mode, vec3 enorm, float eoffs, vec3 ecol0, vec3 ecol1)
