Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a very simple game engine. A GameObjectManager stores a collection of all the GameObjects. When I want to render, I just call GameObjectManager.render() from the rendering context.

This works well for rendering most objects, but now I am looking to add a water shader to the scene where it takes in reflection and refraction textures. The reflection and refraction textures will be computed each frame by re-rendering the scene from a new perspective. Unfortunately, my design choice of having a single GameObjectManager to store all GameObjects just won't work for this - it wouldn't make sense to store a GameObject for the water in the GameObjectManager.

What is a good game engine design pattern to handle re-rendering the scene for an effect such as a reflection?

share|improve this question
up vote 2 down vote accepted

Your current approach should be fine for this.

All you need to do is to have the reflective object hide itself, before performing the reflection render. This is typically done by having it clear a "IsVisible" flag on itself, before starting the reflection render.

Now, if you wanted to have objects which didn't reflect their surroundings, but instead showed elements from a different scene (say, a television screen showing a part of the next level), at that point it might be worth thinking about not having only a single GameObjectManager, and instead having one per discrete scene. But if all you're considering are reflections within a single scene, then a single GameObjectManager should be able to do everything you need.

share|improve this answer
Ok, that put me on the right path. Thanks. – VigoTheCarpathian Jul 20 '11 at 15:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.