Skip to main content
Annual billing

ThreeJS.net annual plans cost about 50% less than 12 monthly payments

Save

TSL Galaxy

A spiral galaxy of glowing particles, written in TSL

Source on GitHub

By three.js authors. Open source under the MIT licence; hosted here with its licence, unmodified apart from a small script that lets ThreeJS.net embed it. The prompt below is our description of the work, not the author's.

About this scene

A spiral galaxy of tens of thousands of particles, hot white in the core and violet in the arms, slowly turning. Positions, colours and motion are computed on the GPU with three.js Shading Language (TSL). Drag to orbit around it. An official three.js example.

How it is built

  1. 01

    Arms from a formula

    Each particle gets a radius, an arm and a twist that grows with distance; random spread makes the arms soft.

  2. 02

    Colour by radius

    Particles near the core are hot and white; farther out they cool to violet.

  3. 03

    GPU motion

    The rotation runs in the node material, so the CPU does almost nothing per frame.

Questions

Who made this?
It is an official three.js example (webgpu_tsl_galaxy), made by the three.js authors and released under the MIT licence with the library. ThreeJS.net hosts a copy of the page with a small embed script; its textures and models load from the three.js repository at release r187.

More examples