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.

Constants

SPIRAL_OFFSET_0_

#
const SPIRAL_OFFSET_0_: vec2<f32> = vec2<f32>(-0.7071, 0.7071)

SPIRAL_OFFSET_1_

#
const SPIRAL_OFFSET_1_: vec2<f32> = vec2<f32>(-0.0000, -0.8750)

SPIRAL_OFFSET_2_

#
const SPIRAL_OFFSET_2_: vec2<f32> = vec2<f32>( 0.5303, 0.5303)

SPIRAL_OFFSET_3_

#
const SPIRAL_OFFSET_3_: vec2<f32> = vec2<f32>(-0.6250, -0.0000)

SPIRAL_OFFSET_4_

#
const SPIRAL_OFFSET_4_: vec2<f32> = vec2<f32>( 0.3536, -0.3536)

SPIRAL_OFFSET_5_

#
const SPIRAL_OFFSET_5_: vec2<f32> = vec2<f32>(-0.0000, 0.3750)

SPIRAL_OFFSET_6_

#
const SPIRAL_OFFSET_6_: vec2<f32> = vec2<f32>(-0.1768, -0.1768)

SPIRAL_OFFSET_7_

#
const SPIRAL_OFFSET_7_: vec2<f32> = vec2<f32>( 0.1250, 0.0000)

Structures

CubeUV

#

Convert direction vector to cube face UV

struct CubeUV {
uv: vec2f ,
face: u32 ,
}

Functions

rand_u

#

rand_f

#

Generates a random f32 in range [0, 1.0].

fn rand_f (
state: ptr<function, u32>
) -> f32

rand_vec2f

#

Generates a random vec2 where each value is in range [0, 1.0].

fn rand_vec2f (
state: ptr<function, u32>
) -> vec2<f32>

rand_range_u

#

Generates a random u32 in range [0, n).

fn rand_range_u (
n: u32
, 
state: ptr<function, u32>
) -> u32

coords_to_viewport_uv

#

returns the (0-1, 0-1) position within the given viewport for the current buffer coords . buffer coords can be obtained from @builtin(position).xy. the view uniform struct contains the current camera viewport in view.viewport. topleft = 0,0

fn coords_to_viewport_uv (
position: vec2<f32>
, 
viewport: vec4<f32>
) -> vec2<f32>

interleaved_gradient_noise

#

hammersley_2d

#

Hammersley sequence for quasi-random points

fn hammersley_2d (
i: u32
, 
n: u32
) -> vec2f

sample_cosine_hemisphere

#

sample_uniform_hemisphere

#

uniform_hemisphere_inverse_pdf

#
fn uniform_hemisphere_inverse_pdf () -> f32

sample_disk

#

sample_cube_dir

#

Convert UV and face index to direction vector

fn sample_cube_dir (
uv: vec2f
, 
face: u32
) -> vec3f

dir_to_cube_uv

#
fn dir_to_cube_uv (
dir: vec3f
) -> CubeUV

porter_duff_over

#

The Porter-Duff OVER operator on RGBA, correctly computing alpha of the result.

fn porter_duff_over (
bg: vec4<f32>
, 
fg: vec4<f32>
) -> vec4<f32>
Contents