Back home 🏡 WGSL Spec Bevy WGSL Functions

custom_gltf_2d.wgsl

Structures

Vertex

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

VertexOutput

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

FragmentInput

#
Annotation Name Type
location(0) color vec4<f32>
location(1) barycentric vec3<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>