RasterCore
Ready to execute

Hardware Heritage

The 3D starfield is the original "Hello World" of spatial graphics. By projecting three-dimensional points onto a two-dimensional screen using simple division by depth (Z), programmers taught a generation how to create the illusion of infinite space, long before hardware-accelerated 3D was a reality.

PC Screensaver

The "Starfield" became the symbol of PC computing in the 90s. It demonstrated the PC's ability to handle simple 3D math (perspective projection) across hundreds of points using raw integer math.

Amiga Parallax

Amiga starfields often used multiple hardware layers or sprites moving at different speeds (parallax) rather than true 3D projection, resulting in a smoother but distinct "2D+" look.

Perspective

The formula X' = X/Z is the core of this effect. It taught a generation of programmers how to map 3D coordinates to a 2D screen.

3D Starfield

The original Hello World of 3D graphics.

Legacy BASIC/C

for(i=0; i < NUM_STARS; i++) {
  stars[i].z -= speed;
  if(stars[i].z <= 0) {
    stars[i].z = MAX_Z;
    stars[i].x = random(-100, 100);
  }
  // Perspective Projection
  sx = (stars[i].x << 8) / stars[i].z + 160;
  sy = (stars[i].y << 8) / stars[i].z + 100;
  Plot(sx, sy, WHITE);
}

Modern GLSL

float StarLayer(vec2 uv) {
  vec2 gv = fract(uv) - 0.5;
  vec2 id = floor(uv);
  float n = hash(id);
  float d = length(gv - (vec2(n, fract(n*34.0))-0.5)*0.8);
  return smoothstep(0.05, 0.0, d);
}