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

Constants

RECONNECTION_FOOTPRINT_KAPPA

#
const RECONNECTION_FOOTPRINT_KAPPA: AbstractFloat = 0.02

RECONNECTION_ROUGHNESS_MIN

#
const RECONNECTION_ROUGHNESS_MIN: AbstractFloat = 0.6

RECONNECTION_RELAX_DISTANCE

#
const RECONNECTION_RELAX_DISTANCE: AbstractFloat = 1.0

CACHE_TERMINATION_MIN_SOLID_ANGLE

#
const CACHE_TERMINATION_MIN_SOLID_ANGLE: AbstractInt = PI

Structures

InitialSamplingResult

#

radiance is shaded straight into the pixel. With ReSTIR the reservoir additionally carries the candidate chosen for reuse, and radiance holds the radiance that can not be reused. Without ReSTIR there is no reservoir and radiance is the entire estimate.

struct InitialSamplingResult {
reservoir: Reservoir, RESTIR
radiance: vec3<f32>,
}

PathState

#

Path vertices use the following convention: x0 = camera, x1 = primary ray hit (the G-buffer surface), x2 = first BRDF-sampled hit (the reconnection vertex).

struct PathState {
ray_origin: vec3<f32>,
normal: vec3<f32>,
wo: vec3<f32>,
material: ResolvedMaterial,
throughput_past_first_hit: vec3<f32>,
x2_position: vec3<f32>, RESTIR
x2_normal: vec3<f32>, RESTIR
x2_reusable: bool, RESTIR
x1_brdf: vec3<f32>, RESTIR
radiance: vec3<f32>,
reservoir: Reservoir, RESTIR
weight_sum: f32, RESTIR
selected_target_function: f32, RESTIR
}

DiSample

#
struct DiSample {
unbiased_contribution_weight: f32,
light_sample: LightSample,
wi: vec3<f32>,
brdf_radiance: vec3<f32>,
inverse_solid_angle_pdf: f32,
brdf_rays_can_hit: bool,
}

Functions

new_path_state

#
fn new_path_state (
world_position: vec3<f32>,
world_normal: vec3<f32>,
wo: vec3<f32>,
material: ResolvedMaterial
) -> PathState

generate_initial_path

#
fn generate_initial_path (
world_position: vec3<f32>,
world_normal: vec3<f32>,
material: ResolvedMaterial,
workgroup_id: vec2<u32>,
pixel_id: vec2<u32>,
rng: ptr<function, u32>
) -> InitialSamplingResult

generate_nee_candidate

#
fn generate_nee_candidate (
path: ptr<function, PathState>,
F_ab: vec2<f32>,
p_nee: f32,
di_samples: u32,
workgroup_id: vec2<u32>,
bounce: u32,
rng: ptr<function, u32>
)

sample_light_ris

#
fn sample_light_ris (
ray_origin: vec3<f32>,
normal: vec3<f32>,
wo: vec3<f32>,
material: ResolvedMaterial,
F_ab: vec2<f32>,
di_samples: u32,
workgroup_id: vec2<u32>,
bounce: u32,
rng: ptr<function, u32>
) -> DiSample

generate_emissive_candidate

#
fn generate_emissive_candidate (
path: ptr<function, PathState>,
ray_hit: ResolvedRayHitFull,
wi: vec3<f32>,
p_brdf: f32,
ray_t: f32,
p_nee: f32,
di_samples: u32,
bounce: u32,
rng: ptr<function, u32>
)

generate_environment_map_light_candidate

#
Active when
RESTIR
fn generate_environment_map_light_candidate (
path: ptr<function, PathState>,
next_bounce: EvaluateAndSampleBrdfResult,
environment_map_light_radiance: vec3<f32>,
primary_F_ab: vec2<f32>,
bounce: u32,
rng: ptr<function, u32>
)

terminate_into_cache

#
fn terminate_into_cache (
path: ptr<function, PathState>,
ray_hit: ResolvedRayHitFull,
ray_t: f32,
p_brdf: f32,
bounce: u32,
rng: ptr<function, u32>
) -> bool

resample_reconnection_candidate

#
Active when
RESTIR
fn resample_reconnection_candidate (
path: ptr<function, PathState>,
L_at_reconnection: vec3<f32>,
rng: ptr<function, u32>
)

reconnection_reusable

#
Active when
RESTIR
fn reconnection_reusable (
ray_t: f32,
p_brdf: f32,
wi: vec3<f32>,
diffuse_selected: bool,
ray_hit: ResolvedRayHitFull,
world_position: vec3<f32>,
x1_perceptual_roughness: f32,
primary_NdotV: f32
) -> bool

x1_lobe_reusable

#
Active when
RESTIR
fn x1_lobe_reusable (
p_brdf: f32,
diffuse_selected: bool,
x1_perceptual_roughness: f32
) -> bool
Contents