Skip to content

Graphics demo - ray-traced reality simulator

Falling water, wound springs, a train that launches itself

One deterministic SI-unit plant, photographed by a self-contained CPU ray tracer. Water off the aqueduct spins a wheel; the wheel drives a generator, a boiler, a steam motor, an air compressor and a bank of spring winders; the winders load swappable cartridges that fling a train up an elevated ramp and around the depot loop - then the depot catches the spent cartridge, sorts it, rewinds it and reloads. Nothing is hand-animated: every wheel angle, gauge needle and steam plume is a pure function of the simulation clock, and a global energy ledger proves there is no free energy anywhere in the hall.

Ray-traced Grand Power Rail Hall in golden-hour light: the water wheel turns under the aqueduct, gears and winders spin, the boiler glows, and the train waits by the launch ramp - HUD ledger burned along the bottom.

Cinematic beauty pass - 190 frames, golden-hour sun shafts through the roof trusses, wet-stone reflection, wheel spray, boiler glow and the honest horizontally-flipped mirror inspection panel. Sun shadows are computed as missing light per occluder, never painted black.

Six passes over the same 600-second mission

Live four-view composite: HALL, ROUTE, DEPOT and GAUGES panels captured during a timed autopilot run, with measured fps and the energy-ledger residual burned into the HUD.
Live four-view playthrough

Captured DURING a timed autopilot run at a measured 259 fps - HALL, ROUTE, DEPOT and GAUGES side by side, fps and ledger residual burned into every frame. Encoding runs strictly after the run, so what you see is the plant playing itself in real time.

Debug route pass: the train's side-view profile with a force decomposition - drive vs traction cap, rolling resistance, drag and slope - plus boost, wheel slip and ramp-exit speed against the ideal.
Route + force decomposition

Ramp launch, the +4.5% hill that defeats the springs alone until the air boost engages, the oil patch (mu = 0.013) that forces real wheel slip, and a dead-stop station restart. Ramp exit clocks 6.92 m/s against the ideal sqrt(2gh) = 7.14 m/s - about 94% efficient.

Debug mechanical + electrical pass: flow, water and shaft power, torque bars, RPM, gear ratio, generator volts/amps/watts, battery state, converter loss, block store and the running energy ledger.
Mechanical + electrical

~19.5 kW of hydraulic input becomes ~8.1 kW at the shaft after wheel and gear losses; the 12/96 gearbox spins the machine bus x8. Add electrical load and generator back-torque provably slows the wheel (Lenz). Blocks lift to 11.8 m, banking ~231 kJ as E = mgh.

Debug steam + air pass: water temperature, steam mass, boiler pressure, hoop stress, safety factor, relief-valve state, piston force, crank torque and air-tank pressure and energy.
Steam + air pressure

The boiler reaches the real 373.124 K (from the 1.7 water-phase tables), then latent heat; the relief valve caps steam at ~909 kPa against a 900 kPa setpoint. The air tank fills to ~1.10 MPa and its motor torque falls honestly from ~410 N to ~6 N as the tank drains.

Debug burst demo: the relief valve is welded shut and the firebox is forced, so hoop stress climbs past the ultimate strength and the boiler bursts - shown, not faked, with the burst energy booked to the loss ledger.
Boiler burst - shown, not faked

Weld the relief valve shut and keep firing: hoop stress Pr/t climbs, the safety factor drops below 1, sigma passes the 400 MPa ultimate, and the boiler BURSTS. The burst energy is booked straight to the loss ledger - the model never simply deletes it.

Built on the locked oracle

Pure C# on net10.0, warnings as errors, BCL-only. Depends only on OnlyCSharp 1.7 leaves: the GIF encoder, PCG32 RNG, CODATA 2022 constants, and the IAPWS water-phase / specific-heat tables. No NuGet, no external assets.

48 / 48

physics-invariant self-test checks pass

0.0000%

ledger residual over 11.31 MJ in

One energy ledger, no free lunch

StageWhat the sim proves (the same across every pass)
Water to shaft A jet at head H gives v = sqrt(2gH) and momentum thrust F = m-dot * dv on the wheel buckets; measured wheel efficiency is ~0.94. The flywheel stores E = 1/2 I w^2 and bleeds it back through bearing drag.
Shaft to electricity ~223 V, ~27 A, ~6.0 kW at the generator; back-torque tau = k_e * I is a real reflected load, so a heavier draw measurably slows the wheel. The battery charges lossy and discharges lossy, clamped to state-of-charge in [0, 1].
Heat to steam to motion Radiant heater Q = e*sigma*A*(T_h^4 - T_c^4) boils a small monotube; ideal-gas P = m*R_s*T/V drives quartered twin pistons F = dP*A, whose crank feeds an isothermal air compressor.
Springs to a moving train Cartridges store E = 1/2 k*theta^2 up to ~40 kJ; a governor clamps the safe wind (turn it off and the spring over-winds and fails). The exchange is a 14-state machine - eject, chute, sort, rewind, queue, insert - that never teleports and keeps the cartridge count at exactly 6.
Global ledger Over a 600 s mission: in 11.31 MJ = stored 1.88 MJ + losses 9.43 MJ, with a maximum residual of 0.00 J. Useful rail work ~154 kJ, block-lift work ~122 kJ. Energy is conserved to floating point.
water / hydraulic firebox / flame steam plume electrical / spring energy

How it renders

Ray traced

Recursive closest-hit shader with per-light shadow rays, Fresnel reflection and Snell refraction, Beer-Lambert glass and water on the sight gauges.

3 lights

Golden-hour key sun, a cool skylight fill and the firebox point light - whose colour is the real Planck blackbody of the element's simulated temperature.

320 x 240

Every clip steps the same deterministic sim under the autopilot and photographs it - the debug panels read straight off the physics snapshot.

~7.8 s

to render the whole six-GIF evidence set on this machine; the live loop benches ~259 fps on 32 cores.

Solids are ray-traced, so shadows are a visibility question and never painted. Steam, flame, water glow and the gauge needles are additive world-space overlays projected on top of the traced solids - they annotate the physics, they never fake the lighting. The mirror inspection panel is an honest horizontally-flipped pixel copy of the scene, not a second render.