# Objective - Showcase how to use a `Material` and `Mesh` to spawn 3d lines  ## Solution - Add an example using a simple `Material` and `Mesh` definition to draw a 3d line - Shows how to use `LineList` and `LineStrip` in combination with a specialized `Material` ## Notes This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the `Material` and `AsBindGroup` abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
11 lines
204 B
WebGPU Shading Language
11 lines
204 B
WebGPU Shading Language
struct LineMaterial {
|
|
color: vec4<f32>;
|
|
};
|
|
|
|
[[group(1), binding(0)]]
|
|
var<uniform> material: LineMaterial;
|
|
|
|
[[stage(fragment)]]
|
|
fn fragment() -> [[location(0)]] vec4<f32> {
|
|
return material.color;
|
|
} |