From e4f634a441956bbf4efd1754c84a32a60786dffc Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sun, 16 Oct 2022 23:46:51 +0200 Subject: [PATCH] Make backface culling ready to use --- src/main.rs | 2 ++ src/support/mod.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f8188cc..bae68f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,6 +94,8 @@ fn main() { write: true, ..Default::default() }, + // Verify that it helps from the FPS point of view. + //backface_culling: glium::draw_parameters::BackfaceCullingMode::CullClockwise, ..Default::default() }; diff --git a/src/support/mod.rs b/src/support/mod.rs index 8cba47d..a0e04b5 100644 --- a/src/support/mod.rs +++ b/src/support/mod.rs @@ -108,9 +108,9 @@ pub fn load_ground(display: &Display) -> VertexBufferAny { // Second triangle. vertex_data.push(Vertex { - position: [(lines_index + 1) as f32, column_below_right, (columns_index + 1) as f32], + position: [(lines_index + 1) as f32, column_below, columns_index as f32], normal: [0.0, 0.0, 1.0], - tex_coords: [1.0, 1.0], + tex_coords: [1.0, 0.0], }); vertex_data.push(Vertex { @@ -120,9 +120,9 @@ pub fn load_ground(display: &Display) -> VertexBufferAny { }); vertex_data.push(Vertex { - position: [(lines_index + 1) as f32, column_below, columns_index as f32], + position: [(lines_index + 1) as f32, column_below_right, (columns_index + 1) as f32], normal: [0.0, 0.0, 1.0], - tex_coords: [1.0, 0.0], + tex_coords: [1.0, 1.0], }); } }