kitgit

tirbofish/dropbear · diff

69c2f90 · Thribhu K

feature: implement reflections, improved model textures. for some reason, collider wireframe doesnt render and i deadass dont know why.

Unverified

diff --git a/crates/dropbear-engine/src/bind_groups.rs b/crates/dropbear-engine/src/bind_groups.rs
new file mode 100644
index 0000000..762605a
--- /dev/null
+++ b/crates/dropbear-engine/src/bind_groups.rs
@@ -0,0 +1,124 @@
+use crate::buffer::UniformBuffer;
+use crate::graphics::SharedGraphicsContext;
+use crate::pipelines::globals::Globals;
+use wgpu::{BindGroup, Buffer};
+
+/// Bind groups for @group(0)
+pub struct SceneGlobalsBindGroup {
+    pub bind_group: BindGroup,
+}
+
+impl SceneGlobalsBindGroup {
+    pub fn new(
+        graphics: &SharedGraphicsContext,
+        globals_buffer: &UniformBuffer<Globals>,
+        camera_buffer: &Buffer,
+    ) -> Self {
+        let bind_group = graphics
+            .device
+            .create_bind_group(&wgpu::BindGroupDescriptor {
+                label: Some("scene globals+camera bind group"),
+                layout: &graphics.layouts.scene_globals_bind_group_layout,
+                entries: &[
+                    wgpu::BindGroupEntry {
+                        binding: 0,
+                        resource: globals_buffer.buffer().as_entire_binding(),
+                    },
+                    wgpu::BindGroupEntry {
+                        binding: 1,
+                        resource: camera_buffer.as_entire_binding(),
+                    },
+                ],
+            });
+
+        Self { bind_group }
+    }
+
+    pub fn update(
+        &mut self,
+        graphics: &SharedGraphicsContext,
+        globals_buffer: &UniformBuffer<Globals>,
+        camera_buffer: &Buffer,
+    ) {
+        self.bind_group = graphics
+            .device

Large diffs are not rendered by default. Showing the first 50 of 1963 lines. Show full diff