Back home 🏡 WGSL Spec Bevy WGSL Functions

custom_phase_item.wgsl

Structures

Vertex

#
The GPU-side vertex structure.
Annotation Name Type
location(0) position vec3<f32>
location(1) color vec3<f32>

VertexOutput

#
Information passed from the vertex shader to the fragment shader.
Annotation Name Type
builtin(position) clip_position vec4<f32>
location(0) color vec3<f32>

Functions

vertex

#
@vertex
The vertex shader entry point.
fn vertex(vertex: Vertex) -> VertexOutput
Parameter Type
vertex Vertex
Returns: VertexOutput

fragment

#
@fragment
The fragment shader entry point.
fn fragment(vertex_output: VertexOutput) -> @location(0) vec4<f32>
Parameter Type
vertex_output VertexOutput
Returns: @location(0) vec4<f32>