(I wrote a water texture effect program two days ago. There should be fire if there is water. So here is a flame effect program, The color values of the lower right eight points are averaged, and then attenuated once per frame to move the current pixel up. You need to prepare a palette, which is actually an array of colors. It saves the flame colors from yellow to black to represent the different colors when the flame rises.)