tirbofish/dropbear · diff
Merge pull request #93 from tirbofish/billboarding
feature: billboarding
Signature present but could not be verified.
Unverified
@@ -55,4 +55,4 @@ Cargo.lock .idea/ .env libs/ -.env +crates/dropbear_future-queue/test.log @@ -0,0 +1,241 @@ +use std::sync::Arc; +use glam::Mat4; +use wgpu::MultisampleState; +use wgpu::util::{BufferInitDescriptor, DeviceExt}; +use crate::asset::ASSET_REGISTRY; +use crate::buffer::UniformBuffer; +use crate::graphics::SharedGraphicsContext; +use crate::shader::Shader; + +pub struct BillboardPipeline { + pipeline: wgpu::RenderPipeline, + transform_buffer: UniformBuffer<Mat4>, + projection_buffer: UniformBuffer<Mat4>, + position_buffer: wgpu::Buffer, + tex_coord_buffer: wgpu::Buffer, + uniform_bind_group_layout: wgpu::BindGroupLayout, + sampler: wgpu::Sampler, +} + +impl BillboardPipeline { + pub fn new( + graphics: Arc<SharedGraphicsContext>, + ) -> Self { + puffin::profile_function!(); + log::debug!("Initialising billboard pipeline"); + let shader = Shader::new( + graphics.clone(), + include_str!("shaders/billboard.wgsl"), + Some("billboard shader"), + ); + + let positions: [[f32; 3]; 4] = [
Large diffs are not rendered by default. Showing the first 50 of 2175 lines. Show full diff