Starfields

Version 6 of 6

Layered hash stars.

GPU · GLSL · today

This version

Twelve layers of procedurally placed, twinkling, coloured stars, zooming through each other over a faint nebula, infinite, with no star list.

How this version works

This shader runs at three-quarter scale and combines twelve procedural star layers over a rotating view. A sine-based hash determines star positions, sizes and warm-to-cool colours, with each pixel checking a 3×3 neighbourhood of grid cells. Cycling depth changes each layer's scale from 20 to 0.6, while fading hides its return to the start of the cycle. Stars use soft distance-based profiles and individually phased twinkling, with a faint purple nebula added from broad sine patterns.

The trick in this version

Grid hashes regenerate the same stars wherever needed, so no star list or persistent image buffer is required. Neighbour-cell sampling includes stars whose glow extends across cell boundaries, while reduced rendering scale limits the cost of evaluating all twelve layers.

Historical context · GPU

  1. 2022 · ColorauGuiyino

    Star Nest in an engine

    The shader becomes a reusable engine component, with the advice to render it downscaled because it is so expensive.

  2. 2013 · Pablo Andrioli (Kali)

    Star Nest

    No points at all: a volumetric fractal that reads as stars and nebulae. A descendant of the starfield rather than the same algorithm.

  3. 2013 · Morgan McGuire

    A starfield shader for games

    A performance-engineered adaptation renders procedural parallax at 3.7 ms per 1080p frame by working at reduced resolution and upsampling.

Platform
GPU · GLSL
Era
GPU
Rendered on
GPU
Tags
procedural · parallax
Sources
Star Nest in an engine (2022)Star Nest (2013)