 		distance -= advance;
 	}
 
-	return max(0.0,distance);
+	return occlusion;//max(0.0,distance);
 
 }
 

		light_pos = to - light_dir * distance;

		//from -= sign(light_dir)*0.45; //go near the edge towards the light direction to avoid self occlusion
		float dist = raymarch(distance,distance_adv,light_pos,light_dir);

		if (dist > distance_adv) {
			return false;
		}


	}




		vec3 to = pos;
		if (length(normal) > 0.2) {
			to += normal * distance_adv * 0.51;
		} else {
			to -= sign(light_dir)*0.45; //go near the edge towards the light direction to avoid self occlusion
		}

		//clip
		clip_segment(mix(vec4(-1.0,0.0,0.0,0.0),vec4(1.0,0.0,0.0,float(params.limits.x-1)),bvec4(light_dir.x < 0.0)),to,light_pos);
