Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

skybox.wgsl

Bindings

skybox

#
@group(0)
@binding(0)
var skybox: texture_cube<f32>

skybox_sampler

#
@group(0)
@binding(1)
var skybox_sampler: sampler

view

#
@group(0)
@binding(2)
var<uniform> view: View

uniforms

#
@group(0)
@binding(3)
var<uniform> uniforms: SkyboxUniforms

Structures

SkyboxUniforms

#
struct SkyboxUniforms {
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

#
struct VertexOutput {
@builtin(position)
position: vec4<f32> ,
}

Functions

coords_to_ray_direction

#
fn coords_to_ray_direction (
position: vec2<f32>
viewport: vec4<f32>
) -> vec3<f32>

skybox_vertex

#
@vertex
Processes each 3D point in a model before it's drawn

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 (
@builtin(vertex_index)
vertex_index: u32
) -> VertexOutput

skybox_fragment

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