← All posts
Devlog · Sergej Klementinovski

Textured triangles at full frame rate

Since 9 October, Aura draws textured, animated triangles itself: 20,160 in every frame at 1080p and 60 Hz, with every frame checked against the reference.

Kromi One is built for modern 2D and 2.5D games. 2D is sprites, layers and scrolling, and the chipset already does all of that. 2.5D needs one more thing: triangles. A floor that runs into the distance in perspective, a character whose arms and legs bend at the joints, an isometric town seen from above: all of them are textured triangles. Since 9 October, our chipset Aura draws them itself, every frame, at 1080p and 60 Hz.

A forest scene in perspective with trees, bushes and walking characters, at 1920 × 1080 The showcase scene as the KV260 sends it to the monitor: a floor in perspective, 200 trees, bushes and posts, and eight walking characters, each a mesh of 2,264 triangles moved by 16 bones.

20,160 triangles, 60 Hz, 9.9 ms engine time, 1.27 ms of KROM's time per frame

Who does what

Three parts of the machine share the work, and each does what it is best at.

  • The program describes a mesh: its points, the triangles between them, its texture and up to 64 bones, each a small matrix that says how one part of the body moves. It hands the whole mesh over with one command.
  • KROM, our firmware, checks that command, as it checks every request, and passes it on to the chipset.
  • Klara, Aura’s drawing engine in the FPGA, bends every point by its bones, projects it into the picture and draws the triangles in order, back to front, textured like everything else it draws.

That division is why the processor stays free for the game. In the showcase scene, three of the four ARM cores work out the bones for the next frame while the fourth builds the current one. KROM’s own work for the whole scene, all 20,160 triangles, is 1.27 ms per frame. Aura needs 9.9 ms of the 16.7 ms a frame lasts at 60 Hz, so there is room left in every frame.

Exact, not approximately right

On most graphics hardware, close enough is the standard: the same scene may come out slightly different on another chip or driver, and nobody minds. We do. A triangle on Kromi One is drawn the same way in four places: in KROM’s reference renderer written in C, in the emulator, in the simulation of the chipset’s hardware and on the board itself. They must agree on every byte.

The board proves it while it runs. The display computes a checksum of every frame it sends to the screen, and we compare it with the reference. In the board run of the showcase scene, 1,799 frames were checked: none different, none late. A frame that is wrong by a single pixel fails.

This matters for anyone who makes something for the machine. What you see in the emulator on your laptop is exactly what the machine will show, down to the last pixel.

What it cost

Triangles weren’t free. Klara grew a skinning stage, which bends the points by their bones, and a path for drawing triangles. The chipset now uses 67.5 % of the FPGA’s logic. We keep it below 70 %, so the features still to come have to be economical.

For programs, the triangles are an addition and nothing else. They arrived as the 16th revision of KROM’s contract with programs, and like every revision before it, it only adds: a program written for an earlier revision runs unchanged.

What’s next

Next in the chipset are raster lists, our take on the Amiga’s Copper, for changing the picture line by line; tile maps for large scrolling worlds; and lighting. And on the same board, KromiOS, our operating system, has started running. More about that next week.

If you want to hear when the next post is out, join the list. We write about once a month, and first when the developer edition opens.

Older post Remake or new machine? Kromi One next to MiSTer, MEGA65 and the Commander X16
Follow Kromi One

We'll email you when the developer edition is public and when the crowdfunding campaign opens.

You'll get one email to confirm your address. Unsubscribe any time. See our privacy policy.

Thanks for signing up