diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-16 12:42:45 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-16 12:42:45 +0200 |
| commit | f85f5afc5a4a50c5c87a236bc76f8a08d50e7137 (patch) | |
| tree | 335f55580ec706cd00ee937995355252b3304dfd /engine/src/rendering/shader.rs | |
| parent | edd3261058c3417cf04f95dbfbc51a64e35426aa (diff) | |
fix(engine): make textures not flipped
Diffstat (limited to 'engine/src/rendering/shader.rs')
| -rw-r--r-- | engine/src/rendering/shader.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/engine/src/rendering/shader.rs b/engine/src/rendering/shader.rs index 12fc9c1..3f07381 100644 --- a/engine/src/rendering/shader.rs +++ b/engine/src/rendering/shader.rs @@ -38,10 +38,10 @@ use crate::mesh::vertex_buffer::VertexLabel; pub mod cursor; -pub const STD_VERTEX_INPUT_SEMANTIC_NAME_POSITION: &str = "STD_POSITION"; -pub const STD_VERTEX_INPUT_SEMANTIC_NAME_NORMAL: &str = "STD_NORMAL"; -pub const STD_VERTEX_INPUT_SEMANTIC_NAME_UV: &str = "STD_UV"; -pub const STD_VERTEX_INPUT_SEMANTIC_NAME_COLOR: &str = "STD_COLOR"; +pub const STD_VERT_IN_SEM_NAME_POSITION: &str = "STD_POSITION"; +pub const STD_VERT_IN_SEM_NAME_NORMAL: &str = "STD_NORMAL"; +pub const STD_VERT_IN_SEM_NAME_UV_FROM_TOP_LEFT: &str = "STD_UV_FROM_TOP_LEFT"; +pub const STD_VERT_IN_SEM_NAME_COLOR: &str = "STD_COLOR"; /// Shader module. #[derive(Debug)] @@ -1054,7 +1054,7 @@ pub enum VertexInputSemName { Position, Normal, - Uv, + UvFromTopLeft, Color, Other(Box<str>), } @@ -1064,10 +1064,10 @@ impl VertexInputSemName fn from_semantic_name(semantic_name: &str) -> Self { match semantic_name { - STD_VERTEX_INPUT_SEMANTIC_NAME_POSITION => Self::Position, - STD_VERTEX_INPUT_SEMANTIC_NAME_NORMAL => Self::Normal, - STD_VERTEX_INPUT_SEMANTIC_NAME_UV => Self::Uv, - STD_VERTEX_INPUT_SEMANTIC_NAME_COLOR => Self::Color, + STD_VERT_IN_SEM_NAME_POSITION => Self::Position, + STD_VERT_IN_SEM_NAME_NORMAL => Self::Normal, + STD_VERT_IN_SEM_NAME_UV_FROM_TOP_LEFT => Self::UvFromTopLeft, + STD_VERT_IN_SEM_NAME_COLOR => Self::Color, _ => Self::Other(semantic_name.to_lowercase().into_boxed_str()), } } @@ -1077,7 +1077,7 @@ impl VertexInputSemName match (self, vertex_label) { (Self::Position, VertexLabel::Position) | (Self::Normal, VertexLabel::Normal) - | (Self::Uv, VertexLabel::Uv) + | (Self::UvFromTopLeft, VertexLabel::UvFromTopLeft) | (Self::Color, VertexLabel::Color) => true, (Self::Other(other), VertexLabel::Other(other_vertex_label)) => { **other == *other_vertex_label @@ -1092,12 +1092,12 @@ impl Display for VertexInputSemName fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Position => { - formatter.write_str(STD_VERTEX_INPUT_SEMANTIC_NAME_POSITION) + Self::Position => formatter.write_str(STD_VERT_IN_SEM_NAME_POSITION), + Self::Normal => formatter.write_str(STD_VERT_IN_SEM_NAME_NORMAL), + Self::UvFromTopLeft => { + formatter.write_str(STD_VERT_IN_SEM_NAME_UV_FROM_TOP_LEFT) } - Self::Normal => formatter.write_str(STD_VERTEX_INPUT_SEMANTIC_NAME_NORMAL), - Self::Uv => formatter.write_str(STD_VERTEX_INPUT_SEMANTIC_NAME_UV), - Self::Color => formatter.write_str(STD_VERTEX_INPUT_SEMANTIC_NAME_COLOR), + Self::Color => formatter.write_str(STD_VERT_IN_SEM_NAME_COLOR), Self::Other(other) => { for character in other.chars() { formatter.write_char(character.to_ascii_uppercase())?; |
