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_UPDATES_SOFT_CAP

#
const WORLD_CACHE_CELL_UPDATES_SOFT_CAP: u32 = 40000u

WORLD_CACHE_CELL_LIFETIME

#
const WORLD_CACHE_CELL_LIFETIME: u32 = 10u

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.15

WORLD_CACHE_POSITION_LOD_SCALE

#
const WORLD_CACHE_POSITION_LOD_SCALE: f32 = 15.0

WORLD_CACHE_EMPTY_CELL

#
const WORLD_CACHE_EMPTY_CELL: u32 = 0u

Functions

query_world_cache

#
fn query_world_cache (
world_position_in: vec3<f32>
world_normal: vec3<f32>
view_position: vec3<f32>
ray_t: 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