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.

Structures

Vertex

#
struct Vertex {
@builtin(instance_index)
instance_index: u32 ,
@if(VERTEX_POSITIONS_COMPRESSED)
@location(0)
compressed_position: vec4<f32> ,
@else()
@location(0)
position: vec3<f32> ,
@if(VERTEX_COLORS)
@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

struct VertexOutput {
@builtin(position)
clip_position: vec4<f32> ,
@location(0)
world_position: vec4<f32> ,
@if(VERTEX_COLORS)
@location(1)
color: vec3<f32> ,
}

Functions

vertex

#
@vertex
Processes each 3D point in a model before it's drawn
fn vertex (
vertex: Vertex
) -> VertexOutput

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment ( ) ->
@location(0)
vec4<f32>
Contents