Hey guys! I have done some thinking, and I can't see an obvious way to render my planar reflections without rendering "the mirror" first.
My mirror is expensive to render twice, compared to just some planar equation. Hence the planar reflection.
So, is there any way to write to the stencil buffer from say the shader rendering the mirrored objects? And then discarding say non-zero stencil values? Any quick example would be great.
I imagine I can somehow mark my reflected objects with stencil values, then when I draw my reflector I could discard non-zero stencil values... somehow.
I'm using clip planes, it seems like much a much simpler procedure, and just what clipplanes were meant to do!
... Which means that with a constant water level (Y=64), all I need to do in the shader is
gl_ClipDistance = position.y - 64.0;