 
 	vec3 ray = -normalize(pos);
 	vec3 light_dir = normalize(gl_LightSource[0].position.xyz);
-	float dotP = max(0, dot(ray,light_dir));
+	float dotP = dot(ray,light_dir);
 	float rayleigh = phase(dotP,-0.01)*33;
-	float mie = phase(dotP,-0.875)*100;
+	float mie = phase(dotP,-0.575)*100;
 	float spot = smoothstep(0.0, 15.0, phase(dotP,0.9995))*1000;
-
-	vec3 accumulator = vec3(0, 0, 0);
 
 	vec3 eye_pos = vec3(0, 1.8, 0);
 	float eye_atmo_dist = atmospheric_depth(eye_pos, ray);
-	float step_size = eye_atmo_dist / step_count;
+	float step_size = eye_atmo_dist / float(step_count);
 
 	vec3 eye_dir = -normalize(pos);
 

		mie*mie_collected +
		rayleigh*rayleigh_collected
	);
    gl_FragColor = vec4(color,1);
}


		float sample_depth = atmospheric_depth(sample_pos,light_dir);

		vec3 influx = absorb(sample_depth, vec3(1.8), 6000)*extinction;

		rayleigh_collected += absorb(sqrt(sample_distance), skycolor*influx, 23900.0);
		mie_collected += absorb(sample_distance, influx, 36400.0);
	}

	float eye_extinction = 1/*horizon_extinction(eye_position, ray,surface_height - 0.3)*/;
	rayleigh_collected = (
		rayleigh_collected *
		eye_extinction *
		pow(eye_atmo_dist / 2500e3, 1)
	)/float(step_count);
	mie_collected = (
		mie_collected *
		eye_extinction *
		pow(eye_atmo_dist / 2500e3, 1)
	)/float(step_count);

	vec3 color = vec3(
