MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / create_scene_material_uniform

Method create_scene_material_uniform

native/shared/src/renderer/mod.rs:8731–8746  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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 ///

Callers 2

prepare_materialsMethod · 0.80
cache_model_if_staticMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected