kitgit

tirbofish/dropbear · commit

2da0587f9ad73d4b752eb81f22b610bd2133002f

feature: billboarding (on the path to particles). can render from other texture views, just specifically got it to render from kino_ui. feature?: created a new crate called dropbear-utils that contains standard utilities todo: implement interaction with billboard (using a raycast or smth)

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-03-02 12:05

view full diff

diff --git a/.gitignore b/.gitignore
index 72b7d5c..376184b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,4 +55,4 @@ Cargo.lock
 .idea/
 .env
 libs/
-.env
\ No newline at end of file
+crates/dropbear_future-queue/test.log
\ No newline at end of file
diff --git a/crates/dropbear-engine/src/billboarding.rs b/crates/dropbear-engine/src/billboarding.rs
new file mode 100644
index 0000000..ec79992
--- /dev/null
+++ b/crates/dropbear-engine/src/billboarding.rs
@@ -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