basic working polygon renderer

This commit is contained in:
2024-06-15 03:03:48 -04:00
parent 219213ee24
commit aa466a248c
23 changed files with 639 additions and 300 deletions

View File

@@ -150,7 +150,7 @@ impl VoxelPipeline {
let updates = [ArrBufUpdate {
offset,
data: &grid,
data: &grid.as_slice().unwrap(),
}];
let size = offset + grid.len();
self.voxels.update(device, encoder, belt, size, &updates);
@@ -226,7 +226,6 @@ impl VoxelPipeline {
width: size.x,
height: size.y,
zoom: camera.scale,
padding: 0,
transform,
};
self.view.update(device, encoder, belt, data)

View File

@@ -6,15 +6,13 @@ struct GlobalLight {
struct VertexOutput {
@builtin(position) clip_position: vec4<f32>,
@location(0) tex_coords: vec2<f32>,
};
struct View {
transform: mat4x4<f32>,
width: u32,
height: u32,
zoom: f32,
padding: u32,
transform: mat4x4<f32>,
};
struct VoxelGroup {

View File

@@ -3,11 +3,10 @@ use nalgebra::Transform3;
#[repr(C, align(16))]
#[derive(Clone, Copy, PartialEq, bytemuck::Zeroable)]
pub struct View {
pub transform: Transform3<f32>,
pub width: u32,
pub height: u32,
pub zoom: f32,
pub padding: u32,
pub transform: Transform3<f32>,
}
unsafe impl bytemuck::Pod for View {}
@@ -18,7 +17,6 @@ impl Default for View {
width: 1,
height: 1,
zoom: 1.0,
padding: 0,
transform: Transform3::identity(),
}
}