Skip to content

Documentation: ReSTIR Depth Modifier

Essentuan edited this page Mar 28, 2026 · 1 revision

ReSTIR Depth Modifier (since v0.3.1)

/photonics/modifiers/restir_denoiser_depth_fetch_modifier.glsl

Controls the texel restir uses for depth in its denoiser. Disabled using PH_RESTIR_DENOISER_DEPTH_FETCH_MODIFIER_DISABLED.

The default implementation will handle most cases, but doesn't work if Photonics is rendering at a different resolution compared to the rest of the game.

Usage:

// This example is for when you have a setting to control photonics's render scale independantly from the game.
ivec2 modify_denoiser_depth_fetch(ivec2 texel) {
    const float render_factor = 1f / PHOTONICS_RENDER_SCALE;

    return ivec2(texel * render_factor + 0.5);
}

Clone this wiki locally