From e22f1f0e835444302e436f38502f97e46c4b63d9 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sun, 23 Oct 2022 02:36:14 +0200 Subject: [PATCH] Reduce under the ground workload As nobody (even developers) should go/see under the map. --- src/main.rs | 5 +---- src/support/mod.rs | 15 ++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index 036dd3b..0c75ea1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -183,11 +183,8 @@ fn main() { case 17u: f_color = texture(tex17, v_tex_coords); break; - case 18u: + default: // case 18u: f_color = texture(tex18, v_tex_coords); - break; - default: // case 19u: - f_color = vec4(0.0, 0.0, 0.0, 1.0); } } " diff --git a/src/support/mod.rs b/src/support/mod.rs index ec8fe7e..225f844 100644 --- a/src/support/mod.rs +++ b/src/support/mod.rs @@ -77,7 +77,6 @@ fn get_altitude(height_columns: &Vec<&str>, columns_index: usize) -> f32 { const SEABED_ALTITUDE: f32 = -100.0; // 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 BELOW_MAP_BIOME: u32 = 19; /// Returns a vertex buffer that should be rendered as `TrianglesList`. 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 - // TODO: use triangle strip let height_contents = fs::read_to_string(&format!( "Extensions/LemnosLife/Map/Altis/Ground/{}.height", file_name @@ -171,19 +169,10 @@ pub fn load_ground(display: &Display) -> VertexBufferAny { vertex_data.push(Vertex { altitude: ALTITUDE_BETWEEN_CHUNKS, index, - biome: BELOW_MAP_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, + biome, chunk, }); // This vertex defines the cursor ready to be used. - // It resets the specific color for the triangle under the ground. vertex_data.push(Vertex { altitude: column, index, @@ -213,7 +202,7 @@ pub fn load_ground(display: &Display) -> VertexBufferAny { vertex_data.push(Vertex { altitude: ALTITUDE_BETWEEN_CHUNKS, index, - biome: BELOW_MAP_BIOME, + biome: 0, chunk, }); i += 1;