Reduce under the ground workload
As nobody (even developers) should go/see under the map.
This commit is contained in:
+1
-4
@@ -183,11 +183,8 @@ fn main() {
|
|||||||
case 17u:
|
case 17u:
|
||||||
f_color = texture(tex17, v_tex_coords);
|
f_color = texture(tex17, v_tex_coords);
|
||||||
break;
|
break;
|
||||||
case 18u:
|
default: // case 18u:
|
||||||
f_color = texture(tex18, v_tex_coords);
|
f_color = texture(tex18, v_tex_coords);
|
||||||
break;
|
|
||||||
default: // case 19u:
|
|
||||||
f_color = vec4(0.0, 0.0, 0.0, 1.0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|||||||
+2
-13
@@ -77,7 +77,6 @@ fn get_altitude(height_columns: &Vec<&str>, columns_index: usize) -> f32 {
|
|||||||
const SEABED_ALTITUDE: f32 = -100.0;
|
const SEABED_ALTITUDE: f32 = -100.0;
|
||||||
// seabed altitude - biggest drop * tiles in a chunk * (chunks in a row - 1)
|
// seabed altitude - biggest drop * tiles in a chunk * (chunks in a row - 1)
|
||||||
const ALTITUDE_BETWEEN_CHUNKS: f32 = SEABED_ALTITUDE - 16.17 * 250.0 * 30.0;
|
const ALTITUDE_BETWEEN_CHUNKS: f32 = SEABED_ALTITUDE - 16.17 * 250.0 * 30.0;
|
||||||
const BELOW_MAP_BIOME: u32 = 19;
|
|
||||||
|
|
||||||
/// Returns a vertex buffer that should be rendered as `TrianglesList`.
|
/// Returns a vertex buffer that should be rendered as `TrianglesList`.
|
||||||
pub fn load_ground(display: &Display) -> VertexBufferAny {
|
pub fn load_ground(display: &Display) -> VertexBufferAny {
|
||||||
@@ -116,7 +115,6 @@ pub fn load_ground(display: &Display) -> VertexBufferAny {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// have deleted a few height files to make it work
|
// have deleted a few height files to make it work
|
||||||
// TODO: use triangle strip
|
|
||||||
let height_contents = fs::read_to_string(&format!(
|
let height_contents = fs::read_to_string(&format!(
|
||||||
"Extensions/LemnosLife/Map/Altis/Ground/{}.height",
|
"Extensions/LemnosLife/Map/Altis/Ground/{}.height",
|
||||||
file_name
|
file_name
|
||||||
@@ -171,19 +169,10 @@ pub fn load_ground(display: &Display) -> VertexBufferAny {
|
|||||||
vertex_data.push(Vertex {
|
vertex_data.push(Vertex {
|
||||||
altitude: ALTITUDE_BETWEEN_CHUNKS,
|
altitude: ALTITUDE_BETWEEN_CHUNKS,
|
||||||
index,
|
index,
|
||||||
biome: BELOW_MAP_BIOME,
|
biome,
|
||||||
chunk,
|
|
||||||
});
|
|
||||||
// This vertex ends correctly the across chunks triangle under the ground.
|
|
||||||
// It is useful to keep a specific color for the triangle under the ground.
|
|
||||||
vertex_data.push(Vertex {
|
|
||||||
altitude: column,
|
|
||||||
index,
|
|
||||||
biome: BELOW_MAP_BIOME,
|
|
||||||
chunk,
|
chunk,
|
||||||
});
|
});
|
||||||
// This vertex defines the cursor ready to be used.
|
// This vertex defines the cursor ready to be used.
|
||||||
// It resets the specific color for the triangle under the ground.
|
|
||||||
vertex_data.push(Vertex {
|
vertex_data.push(Vertex {
|
||||||
altitude: column,
|
altitude: column,
|
||||||
index,
|
index,
|
||||||
@@ -213,7 +202,7 @@ pub fn load_ground(display: &Display) -> VertexBufferAny {
|
|||||||
vertex_data.push(Vertex {
|
vertex_data.push(Vertex {
|
||||||
altitude: ALTITUDE_BETWEEN_CHUNKS,
|
altitude: ALTITUDE_BETWEEN_CHUNKS,
|
||||||
index,
|
index,
|
||||||
biome: BELOW_MAP_BIOME,
|
biome: 0,
|
||||||
chunk,
|
chunk,
|
||||||
});
|
});
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user