environment_filter.wgsl
Bindings
@group(0)
@binding(0)
var
input_texture:
texture_2d_array<f32>
@group(0)
@binding(2)
var
output_texture:
texture_storage_2d_array<rgba16float, write>
@group(0)
@binding(4)
var
blue_noise_texture:
texture_2d_array<f32>
Structures
Functions
Shader defs requirments:
š¢ HAS_BLUE_NOISE
fn
sample_noise
(
pixel_coords: vec2u
)
->
vec4f
Shader defs requirments:
š“ HAS_BLUE_NOISE
pseudo-random numbers using RNG
fn
sample_noise
(
pixel_coords: vec2u
)
->
vec4f
Calculate LOD for environment map lookup using filtered importance sampling
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn
generate_radiance_map
(
)
@builtin(global_invocation_id)
global_id: vec3u
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn
generate_irradiance_map
(
)
@builtin(global_invocation_id)
global_id: vec3u
Sample an environment map with a specific LOD