One executable, fourteen scenes and a joypad
Polar Bear Alert is Kaleido's party version from the summer of 2004 (the release.nfo ends with
“can i go home now?”). It runs on the same “pompom” engine as Harry Boterham, Bi-Won and miChera:
default.xbe embeds Python 2.2, runs d:\demos\demo\pompom.py, and the script wires
C++ effect classes into a graph that a scheduler draws at 50 Hz.
As in miChera, the timing comes from recorded_events, a joypad performance played in against the
music and replayed by the engine. This time it is much busier: 6,338 records, 129 presses of a single button
named taptap, and ten different event names that switch cameras, grow ribbons, deform meshes and
kick blurs. Below the player you can read the executable, scrub the schedule, and open up any frame to see
the effect graph that made it.
- Linked
- 23 Jul 2004
- Xbox SDK
- XDK 5849
- Show length
- 2:40
- Recorded events
- 6,338
The show, end to end
- Loading
default.xbe(title “Kaleido Demoplayer”) showsdata\demoplayer\loading.jpgwhile Python starts and the scenes decompress. About 2.9 s on the capture. - pompom.pyThe scheduler runs 156.5 seconds of jobs: the logo, the box shaft, the bear signs, the sweep, the exploding shards, the ship, the glass spheres, the city and the kaleidoscope, then the logo again.
- end.pngOnce no job is left the player shows
end.png, “the end, made with pompom”, untilmusic.wmaruns out half a second later.
Where the bytes go
default.xbe is 2,797,568 bytes, linked on 23 July 2004 at 23:55 UTC, the day the release files are dated. Half of it is Microsoft's: the XDK libraries each get a section of their own. Hover or tab through the map to see what each part is. The strip under it zooms into .text and marks the functions this reconstruction was read from.
| Section | On disk | Loaded at | What it is |
|---|---|---|---|
.text | 1,440,124 | 0x11000 | the engine, effect classes, SWIG wrappers, Python 2.2, the C runtime |
.rdata | 171,520 | 0x24cc40 | constants, strings, vtables, the SWIG method table |
.data | 167,928 | 0x276a60 | initialised data (405,924 bytes in memory) |
DSOUND D3D D3DX XGRPH | 573,160 | XDK sound and graphics | |
WMADEC XMV XPP DOLBY | 339,184 | XDK codecs; WMA plays music.wma, XMV is linked but unused | |
$$XTIMAGE | 67,584 | 0x2e0da0 | the dashboard tile, shown on the start screen above |
Libraries: XAPILIB, DSOUND, XBOXKRNL, LIBCPMT, LIBCMT, D3D8, D3DX8, XGRAPHC, XKBD and XMV, all 1.0.5849. The debug path is d:\newcode2\trunk\demoplayer\scripts\Release\demoplayer.exe, the same tree miChera's demoplayer was built from five weeks later. script/demoscript.py is the SWIG proxy: 1,165 wrapped functions over 77 classes, from Add and Blur to HypnoTunnel, Flocking and XMVPlayer.
The effects the script uses
Every effect is a node with its own 640×480 render target. A node renders its inputs first and caches its output for the frame, so a node shared by two consumers is drawn once. Each class below was read from its render function and reimplemented in js/fxrender.js.
| Class | Render | What it does |
|---|---|---|
Scene | 0x6c3e0 | Clears, copies its in input if one is connected, then draws a 3ds Max export with its own vertex programs. Other inputs become textures named input_a.png. |
Blender | 0x659b0 | A luma-keyed crossfade: the blend image's brightness against the scheduler's mix decides, per pixel, whether a or b shows. |
Blur | 0x660d0 | Downsamples to 320×240 and 160×120 with a spread-sized kernel and mixes back, additively for refBlur. |
Over | 0x6edb0 | a over b, masked by a's alpha times map's, with a solid fill tinting a. |
Multiply | 0x705f0 | a × b. Its constructor names it “Mulitply”. |
MotionBlur | 0x72980 | A target that is never cleared: each frame it becomes 90% of itself plus 10% of the input. |
Distort | 0x89210 | Shifts each scanline sideways by a random amount. At an amount of 0.1 or below it is a plain copy. |
Ripple2 | 0x837f0 | Warps a 40×40 grid around four moving points. The amplitude, waves and scroll fields exist but the shader ignores them. |
VintageNoise | 0x73f60 | Copies its input and adds a random dust sprite (30% of frames) and one vertical scratch. |
MSSweep | 0x78b70 | Marching squares over a moving field, then the contour lathed around a scene object into a star-shaped solid, subtracted from the picture. |
IsoParticles | 0x85c40 | 4,000 fixed point sprites whose size is the field value of three moving metaballs. No surface is ever built. |
Bitmap, Image, ImageSeq | 0x70da0 | A Bitmap draws nothing and hands out its texture. ImageSeq copies its input and draws its images; until the first next() it outputs nothing. |
Every slider is a FixedSlider, updated by 0x645b0: the value eases towards a target, and the target eases back towards a fixed point, both with per-frame damping. Blur, Over and Multiply update their sliders on every render call, before the frame cache is checked. A node that is rendered twice in a frame therefore moves twice as fast, and the ship's small flicker from 64 s comes from exactly that.
No sync track: a recorded joypad
recorded_events (181,452 bytes) holds 6,338 serialised pompom::Event records, in the same format as miChera's: f32 time, i32 channel, i32 state (0 down, 2 analog, 1 up), f32 value, f32 1.0, i32 button and a length-prefixed name. Only one addMapping line is live in the script (button A as logo). The other names were stored while recording with other mappings, and the script listens for them anyway.
| Button | Name | Presses | When | What the script does |
|---|---|---|---|---|
| A | logo | 11 | 1.5–154.9 s | shows the next logo image, distorts and unblurs it |
| A | taptap | 129 | 9.6–79.5 s | grows a box-shaft ribbon and blacks the boxes; kicks the bear signs |
| A | reset1 | 14 | 11.0–137.9 s | restarts scene clocks; cycles the box-shaft camera |
| A | bass | 30 | 35.3–92.1 s | next tunnel camera; deforms and blackens the glass sphere |
| A | sweep | 14 | 35.9–45.3 s | reshapes the sweep and flashes it; next sweep camera |
| A | snare | 39 | 38.1–79.5 s | blur kick on the shards; jolts the ship's clock |
| A | deform | 17 | 97.0–112.2 s | noise on four city objects |
| B | next | 7 | 98.5–111.6 s | cuts the city camera |
| A | kaleido | 24 | 114.7–144.3 s | springs the kaleidoscope's curves to random lengths |
| B | reset2 | 2 | 131.4, 144.7 s | restarts the kaleidoscope's clock |
| 2, 4, 5, 6 | – | 8 | 2,309 records, mostly analog; nothing reads them |
The script also listens for butB, butA_ and reset, which never occur. So the shards never flash black, the sweep never shrinks to its thin form, and the 3dkaleido clock never restarts.
The score
pompom.py ends with a list of jobs: a node, a slot, a start and a duration. The scheduler (0x5a0e0) draws the first active job of each slot. SI_MIX crossfades SI_A and SI_B and only does so while both have a job, which is why some transition jobs (outlined) never show. SI_POST and SI_SUPER are plugged into whatever comes before them. Under the slots are the recorded presses. The white line follows the player; click anywhere to jump the player there and open that frame in the inspector below.
t = –
Inside one frame
This runs a second copy of the simulation and renderer, so the player above is left alone. It steps to the chosen frame and then shows every node that frame draws, starting at the screen and walking back through the inputs. Each card is that node's own render target, with its slot, its live slider values and what is plugged into it.
A scene with effects attached lists them under its inputs (effect ← MSSweep); they draw into the scene's own target. Stepping backwards restarts the simulation from 0, because sliders and motion blur carry state from frame to frame.
The fourteen scenes, up close
The .lzma files are LZMA-packed 3ds Max exports: meshes, keyframed cameras and lights, splines, and vertex programs per material. Here they are drawn with the demo's own shaders and draw order but with a camera you control. Drag to orbit, scroll or pinch to zoom, double-click to reframe, or pick one of the scene's cameras. Ribbons draws every spline at full length; untick it to see the scene as the engine loads it.
Effects attached to a scene (the sweep, the iso particles) and input textures are left out of the viewer; an input_a.png stage shows white.
What is on the disc
demos/demo holds 47 files, 9 MB. Besides pompom.py itself, 28 of them reach the screen or the speakers. The rest are drafts, leftovers and scenes from a longer cut.

backdrop1.png behind the tunnel
backdrop3.png behind the shards
tiling2.png, rippled behind the ship
noisemap.tga, Over's mask on the shards
polarbear.png, the logo
kaleido.png, the end logo
dust1–4.tga, VintageNoise's dust
film1.png, loaded, never drawn| Status | Files |
|---|---|
| Drawn | 14 scenes (see above), backdrop1/3, tiling2, noisemap.tga, polarbear, kaleido, dust1–4.tga, line.tga, particle.png, music.wma, recorded_events |
| Loaded, never scheduled | flock.lzma with a Flocking effect over backdrop2.png, bot2.lzma, lafglow.lzma (behind a glowAdder), film1.png as an additive exposure, a Gamma |
| Only in commented-out code | test.lzma, transsphere.lzma, nog_een_kaleidoscope.lzma (“yet another kaleidoscope”), countdown.xmv |
| Never referenced | bendsplines.pck.lzma, curvegrow.lzma, moremotion.ase.pck.lzma, particles.lzma, tunnel2.lzma, tiling1.png, facemap.png, facemap2.png, noise.png |
| Missing | greebleball_2.lzma, named only inside a string block the author labelled “#Lelijke kak” (ugly crap) |
Checked against a capture of the original
The capture (720×576 PAL MPEG-2, 2:47) runs from the loading screen to past the end. Each pair below is the capture on the left and this reconstruction on the right at the same demo time.

reset1 at 11.0 s, next between 98.5 and 103 s, reset2 at 131.4 and 144.7 s. All of them line up at the same offset, so the demo clock runs at 1:1 with the capture.| Loading | loading.jpg is on screen for the first 3.24 s of the stream. The demo's first frames are black, so the loading picture appears to linger over them. |
|---|---|
| Flicker | The ship's white fill varies by about ±10 levels from frame to frame on the capture. The reconstruction gets the same only when Over's slider is updated on every render call, and Over is rendered twice per frame there. |
| Glass | GeoSphere01's second texture stage is a reflection lookup bound to an empty !DUMMY! slot. Treating it as white turned the sphere into a white blob; the capture shows only its teal tiling2 diffuse, so here an empty stage adds nothing. |
| Randomness | Ribbon lengths, sign sizes, sweep shapes and dust come from frand and the CRT rand(). Their seeds can't be recovered, so those details differ while the timing matches. |
Odds and ends
- A mesh kaleidoscope.
2dkaleido.lzmais a flat disc whose texture coordinates fold one wedge into twelve mirrored segments. The kaleidoscope is geometry; the curves scene is only its texture. - “HACK THIS WAS NEEDED FOR POLAR BEAR ALERT”.
lib/util.pygives SimpleScene a transforms list just so the road's 20 signs can jump in size ontaptap. - Point sprites as a mask. The iso particles are never seen directly. They are the mask of
transBlend, so the 23–26 s transition dissolves through moving blobs. - Subtractive sweep.
setBlendMode(1)on the MSSweep makes it reverse-subtract, so a bright star cuts a dark hole through the tunnel. - Untouched objects.
CustomFlocking, a flock scene, a second bot scene and an exposure sequence are set up near the top of the script and never scheduled. They look like a section that was cut for the party. - Seeded randomness.
frandis replaced by an MSVC-style LCG with a fixed seed, so the reconstruction is the same on every run and can seek.
Method
Static analysis only. default.xbe was parsed with tools/xbeinfo.py and disassembled with Capstone. Behaviour was read from the code: the scheduler, FixedSlider, Scene render, and the render functions of every effect the script uses. The Python side is a port of pompom.py and lib/util.py (js/sim.js, js/fx.js). The scene format and its NV2A vertex programs were decoded from the files (js/scene.js, js/sceneshader.js). Timing comes from frame-by-frame comparison with the capture.
Keys: space pause, ←/→ 5 s, R restart, L 640×480. URL options: ?skip starts at the demo, ?t= freezes at a demo time, ?show= at a show time, ?seed= changes the random seed.