The PowerVR build races
2026-10-24, evening.

This afternoon the stand-in for PowerVR's SGL library (the entry before) drew a test scene and the game's main menu, and then Wine on the Mac stopped. The user then asked for a proper renderer, and gave this work the emulated PC.
Light volumes, as the chip drew them
SGL can describe a solid as the space inside a set of planes. POD uses that for one thing: each car's headlight beam is a cone of 40 planes and a cap, a light volume that adds light wherever it meets a surface.
The first try built the cone as triangles and counted its faces in the stencil buffer. The faces met at the cone's tip only nearly, and the count went wrong along every seam:

The PowerVR chip never drew triangles for these objects. It tested each pixel against the planes. So the stand-in now does the same: it rebuilds each pixel's position from the depth buffer and adds the light where that point is inside every plane. The result has no seams:

One more thing came from the game's own order of calls. POD asks for the light volume, then makes the transform that places it, then adds the planes. The volume must therefore sit where its first plane goes, or it would never follow its car.
The first race
In the emulated PC the build went where the Mac could not: through the menus, where the track map and the car on the car screen are already SGL scenes, and into a race:


Two things were wrong. The sky was flat white: its material switches off every lighting term for its texture, which in SGL must mean "show the picture as it is". And the player's car was a black shape.
Why the cars were black
A trace stops after a few calls of each kind, so the stand-in learnt to write its whole scene graph to a text file on request. The dump answered it: POD gives its cars an ambient material of 0.01, so they are lit almost only by a lamp in each car's group. That lamp is a narrow spot at (0, 0, 0) pointing along +z. Placed by the transforms above it, it sat at the world's origin, far from every car.
SGL has a separate call to position a light, and POD never calls it. A light nobody places is the viewer's own lamp, at the camera and pointing where it looks. Placed that way, the cars come out lit and textured:


An emulated PC out of memory
Midway the emulated PC stopped answering. Its log said it was out of memory. The stand-in had a queue to its drawing thread with no limit, and in software OpenGL the game sent pictures faster than they were drawn, at 1.2 MB each. The queue now keeps only the latest frame and picture. The user had the emulated PC restarted and two other projects' idle virtual machines stopped, to get the memory back.
Where it stands
The stand-in now lives in GameFrame, as wrappers/sgl, beside the other card libraries. POD stages it from there. run/vm/pvr-race.sh drives the menus to a race. Still guesses until someone compares a real PowerVR card's picture: the fog formula, how bright the car lamps were, and how strongly a headlight beam lights the road.