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

FULL_REPLACEMENT_FRACTION

#
const FULL_REPLACEMENT_FRACTION: AbstractFloat = 0.9

MAX_VIRTUAL_DEPTH_JITTER

#
const MAX_VIRTUAL_DEPTH_JITTER: AbstractFloat = 0.002

NORMAL_QUANTIZATION_FLOOR

#
const NORMAL_QUANTIZATION_FLOOR: AbstractFloat = 0.002

ENVIRONMENT_VIRTUAL_DISTANCE

#
const ENVIRONMENT_VIRTUAL_DISTANCE: AbstractFloat = 10000.0

Structures

PsrState

#

Carried across every bounce of the path walk, so anything derivable from a value the walk already holds is derived at the end instead of stored. What is left is only what the walk itself produces.

struct PsrState {
finished: bool ,
replace_fully: bool ,
mirror_rotor: vec4<f32> ,
mirror_parity_odd: bool ,
reflection_length: f32 ,
throughput: vec3<f32> ,
}

Functions

resolve_dlss_rr_textures

#
@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 resolve_dlss_rr_textures (
@builtin(global_invocation_id)
global_id: vec3<u32>
)

needs_specular_motion_vector

#
fn needs_specular_motion_vector (
roughness: f32
) -> bool

psr_init

#
fn psr_init (
world_normal: vec3<f32>
, 
material: ResolvedMaterial
) -> PsrState

psr_chain_mirror

#

A product of k Householder reflections is orthogonal with determinant (-1)^k, so it is a rotation when k is even, and a rotation composed with any one fixed reflection when k is odd.

fn psr_chain_mirror (
psr: PsrState
, 
plane_normal: vec3<f32>
) -> PsrState

psr_environment_miss

#
fn psr_environment_miss (
pixel_id: vec2<u32>
, 
primary_wo: vec3<f32>
)

replace_primary_surface

#

Primary surface replacement for perfect mirrors. The reflection chain has been followed to its first non-mirror hit; write that surface’s attributes, reflected into the mirror’s virtual space, to the DLSS RR guide buffers so the denoiser treats this pixel as directly seeing it. https://developer.nvidia.com/blog/rendering-perfect-reflections-and-refractions-in-path-traced-games/#primary_surface_replacement

fn replace_primary_surface (
pixel_id: vec2<u32>
, 
psr: PsrState
, 
ray_hit: ResolvedRayHitFull
, 
primary_material: ResolvedMaterial
, 
primary_world_position: vec3<f32>
, 
primary_normal: vec3<f32>
, 
primary_wo: vec3<f32>
, 
primary_F_ab: vec2<f32>
)

primary_surface_glossy

#
fn primary_surface_glossy (
material: ResolvedMaterial
) -> bool

is_delta_mirror

#
fn is_delta_mirror (
material: ResolvedMaterial
) -> bool

specular_fraction

#

Share of a surface’s total reflectance that leaves through the specular lobe, in 0..1.

fn specular_fraction (
material: ResolvedMaterial
, 
F_ab: vec2<f32>
) -> f32

psr_bounce_reflectance

#
fn psr_bounce_reflectance (
wo: vec3<f32>
, 
wi: vec3<f32>
, 
normal: vec3<f32>
, 
material: ResolvedMaterial
, 
F_ab: vec2<f32>
, 
delta: bool
) -> vec3<f32>

reflector_curvature

#

Angle, in radians, that the shading normal changes over one pixel in screen space.

fn reflector_curvature (
pixel_id: vec2<u32>
, 
normal: vec3<f32>
) -> f32

load_gbuffer_normal

#
fn load_gbuffer_normal (
pixel_id: vec2<u32>
) -> vec3<f32>

apply_mirror_chain

#
fn apply_mirror_chain (
psr: PsrState
, 
v: vec3<f32>
) -> vec3<f32>

mirror_chain_rotor

#

The rotation half of H(n) * F at even parity, or of F * H(n) at odd, where H(n) is the Householder reflection about plane_normal and F the fixed z-axis one.

fn mirror_chain_rotor (
plane_normal: vec3<f32>
, 
parity_odd: bool
) -> vec4<f32>

quaternion_multiply

#
fn quaternion_multiply (
a: vec4<f32>
, 
b: vec4<f32>
) -> vec4<f32>

calculate_motion_vector

#
fn calculate_motion_vector (
world_position: vec3<f32>
, 
previous_world_position: vec3<f32>
) -> vec2<f32>

env_brdf_approx2

#
fn env_brdf_approx2 (
specular_color: vec3<f32>
, 
alpha: f32
, 
N: vec3<f32>
, 
V: vec3<f32>
) -> vec3<f32>
Contents