Back home 🏡 WGSL Spec Bevy WGSL Functions

fullscreen.wgsl

Import path

Structures

FullscreenVertexOutput

#
Annotation Name Type
builtin(position) position vec4<f32>
location(0) uv vec2<f32>

Functions

fullscreen_vertex_shader

#
@vertex
This vertex shader produces the following, when drawn using indices 0..3: 1 | 0-----x.....2 0 | | s | . ´ -1 | x_____x´ -2 | : .´ -3 | 1´ +--------------- -1 0 1 2 3 The axes are clip-space x and y. The region marked s is the visible region. The digits in the corners of the right-angled triangle are the vertex indices. The top-left has UV 0,0, the bottom-left has 0,2, and the top-right has 2,0. This means that the UV gets interpolated to 1,1 at the bottom-right corner of the clip-space rectangle that is at 1,-1 in clip space.
fn fullscreen_vertex_shader(vertex_index: u32) -> FullscreenVertexOutput
Parameter Type
vertex_index u32
Returns: FullscreenVertexOutput