layered rendering

Hi all, we are developing an application using OpenGl 2.0.

This is a game application with a “Fixed” 3D background scene and moving objects on top of it. We are wondering on how to explain to the render engine something similar to the layer concept in 2D applications.

Basically we would like to have the background onto one layer and the moving objects onto another layer. And tell to the “Paint function” to update only the layer with the rotating objects? Are there some code example available?
Many thanks in advance Francesco.

Usually one simply renders everything each frame. However, you could render your background once, do a “screenshot” (render it into a texture) and later on, first render a fullscreen quad with the background texture and then update your foreground objects.

Whether that makes sense, depends on the complexity of your background.