Back home 🏡 WGSL Spec Bevy WGSL Functions

skybox.wgsl

Bindings

Name Group Binding index Binding type Type
skybox # 0 0 texture_cube<f32>
skybox_sampler # 0 1 sampler
view # 0 2 <uniform> View
uniforms # 0 3 <uniform> SkyboxUniforms

Structures

SkyboxUniforms

#
Name Type Shader Def
brightness f32
transform mat4x4<f32>
_wasm_padding_8b u32 🟢 SIXTEEN_BYTE_ALIGNMENT
_wasm_padding_12b u32 🟢 SIXTEEN_BYTE_ALIGNMENT
_wasm_padding_16b u32 🟢 SIXTEEN_BYTE_ALIGNMENT

VertexOutput

#
Annotation Name Type
builtin(position) position vec4<f32>

Functions

coords_to_ray_direction

#
fn coords_to_ray_direction(position: vec2<f32>, viewport: vec4<f32>) -> vec3<f32>
Parameter Type
position vec2<f32>
viewport vec4<f32>
Returns: vec3<f32>

skybox_vertex

#
@vertex
3 | 2. 2 | : `. 1 | x-----x. 0 | | s | `. -1 | 0-----x.....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.
fn skybox_vertex(vertex_index: u32) -> VertexOutput
Parameter Type
vertex_index u32
Returns: VertexOutput

skybox_fragment

#
@fragment
fn skybox_fragment(in: VertexOutput) -> @location(0) vec4<f32>
Parameter Type
in VertexOutput
Returns: @location(0) vec4<f32>