Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#import bevy_pbr::mesh_types
2#import bevy_pbr::mesh_view_bindings
4@group(1) @binding(0)
5var<uniform> mesh: Mesh;
7#ifdef SKINNED
8@group(1) @binding(1)
9var<uniform> joint_matrices: SkinnedMesh;
10#import bevy_pbr::skinning
11#endif
13// NOTE: Bindings must come before functions that use them!
14#import bevy_pbr::mesh_functions
16struct Vertex {
17 @location(0) position: vec3<f32>,
18#ifdef SKINNED
19 @location(4) joint_indexes: vec4<u32>,
20 @location(5) joint_weights: vec4<f32>,
21#endif
22};
24struct VertexOutput {
25 @builtin(position) clip_position: vec4<f32>,
26};
28@vertex
29fn vertex(vertex: Vertex) -> VertexOutput {
30#ifdef SKINNED
31 let model = skin_model(vertex.joint_indexes, vertex.joint_weights);
32#else
33 let model = mesh.model;
34#endif
36 var out: VertexOutput;
37 out.clip_position = mesh_position_local_to_clip(model, vec4<f32>(vertex.position, 1.0));
38 return out;
41@fragment
42fn fragment() -> @location(0) vec4<f32> {
43 return vec4<f32>(1.0, 1.0, 1.0, 1.0);
Contents