Plasma

Version 6 of 7

Shader plasma.

GPU · GLSL · 2010s

This version

The same sum of sines, evaluated per pixel at full resolution with a cosine colour palette instead of a table.

How this version works

A fragment shader evaluates the pattern at a configured render scale of 0.75. Coordinates are centred and normalised by image height, then used for horizontal, vertical and diagonal sine waves. A fourth radial wave follows a moving centre and uses the square root of squared distance plus one. The sum drives a three-channel cosine palette, followed by a power of 1.6 and a brightness multiplier of 1.15.

The trick in this version

The GPU calculates each fragment independently without a stored sine table or indexed-colour buffer. Colour is generated analytically rather than selected from the CPU versions' quantised palettes, while the reduced render scale limits fragment workload.

Historical context · GPU

  1. 2013 · Iñigo Quilez & Pol Jeremias

    Shadertoy

    Shader code that runs per pixel, shared in the browser. A plasma becomes a five-line fragment shader at full resolution, the ‘hello world’ of a new generation.

  2. 2015 · Salomonsson

    From tutorial to shader

    A documented walk from the sum-of-sines maths to a Shadertoy shader and then into a native application, the plasma as a teaching staple.

Platform
GPU · GLSL
Era
GPU
Rendered on
GPU
Tags
fragment shader
Sources
Shadertoy (2013)From tutorial to shader (2015)