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

PrimitiveInput

#
struct PrimitiveInput {
@per_primitive()
@location(3)
colorMask: vec4<f32> ,
}

Output

#
struct Output {
@location(0)
color: vec4<f32> ,
@builtin(frag_depth)
frag_depth: f32 ,
}

Functions

depth_ndc_to_view_z

#

Convert ndc depth to linear view z. Note: Depth values in front of the camera will be negative as -z is forward

fn depth_ndc_to_view_z (
ndc_depth: f32
, 
clip_from_view: mat4x4<f32>
, 
view_from_clip: mat4x4<f32>
) -> f32

perspective_camera_near

#
fn perspective_camera_near (
clip_from_view: mat4x4<f32>
) -> f32

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment (
vertex: VertexOutput
, 
primitive: PrimitiveInput
) -> Output
Contents