 	vec4 step = (1.0 / float(c_NumForwardSteps + 1U)) * (b - a);
 	for (uint i=0U; i<c_NumForwardSteps; ++i) {
 		vec4 c = a + step;
-		c.w = get_latitude(c.xy);
+		Surface suf = get_surface(c.xy);
+		c.w = suf.low_alt;
 		if (c.z < c.w) {
 			b = c;
 			break;

	//Target0 = texture(t_Palette, pos.z / u_TextureScale.z);
	vec3 pos = cast_ray_to_map(u_CamPos.xyz, view);
	{
		vec3 tc = vec3(pos.xy / u_TextureScale.xy, 0.0);
		tc.z = trunc(mod(tc.y, u_TextureScale.w));
		uint meta = texture(t_Meta, tc).x;
		if (mod(pos.x, 2.0) >= 1.0 && (meta & c_DoubleLevelMask) != 0U) {
			tc.x -= 1.0 / u_TextureScale.x;
			meta = texture(t_Meta, tc).x;
		}
		float terrain = float((meta >> c_TerrainShift) & (c_NumTerrains - 1U)) + 0.5;
		vec3 off = vec3(1.0 / u_TextureScale.x, 0.0, 0.0);
		float diff = texture(t_Height, tc + off).x - texture(t_Height, tc - off).x;
		float light_clr = texture(t_Table, vec3(0.5 * diff + 0.5, 0.25, terrain)).x;
		float tmp = light_clr - c_HorFactor * (1.0 - pos.z / u_TextureScale.z);
		float color_id = texture(t_Table, vec3(0.5 * tmp + 0.5, 0.75, terrain)).x;

	}
	for (uint i=0U; i<c_NumBinarySteps; ++i) {
		vec4 c = 0.5 * (a + b);
		Surface suf = get_surface(c.xy);
		c.w = suf.low_alt;
		if (c.z < c.w) {
			b = c;
		}else {
