 
 #if defined(USE_VERTEX_LIGHTING)
 
-	gl_FragColor.rgb = mix(gl_FragColor.rgb,fog_interp.rgb,fog_interp.a);
-#else	//pixel based fog
+	gl_FragColor.rgb = mix(gl_FragColor.rgb, fog_interp.rgb, fog_interp.a);
+#else //pixel based fog
 	float fog_amount = 0.0;
 
 #ifdef LIGHT_MODE_DIRECTIONAL

uniform mediump float fog_height_curve;
#endif


#endif //fog

void main() {


	{

		float fog_z = smoothstep(fog_depth_begin, fog_max_distance, length(vertex));

		fog_amount = pow(fog_z, fog_depth_curve);
	}
#endif

#ifdef FOG_HEIGHT_ENABLED
	{
		float y = (camera_matrix * vec4(vertex_interp, 1.0)).y;
		fog_amount = max(fog_amount, pow(smoothstep(fog_height_min, fog_height_max, y), fog_height_curve));
	}
#endif
	fog_interp = vec4(fog_color, fog_amount);

#endif //fog

