Back home 🏡 WGSL Spec Bevy WGSL Functions

screenshot.wgsl

Bindings

Name Group Binding index Binding type Type
t # 0 0 texture_2d<f32>

Functions

vs_main

#
@vertex
This vertex shader will create a triangle that will cover the entire screen with minimal effort, avoiding the need for a vertex buffer etc.
fn vs_main(in_vertex_index: u32) -> @builtin(position) vec4<f32>
Parameter Type
in_vertex_index u32
Returns: @builtin(position) vec4<f32>

fs_main

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