moves compiled shaders, first version with scene info on gpu

This commit is contained in:
zomseffen 2025-01-07 23:21:09 +01:00
parent 57e862832a
commit 694d93c0f3
20 changed files with 623 additions and 113 deletions
src/primitives

View file

@ -1,6 +1,6 @@
use vulkanalia::prelude::v1_0::*;
use cgmath::vec3;
use crate::vertex;
use crate::vertex::{self, Facing};
use crate::scene::Scene;
use crate::primitives::drawable::Drawable;
@ -12,6 +12,7 @@ pub struct Quad{
pub pos4: vertex::Vec3,
pub raster_pos: cgmath::Vector2<u32>,
pub volume_index: u32,
pub facing: Facing,
}
impl Drawable for Quad {
@ -21,25 +22,29 @@ impl Drawable for Quad {
scene.rt_vertices.push(vertex::RTVertex::new(
vec3(self.pos1.x as f32, self.pos1.y as f32, self.pos1.z as f32),
self.raster_pos,
self.volume_index
self.volume_index,
self.facing
));
// 1 top right far
scene.rt_vertices.push(vertex::RTVertex::new(
vec3(self.pos2.x as f32, self.pos2.y as f32, self.pos2.z as f32),
self.raster_pos,
self.volume_index
self.volume_index,
self.facing
));
// 2 top left near
scene.rt_vertices.push(vertex::RTVertex::new(
vec3(self.pos3.x as f32, self.pos3.y as f32, self.pos3.z as f32),
self.raster_pos,
self.volume_index
self.volume_index,
self.facing
));
// 3 top right near
scene.rt_vertices.push(vertex::RTVertex::new(
vec3(self.pos4.x as f32, self.pos4.y as f32, self.pos4.z as f32),
self.raster_pos,
self.volume_index
self.volume_index,
self.facing
));
// top