Heat Transfer

Hi, I’m kind of new in here and I’m also not a native programmer just a mechanical engineer.

So, I saw an example at “CUDA by Examples” textbook which uses GPU to simulate a non-realistic heat transfer problem. But my question is, in openGL how can we do a gradient (colors change with time) animation? Do we have to use bitmaps to make this animation? (I’m talking about the effect in the “SPORE” pc game when we are a water micro-organism, the water and the cartoon-ness of the animations.)

If you want a whole surface to change color over time you don’t need a texture, you can simply write a different color to the screen (if using shaders) or use glColor* (if using the older fixed function pipeline API).

“Toon” renderers are usually implemented using shaders. It calculates the color like a regular renderer, but it quantizes the shading to make the “dark” side have a hard transition from the “light” side. It’s usually phong shading with a non-linear function to remap the regular lighting equation.

You can use a Lerp function to mix two colours based on a time interval. That colour can be sent to GL via glColour4f or as a shader uniform.