Reduce under the ground workload

As nobody (even developers) should go/see under the map.
This commit is contained in:
2022-10-23 02:36:14 +02:00
parent 76d64b6660
commit e22f1f0e83
2 changed files with 3 additions and 17 deletions
+1 -4
View File
@@ -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);
}
}
"
+2 -13
View File
@@ -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;