Perlin Noise Fire Cube The fire effect has been used quite often for oldskool demos. First you create a palette of 256 colors ranging from red to yellow (including black). For every frame, calculate each row of pixels based on the two rows below it: The value of each pixel, becomes the sum of the 3 pixels below it (one directly below, one to the left, and one to the right), and one pixel directly two rows below it. Then divide the sum so that the fire dies out as it rises.
Source code: Fire