 
 	//if acceleration > 0, distance between pixels gets larger each step. This allows covering a larger area
 	float accel=1.0+acceleration;
-	float steps_taken=0;
-
-	for(float i=0;i<num_steps;i++) {
+	float steps_taken=0.0;
+
+	for(int i=0;i<num_steps;i++) {
 
 		pos+=line_advance;
 		z+=z_advance;

			}

			final_pos = new_pos;
			grad=(steps_taken+subgrad)/num_steps;

		} else {
#endif
			grad=steps_taken/num_steps;
			final_pos=pos;
#ifdef SMOOTH_ACCEL
		}

			vec2 cone_dir = final_pos - line_begin;
			float cone_len = length(cone_dir);
			cone_dir = normalize(cone_dir); //will be used normalized from now on
			float max_mipmap = filter_mipmap_levels - 1.0;
			float gloss_mult=gloss;

			float rem_alpha=1.0;
