tirbofish/dropbear · commit
69c2f901cb7d5013f36c142f5c35a66e716a42e2
feature: implement reflections, improved model textures.
for some reason, collider wireframe doesnt render and i deadass dont know why.
Signature present but could not be verified.
Unverified
@@ -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