Bjoer / Demoscene anatomy / The rendering language

Many little sprites.
One luminous surface.

Bjoer's soft lines are built by placing small intensity textures along sampled paths. Their overlap builds brightness. A second, indexed composition stage lets the background participate in the final color of each pixel.

32 × 32 sprite sampling6-bit accumulated intensity256 × 256 color lookup

Separate the ingredients

Illustration, not an intro frame. The background and sprite shape here are deliberately simplified.

1. A sprite is a brightness footprint

Instead of drawing a continuous thick line, place a small soft texture at each projected curve sample. Its center contributes more intensity than its edge. A zero texel contributes nothing, so the surrounding rectangle disappears.

The rasterizer samples a texture with 32 samples per row, using 16.16 fixed-point coordinates and nearest-neighbor sampling. Scaling the footprint with depth makes the curves feel three-dimensional.

2. Overlap adds light

sum = (destination + spriteTexel) & 255
destination = min(sum, 63)

This is the byte arithmetic in the translated rasterizer. For normal 0–63 intensities, it behaves as saturated addition: 20 + 15 → 35, 50 + 20 → 63. Multiple stamps merge into a smooth bright ridge. It does not average the source and destination with an alpha coefficient.

3. Two buffers choose one palette index

The presentation loop at 0x141ee reads a byte from each of two buffers. Those two bytes become a 16-bit address into a 65,536-byte lookup table:

a = foreground[pixel]
b = secondary[pixel]
index = lookup[(a << 8) | b]
RGB = palette[index]

The loop writes 64,000 indexed pixels: a 320 × 200 image. The table's pointer is stored at 0x42160; the secondary buffer pointer is at 0x42158. Both inputs matter to the output. A palette index is a color label, not an RGB brightness value.

This is how a detailed background can remain visible inside a luminous shape: the combination can select a different palette entry for every background value and every foreground intensity.

Why the star seems to dissolve into the pixels

Think of the star-shaped pattern as spatial information behind the curve. At each screen pixel, the background value and accumulated sprite intensity jointly choose the displayed color. As the soft footprint changes, that choice moves through discrete colors. The pattern can therefore show through, brighten, or lose contrast in the strongest parts of the glow.

The gritty transition comes from small indexed pixels, finite intensity levels, texture sampling and palette selection. It should not be described as a browser opacity layer or assumed to be random dithering.

The two-buffer lookup is verified in the translated code. This page does not claim an exact equation for generating the original star pattern, nor a universal alpha value: that would require tracing its producer and the scene's table contents. The interactive illustration uses a simple analytic star and an explicit illustrative color mix, not the original lookup table.

Why this technique was economical

The same small texture can shade many curves and objects. Geometry determines where stamps land; integer pixel operations build their intensity; one table read performs the final two-input composition. At 320 × 200, that produces a rich material-like image without shading a full polygon mesh per pixel. The palette supplies the metallic blue-gray finish.

← See how the cube supplies the sampled paths

Source anchors: rasterize_additive_sprite.cjs (texel addition), sub_141dd.cjs and the 0x141ee loop in geometry_152f6.cjs (two-buffer composition). No captured images are used on this page.