Back home 🏡 WGSL Spec Bevy WGSL Functions

custom_vertex_attribute.wgsl

Bindings

Name Group Binding index Binding type Type
material # 2 0 <uniform> CustomMaterial

Structures

CustomMaterial

#
Name Type
color vec4<f32>

Vertex

#
Annotation Name Type
builtin(instance_index) instance_index u32
location(0) position vec3<f32>
location(1) blend_color vec4<f32>

VertexOutput

#
Annotation Name Type
builtin(position) clip_position vec4<f32>
location(0) blend_color vec4<f32>

FragmentInput

#
Annotation Name Type
location(0) blend_color vec4<f32>

Functions

vertex

#
@vertex
fn vertex(vertex: Vertex) -> VertexOutput
Parameter Type
vertex Vertex
Returns: VertexOutput

fragment

#
@fragment
fn fragment(input: FragmentInput) -> @location(0) vec4<f32>
Parameter Type
input FragmentInput
Returns: @location(0) vec4<f32>