Back home 🏡 WGSL Spec Bevy WGSL Functions

specialized_mesh_pipeline.wgsl

Structures

Vertex

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

VertexOutput

#
This is the output of the vertex shader and we also use it as the input for the fragment shader
Annotation Name Type
builtin(position) clip_position vec4<f32>
location(0) world_position vec4<f32>
location(1) color vec3<f32>

Functions

vertex

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

fragment

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