Skip to main content

Crate threers_probe

Crate threers_probe 

Source
Expand description

Screen-space neural GI from a G-buffer and a lighting probe.

The path tracer is the teacher. At inference the network sees first-hit albedo, normal and depth, a multi-bounce lighting probe, quarter-res probe context, DDGI-lite world bins, and encoded hit positions. Heads: Direct irradiance residual, 7×7 kernel gather, hybrid (KPN + capped residual), hops (à-trous light jumps + world-grid teleport), plus an optional NRC-style 1×1 MLP for per-pixel world residuals. The training family includes jittered furnace-like shells so hops learn uniform-bright identity.

Built from conv2d / relu / concat / a fixed 2× pool, so the same graph trains on Metal or CUDA and runs on the CPU the browser already has.

Re-exports§

pub use dataset::Dataset;
pub use ddgi::bounds_from_world;
pub use ddgi::encode_frame;
pub use ddgi::encode_world_planes;
pub use ddgi::DdgiContext;
pub use ddgi::DDGI_GRID;
pub use ddgi::DDGI_GRID_Y;
pub use ddgi::DDGI_VIS_PLANE;
pub use infer::ProbeGi;
pub use infer::ProbeNet;
pub use model::init_params;
pub use model::Head;
pub use model::ProbeArch;
pub use model::Widths;
pub use model::ALBEDO_FLOOR;
pub use model::GRAPH_ROOM_TINT;
pub use model::HOPS_IRRADIANCE_CAP;
pub use model::HYBRID_IRRADIANCE_CAP;
pub use model::IN_CHANNELS;
pub use model::OUT_CHANNELS;
pub use nrc::fuse_beauty;
pub use nrc::fuse_beauty_with;
pub use nrc::init_params as init_nrc_params;
pub use nrc::load_nrc;
pub use nrc::load_nrc_bytes;
pub use nrc::mean_albedo;
pub use nrc::nrc_apply_mask;
pub use nrc::nrc_eligible;
pub use nrc::nrc_features;
pub use nrc::nrc_input_channels;
pub use nrc::pack_nrc_batch;
pub use nrc::pack_nrc_batch_with;
pub use nrc::probe_colour_relative_sq;
pub use nrc::save_nrc;
pub use nrc::train_nrc;
pub use nrc::train_nrc_dataset;
pub use nrc::train_nrc_from;
pub use nrc::NrcArch;
pub use nrc::NrcNet;
pub use nrc::HOPS_NRC_CAP;
pub use nrc::HOPS_NRC_PROBE_CONFIDENCE;
pub use nrc::NRC_CAP;
pub use nrc::NRC_IN;
pub use nrc::NRC_IN_DDGI;
pub use nrc::NRC_MAX_PROBE;
pub use nrc::NRC_MIN_ALBEDO;
pub use nrc::NRC_OUT;
pub use nrc::NRC_PROBE_CONFIDENCE;
pub use pack::colour_planes;
pub use pack::geometry_hits;
pub use pack::planes;
pub use pack::PlaneExtras;
pub use pack::DEPTH_PLANE;
pub use pack::SKY_DEPTH_COMPRESSED;
pub use train::Batch;
pub use train::TrainConfig;
pub use train::Trainer;
pub use train::GI_LOSS_BOOST;
pub use train::HOPS_CHROMA_LOSS_BOOST;
pub use train::HOPS_GI_LOSS_BOOST;
pub use train::HOPS_NEUTRAL_LOSS_BOOST;
pub use train::LOSS_EPSILON;
pub use train::TRAIN_EPSILON;

Modules§

checkpoint
Trained weights on disk.
dataset
Training tiles on disk.
ddgi
DDGI-lite: bin probe radiance into a coarse world-space grid, then broadcast each cell back to every pixel that falls in it — cheap distant context without extra rays.
infer
Running a trained network: forward graph only.
live_cornell
Browser-side Cornell box: first-hit G-buffer + a cheap multi-bounce probe.
model
A guided reconstructor: probe + G-buffer + demodulated irradiance in, reconstructed colour out.
nrc
NRC-style tiny MLP: per-pixel world features → irradiance residual.
pack
Pack probe + G-buffer + reference into the planar layout the network reads.
train
Training: relative L2, autodiff, Adam.

Functions§

compress
Compress unbounded radiance into [0, 1) for the convolution stack.
expand
Inverse of compress. Values at 1 (compressed infinity) stay large rather than dividing by zero.
preferred_device
The device this crate actually trains and infers on.