Build a scene-pipeline material uniform buffer holding the per-material scalar factors. Called once per material — the bind group below references this buffer.
(
&self,
metallic: f32,
roughness: f32,
emissive: [f32; 3],
has_mr_texture: bool,
alpha_cutoff: f32,
)
| 8729 | /// per-material scalar factors. Called once per material — the |
| 8730 | /// bind group below references this buffer. |
| 8731 | pub fn create_scene_material_uniform( |
| 8732 | &self, |
| 8733 | metallic: f32, |
| 8734 | roughness: f32, |
| 8735 | emissive: [f32; 3], |
| 8736 | has_mr_texture: bool, |
| 8737 | alpha_cutoff: f32, |
| 8738 | ) -> wgpu::Buffer { |
| 8739 | use wgpu::util::DeviceExt; |
| 8740 | let uniforms = SceneMaterialUniforms::new(metallic, roughness, emissive, has_mr_texture, alpha_cutoff); |
| 8741 | self.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { |
| 8742 | label: Some("scene_material_uniform"), |
| 8743 | contents: bytemuck::bytes_of(&uniforms), |
| 8744 | usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, |
| 8745 | }) |
| 8746 | } |
| 8747 | |
| 8748 | /// Build a scene-pipeline material bind group. |
| 8749 | /// |
no outgoing calls
no test coverage detected