Stochastic Perceptual Rendering
One-Line Pitch
Instead of rendering objects, render the likelihood of objects — and only where the observer needs them.
The Spark — Simulating Atoms in C++
A YouTuber named kavan simulated atoms in C++ by abandoning meshes entirely. Instead of drawing an electron's orbit, he sampled the Schrödinger equation's probability distribution — placing 100,000 dots where the electron could be. The orbital shape emerged from density alone. No polygons. No edges. No approximation pretending to be truth. Just truth presented as probability.
That's a primitive. Not a rendering trick — a way of thinking about what "accurate" means.
The world is obsessed with deterministic rendering: "this pixel IS this color." That's a lie at every level — the GPU approximated the lighting, baked the shadows, compressed the texture, skipped the global illumination. The result is 100% confident and maybe 50% correct.
SPR inverts this: 99.9% correct and honest about being probabilistic.
The Core Idea
Everything renderable is a probability distribution. A solid wall is a distribution where $P(\text{material here}) = 0.9999$. Fog is a Gaussian falloff. A distant mountain is a low-sample distribution that resolves as you approach. An electron orbital is exactly what the Schrödinger equation says it is.
Instead of rasterizing triangles, you sample distributions and let density create the image.
The Five Properties
1. Sample Budget, Not Polygon Budget You have N samples per frame. You don't spread them evenly — you spend them where they matter. Foveal center gets dense sampling. Periphery gets sparse. Behind you gets nothing. The budget is constant; the allocation is intelligent.
2. CDF Sampling Replaces Rasterization Instead of "draw this triangle," the instruction is "sample this distribution." Objects exist on a certainty spectrum:
|-- Pure SPR (fog, dust, glow) --|-- Hybrid (distant) --|-- Pure Raster (walls) --|
P = smooth Gaussian P = steep sigmoid P = step function
Triangles ARE the degenerate case of SPR where uncertainty = 0. Rasterization and SPR are the same primitive at different points on the certainty spectrum.
3. Temporal Accumulation = Free Convergence Each frame samples differently. Over 3–4 frames, accumulated samples converge toward ground truth. Motion naturally re-samples. Static scenes sharpen for free. The path tracer's philosophy applied to everything.
4. LOD Is Just Sample Density Far away = fewer samples. Close up = more samples. No mesh LOD switching, no pop-in, no texture streaming hiccups. The object gets "more certain" as you approach. That's literally how photons work.
5. Honesty About Uncertainty The renderer knows which regions are under-sampled. It can report confidence. It can say: "I'm 40% sure about this region, want me to spend more samples?" Traditional renderers can never provide this — they pretend every pixel is certain.
How Humans Actually See
SPR doesn't work if applied naively. Human vision is NOT "sharp center, blurry edges." It's three distinct systems:
Foveal Vision (~2° center)
High-acuity color and detail. The reading system. SPR: maximum sample density. Full confidence.
Peripheral Vision (2°–60°+)
NOT blurry — it's specialized. Extremely sensitive to motion, light changes, contrast edges, and color temperature shifts. A completely different processing pipeline tuned for survival.
SPR: Don't low-res it. Preserve the signals peripheral vision is tuned to detect — motion vectors, contrast edges, luminance changes. You can drop 80% of samples in the periphery if you keep those three channels intact. The brain fills in material and detail from memory.
The Known-Behind (~180° rear)
Not rendered at all. The brain maintains a spatial model from memory and audio cues. You "know" the wall is behind you without seeing it.
SPR: Zero visual samples. Maintain a compressed spatial probability map ready to burst into full sampling in <16ms when gaze direction changes.
This isn't "foveated rendering" (resolution scaling). This is perceptual-channel rendering — different information for different parts of the visual field.
You render the rainbow only for one person's eye.
Why "Probably 99.9%" Beats "Definitely 50%"
Every frame in a modern game is: baked lightmaps (wrong for dynamic scenes), screen-space reflections (wrong at edges), simplified shadow cascades (wrong at distance), texture LOD (wrong when you look closely). All confidently wrong.
SPR says: "This pixel is probably #4A7B2E, sampled from the actual light transport equation, and I'll converge closer to truth with each frame."
In a world that's 49% accurate and 100% confident — one point from hubris — we choose to be probably 99.9% accurate and honest about the 0.1%.
This isn't just a rendering philosophy. It's a data philosophy. It's how you think about proof, identity, location, and truth at every scale.
Orbital Dynamics of Attention
Objects don't sit statically on the certainty spectrum. They have orbital dynamics — trajectories through certainty space that the renderer can predict and pre-allocate for.
Every renderable entity has a state vector: $$\vec{O}(t) = \begin{bmatrix} C(t) \ \dot{C}(t) \ \ddot{C}(t) \end{bmatrix}$$
Where $C(t)$ is current certainty, $\dot{C}$ is certainty velocity (approaching = rising, receding = falling), and $\ddot{C}$ is acceleration.
| Orbital Type | What's Happening | SPR Response |
|---|---|---|
| Approaching | You're walking toward it. $\dot{C} > 0$ | Progressive sample allocation, pre-load raster geometry before you arrive |
| Receding | Turning away. $\dot{C} < 0$ | Graceful resource release, geometry compresses back to distribution |
| Slingshot | Head turn. $|\ddot{C}| \gg 0$ | Burst-decompress the target region 2-3 frames ahead of foveal rendering |
| Captured | Known rhythm (NPC patrol, UI pulse) | Pre-allocate at the right phase of the cycle |
Why this eliminates LOD pop: There is no discrete LOD switch. Just 30 frames of continuous certainty tightening — the object was always being rendered, just at increasing density. The system predicted the approach and pre-allocated. By the time it needs to be crisp, it already is.
The Snow Boots Principle
"If you can render quickly in real-time and have the process to assemble a new render from data when needed, then you walk around light — but can plant your feet firmly when you need to."
Traditional rendering carries the full scene at all times. Heavy boots, always.
SPR walks light:
- Moving: Sparse sampling. Motion-accurate periphery. Minimal memory footprint. Fast.
- Stopped/Focused: Temporal accumulation kicks in. Samples pile up. Detail resolves. Full confidence.
- Turning: The Known-Behind bursts into Periphery, then Foveal. Distributions decompress progressively.
Snow boots a sprinter can wear. Light when moving. Grippy when stopped. No penalty for switching — the same system handles both, with different sample budgets.
From Pixels to Fleets
The same primitive scales from rendering a single frame to managing a network of a million nodes.
Stop thinking of a fleet as a list of nodes with states. Think of it as a probability distribution over possible fleet configurations.
At 1M nodes, you cannot know the state of every node — the bandwidth to collect complete telemetry is prohibitive. Every fleet that has scaled to millions (AWS IoT, Azure, Google's device fleet) arrives at the same answer: give up on knowing everything, sample intelligently, act on probability.
SPR says: this isn't a compromise. This is the correct approach. The universe itself works this way.
Random sampling of 1,000 nodes from 1M gives ±3% accuracy at 95% confidence. That's more than enough for fleet management. And it costs 0.1% of the polling traffic.
The fleet IS an orbital. Each node is a sample point. The shape emerges.
Without this thinking: a network hits a wall around 50K–100K devices. Telemetry bandwidth, state management complexity, and operational overhead become prohibitive.
With this thinking: the network scales to millions because fleet state is a distribution (KB, not GB), monitoring is sampling (0.1% of traffic, not 100%), and intelligence is statistical — self-improving rather than brittle.
The Scene As A Certainty Field
$$\text{Scene} = \text{CertaintyField}(\text{position}, \text{time}, \text{observer})$$
| Certainty | Object Type | Rendering |
|---|---|---|
| $P \approx 1.0$ | Hard surface | Rasterize |
| $P \approx 0.3$–$0.9$ | Soft volume | SPR sample |
| $P \approx 0$–$0.3$ | Known but unrendered | Compressed distribution in memory |
| $P = 0$ | Nothing | Skip |
The field is observer-dependent. The same wall is high-certainty when faced, low-certainty when behind you. The wall hasn't changed. Your certainty about it has.
Not triangle replacement. Field-first rendering. And field-first everything else.
Connections
- The Stochastic Gate→ — temporal stacking of noise frames to reveal signal; the same accumulation principle as SPR's temporal convergence
- The Phosphor Gate→ — accessing sub-threshold perceptual territory; the observer-dependent certainty field in the brain
- The Known Fraction→ — the same truth expressed through different system portals; certainty as a spectrum, not a binary
- Krudd (idea:krudd) — SPR applied to language; Fibonacci-structured documents readable from any sample point
- Fog of War (idea:fog-of-war) — SPR applied to reasoning; deliberate uncertainty as a creative tool