Shader Explorer
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.

world_cache_query.wgsl

Import path

Constants

WORLD_CACHE_MAX_TEMPORAL_SAMPLES

#
const WORLD_CACHE_MAX_TEMPORAL_SAMPLES: f32 = 32.0

WORLD_CACHE_DIRECT_LIGHT_SAMPLE_COUNT

#
const WORLD_CACHE_DIRECT_LIGHT_SAMPLE_COUNT: u32 = 32u

WORLD_CACHE_MAX_GI_RAY_DISTANCE

#
const WORLD_CACHE_MAX_GI_RAY_DISTANCE: f32 = 50.0

WORLD_CACHE_CELL_LIFETIME

#
const WORLD_CACHE_CELL_LIFETIME: u32 = 30u

WORLD_CACHE_MAX_SEARCH_STEPS

#
const WORLD_CACHE_MAX_SEARCH_STEPS: u32 = 3u

WORLD_CACHE_POSITION_BASE_CELL_SIZE

#
const WORLD_CACHE_POSITION_BASE_CELL_SIZE: f32 = 0.25

WORLD_CACHE_POSITION_LOD_SCALE

#
const WORLD_CACHE_POSITION_LOD_SCALE: f32 = 8.0

WORLD_CACHE_EMPTY_CELL

#
const WORLD_CACHE_EMPTY_CELL: u32 = 0u

Bindings

world_cache_checksums

#
@group(1)
@binding(14)
var<storage, read_write> world_cache_checksums: atomic<u32>

world_cache_life

#

Shader defs requirments:

🟢 WORLD_CACHE_NON_ATOMIC_LIFE_BUFFER

@group(1)
@binding(15)
var<storage, read_write> world_cache_life: WORLD_CACHE_SIZE

world_cache_life

#

Shader defs requirments:

🔴 WORLD_CACHE_NON_ATOMIC_LIFE_BUFFER

@group(1)
@binding(15)
var<storage, read_write> world_cache_life: atomic<u32>

world_cache_radiance

#
@group(1)
@binding(16)
var<storage, read_write> world_cache_radiance: vec4<f32>

world_cache_geometry_data

#
@group(1)
@binding(17)
var<storage, read_write> world_cache_geometry_data: WorldCacheGeometryData

world_cache_luminance_deltas

#
@group(1)
@binding(18)
var<storage, read_write> world_cache_luminance_deltas: WORLD_CACHE_SIZE

world_cache_active_cells_new_radiance

#
@group(1)
@binding(19)
var<storage, read_write> world_cache_active_cells_new_radiance: vec3<f32>

world_cache_a

#
@group(1)
@binding(20)
var<storage, read_write> world_cache_a: WORLD_CACHE_SIZE

world_cache_b

#
@group(1)
@binding(21)
var<storage, read_write> world_cache_b: array<u32, 1024u>

world_cache_active_cell_indices

#
@group(1)
@binding(22)
var<storage, read_write> world_cache_active_cell_indices: WORLD_CACHE_SIZE

world_cache_active_cells_count

#
@group(1)
@binding(23)
var<storage, read_write> world_cache_active_cells_count: u32

Structures

WorldCacheGeometryData

#
struct WorldCacheGeometryData {
world_position: vec3<f32> ,
padding_a: u32 ,
world_normal: vec3<f32> ,
padding_b: u32 ,
}

Functions

query_world_cache

#
fn query_world_cache (
world_position_in: vec3<f32>
world_normal: vec3<f32>
view_position: vec3<f32>
cell_lifetime: u32
) -> vec3<f32>

get_cell_size

#
fn get_cell_size (
world_position: vec3<f32>
view_position: vec3<f32>
) -> f32

quantize_position

#
fn quantize_position (
world_position: vec3<f32>
quantization_factor: f32
) -> vec3<f32>

quantize_normal

#
fn quantize_normal (
world_normal: vec3<f32>
) -> vec3<f32>

compute_key

#
fn compute_key (
world_position: vec3<u32>
world_normal: vec3<u32>
) -> u32

compute_checksum

#
fn compute_checksum (
world_position: vec3<u32>
world_normal: vec3<u32>
) -> u32

pcg_hash

#
fn pcg_hash (
input: u32
) -> u32

iqint_hash

#
fn iqint_hash (
input: u32
) -> u32

wrap_key

#
fn wrap_key (
key: u32
) -> u32