Plasma
If you’re familiar with the demo-scene, you’ve probably seen the plasma effect: In this article, you’ll learn how to implement plasma effects of your own. The Algorithm To generate a plasma effect, you iterate the pixels in the screen buffer. For each pixel: Apply a function to the pixel’s coordinate producing some value \(v\). Use \(v\) to calculate the new RGB value of the pixel. Update the pixel’s RGB value in the screen buffer. Repeat steps (1)-(3) until you have processed the entire image frame. Display the updated frame. Applying these steps at a high frequency creates the plasma animation. As you’ll see, the choice of function determines the shape and scale of the output image. ...