As there are many "hacked" approaches for implementing a plasma effect, this outline of an algorithm will just describe the theoretical basis for the effect. In order to achieve a sufficiently fast and good-looking real-time implementation (especially on the limited hardware available at the time this effect was at the height of its popularity in the 1990s), one would often do "non-correct" approximations to this algorithm. This, however, can often be done without noticeable visual differences.
This algorithm is given in two dimensions, but could easily be adopted to any number of dimensions or any number of color channels.
Let f ( x , y ) {\displaystyle f(x,y)} be a multi-frequency noise function of two variables (e.g., a Perlin noise function). Let each color component c {\displaystyle c} at the pixel ( x , y ) {\displaystyle (x,y)} be a linear function of the expression sin ( f ( x , y ) ∗ freq c ) {\displaystyle \sin(f(x,y)*{\text{freq}}_{c})} . Increasing the value of the constant freq c {\displaystyle {\text{freq}}_{c}} tends to increase the steepness of the color gradients in the image.
Diamond-square algorithm is the fractal used by the original Plasma demo, and is now often called the plasma fractal which was the name given to it in Fractint.
"What are the main concepts behind building the plasma effect with GSLS?". Computer Graphics Stack Exchange. Retrieved 2024-09-09. https://computergraphics.stackexchange.com/questions/13074/what-are-the-main-concepts-behind-building-the-plasma-effect-with-gsls ↩