How can I display reflections in OpenGL ES on iPhone without a stencil buffer?

I am looking for an alternative method for reflection reflection in OpenGL ES on iPhone. I usually do this using a stencil buffer to mark where you can see the reflection (reflective surface), and then display the inverse image only in these pixels. Thus, when the reflected object moves from the surface, its reflection is no longer visible. However, since the iPhone implementation does not support the stencil buffer, I cannot determine how to hide parts of the reflection that fall outside the surface.

To clarify, the problem does not affect the reflections themselves, but hides them when they are not visible.

Any ideas?

+5
source share
2 answers

First visualize the reflected scene; copy to texture with glCopyTexImage2D; clear framebuffer; draw the scene correctly by applying the copied texture to the reflective surface.

+9
source

I have no answer for reflection, but here is how I make shadows without a stencil buffer, perhaps this will give you an idea:

/ . , . "loop". , . , . , . ( , .)

, , . decaling, , .

+2

All Articles