Big Bang Expansion 3D
A Volumetric Simulation of Cosmic Evolution

https://github.com/user-attachments/assets/587326e5-2cba-4700-baa9-e916e4c32296
Big Bang Expansion 3D
A Volumetric Simulation of Cosmic Evolution
Live Demo: https://big-bang-sim-idii.vercel.app/
Overview
This project is a high-fidelity, interactive 3D visualization of the evolution of the universe, from the initial Singularity to the present day (13.77 billion years). Built using Three.js and GLSL (OpenGL Shading Language), it simulates the volumetric expansion of space-time, the formation of the Cosmic Microwave Background (CMB), and the emergence of the Cosmic Web.
The simulation renders the universe as a dynamic time-cone, geometrically accurately representing the phases of:
- Inflation: The initial rapid expansion from a singularity.
- The Dark Ages: A period of volumetric fog before the ignition of the first stars.
- Galactic Evolution: The formation of the first spiral and elliptical structures.
- Dark Energy: The accelerated expansion of the universe in the modern era, visualized by a flaring mesh and redshifted galaxy distributions.
Scientific Visualization Features
- Volumetric Rendering: Custom shaders simulate the density of the Cosmic Microwave Background (CMB) using procedural Simplex noise to mimic WMAP/Planck data temperature fluctuations.
- Particle Systems: Tens of thousands of particles represent the “Cosmic Web,” with distinct algorithms for clustering and filament formation.
- Procedural Galaxy Generation: The simulation does not use static sprites. Instead, it procedurally generates 3D volumetric galaxies (Spirals, Barred Spirals, Ellipticals, and Irregulars) with individual stellar distributions, dust lanes, and accretion disks.
- Post-Processing: A NASA-grade rendering pipeline includes HDR Tone Mapping and Unreal-style Bloom to simulate the blinding luminosity of the Big Bang and the soft glow of galactic cores.
HDR Display Pipeline
The scene renders in linear light into half-float targets, and only the final pass adapts it to the screen:
- HDR displays (Chromium 129+ with WebGPU): highlights roll off to a 1000-nit peak, then the frame is encoded as a real HDR10 signal (Rec.2020 primaries, SMPTE ST 2084 PQ, 10-bit with dither). A WebGPU canvas configured with
toneMapping: { mode: 'extended' } decodes it, so the Big Bang, stellar cores and Population III stars glow brighter than SDR white.
- SDR displays: AgX tone mapping, output in Display P3 on wide-gamut screens or sRGB otherwise.
- Switches live as the window moves between displays. Press H or use the HDR button to toggle.
Scientific Model
- Cosmology: flat ΛCDM with Planck 2018 parameters (H₀ = 67.66, Ωm = 0.311). The age (13.79 Gyr), recombination (z ≈ 1090, ~372,000 yrs) and dark-energy onset (z ≈ 0.64) are computed from the Friedmann equation, not hard-coded.
- Timeline: a schematic stretch covers inflation. After that, cosmic age maps to
t ∝ (age/age₀)^0.25, so every epoch sits at its true age on a compressed axis. The cone radius follows the scale factor (∝ a^0.3).
- Colour: stars and galaxies use blackbody colours along the Planckian locus. H II regions use the true H-α/H-β emission colour, which lies outside sRGB.
- Epochs: the primordial plasma cools from blue-white to ~3000 K before turning transparent. The CMB is a Planck-colormap anisotropy map with most of its power near the ~1° acoustic scale. Neutral-hydrogen fog clears by z ≈ 6. Galaxy types appear in order: clumpy irregulars first, then disks, then red ellipticals and clusters.
- The cone’s shape is a schematic: its curvature depends on the axis compression and is qualitative.
Technical Stack
- Engine: Three.js (WebGL)
- Shaders: Custom GLSL Fragment & Vertex Shaders
- Post-Processing: EffectComposer (UnrealBloomPass, RenderPass)
- Physics: Custom JavaScript animation loop for expansion dynamics
Usage
This simulation is optimized for modern web browsers supporting WebGL 2.0.
Simply visit the Live Demo to interact.
- Drag: Rotate the camera around the timeline.
- Scroll: Zoom in/out to inspect individual eras or galaxies.
Developed for educational and scientific visualization purposes.
评论