transparent flat mirror (help!?)

Hi,

I wrote an OpenGL render which renders the opaque objects first, and then transparent objects last. Allowing for them to blend with their background objects.

Then I added the feature to render flat planes as mirrors. I render the mirror objects first before everything else (they have to be first right? there isn’t another way?). How: The stencil is rendered, the mirrored copy of the scene is rendered inside the stencil, and then the flat mirror is blended on top to give the effect of a reflective floor or mirror.

Now, I have to support reflection transparent objects that are flat. For example, a glass door or glass dividing wall in a room.

If transparent objects have to be rendered last, but mirrored objects need to be rendered first. Then I have a problem right??

The reason is that drawing the mirrored scene with the depth testing won’t work it you do that render pass after the opaque objects were rendered.

Am I making sence? This is hard to explain. Has anyone done flat mirrored reflections that are transparent using the stencil trick?