Support Warning
WebGPU is currently only supported on Chrome starting with version 113, and only on desktop. If they don't work on your configuration, you can check the WebGL2 examples here.shader_material.rs:
//! A shader and a material that uses it.
use ;
/// set up a simple 3D scene
// This struct defines the data that will be passed to your shader
/// The Material trait is very configurable, but comes with sensible defaults for all methods.
/// You only need to implement functions for features that need non-default behavior. See the Material api docs for details!
shaders/custom_material.wgsl:
#import VertexOutput
// we can import items from shader modules in the assets folder with a quoted path
#import "shaders/custom_material_import.wgsl"COLOR_MULTIPLIER
@group @binding material_color: ;
@group @binding var material_color_texture: ;
@group @binding var material_color_sampler: sampler;
@fragment
@location