From 3ac1e5e5a9ebcb4beb2bfe149dd5095f2250f60d Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Mon, 20 Jul 2026 20:43:48 -0700 Subject: load a nontrivial model and render it with a texture yay Force-Push: yes Change-Id: Icb715692286c8560532ab73d32a49be8f485d790 --- src/shader_data.rs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'src/shader_data.rs') diff --git a/src/shader_data.rs b/src/shader_data.rs index bd7ff82..8197bfc 100644 --- a/src/shader_data.rs +++ b/src/shader_data.rs @@ -5,31 +5,6 @@ use std::mem::size_of; use vulkanalia::vk::{ self, HasBuilder }; -pub static VERTICES: [Vertex; 8] = [ - Vertex::new(Vec3::new(-0.5, -0.5, 0.0), Vec3::new(1.0, 0.0, 0.0), - Vec2::new(1.0, 0.0)), - Vertex::new(Vec3::new( 0.5, -0.5, 0.0), Vec3::new(0.0, 1.0, 0.0), - Vec2::new(0.0, 0.0)), - Vertex::new(Vec3::new( 0.5, 0.5, 0.0), Vec3::new(0.0, 0.0, 1.0), - Vec2::new(0.0, 1.0)), - Vertex::new(Vec3::new(-0.5, 0.5, 0.0), Vec3::new(1.0, 1.0, 1.0), - Vec2::new(1.0, 1.0)), - Vertex::new(Vec3::new(-0.5, -0.5, 0.5), Vec3::new(1.0, 0.0, 0.0), - Vec2::new(1.0, 0.0)), - Vertex::new(Vec3::new( 0.5, -0.5, 0.5), Vec3::new(0.0, 1.0, 0.0), - Vec2::new(0.0, 0.0)), - Vertex::new(Vec3::new( 0.5, 0.5, 0.5), Vec3::new(0.0, 0.0, 1.0), - Vec2::new(0.0, 1.0)), - Vertex::new(Vec3::new(-0.5, 0.5, 0.5), Vec3::new(1.0, 1.0, 1.0), - Vec2::new(1.0, 1.0)), -]; - -pub const INDICES: &[u16] = &[ - 0, 1, 2, 2, 3, 0, - 4, 5, 6, 6, 7, 4, -]; - - #[repr(C)] #[derive(Clone, Debug)] pub struct Vertex { @@ -48,8 +23,8 @@ pub struct UniformBlock { } impl Vertex { - const fn new(position: Vec3, color: Vec3, - texture_coordinates: Vec2) + pub const fn new(position: Vec3, color: Vec3, + texture_coordinates: Vec2) -> Self { Self { position, color, texture_coordinates } -- cgit 1.4.1