I do not have any screen shots, I have just been thinking about it in my head (and drawing little 2D diagrams). Basically I want to know if it can be done before committing to any implementation (as I want to know if I will need vertex/fragment shaders to do my own lighting calculations).
Let me break down what I am thinking, basically you have two options to render a planar reflection…
Option 1) First pass: you can invert the objects and lights around the X-Z plane (or whichever plane) and render the reflection from the regular eyepoint. Second Pass: You render the scene normally. I have no doubt this gives perfectly reflected objects and diffuse lighting.
Option 2) First pass: you can invert the eyepoint around the X-Z plane and render the reflection from this viewpoint. Second Pass: you then return the eye back and render the scene normally. Again, this will give perfectly reflected objects and diffuse lighting.
However, it is the specular highlights I am worried about. Consider the following scene:
We have a light directly above a sphere which sits just above a mirror (on the X-Z plane). Our viewpoint is back and above the sphere looking down on it at a 45 degree angle. In the reflection you should not see any specular highlight as the light is directly above the sphere (but you will see a specular highlight on the sphere itself)
Now consider an image rendered with the first option above. During the first pass we keep our eyepoint fixed above and back looking down at a 45 degree angle and we then add an inverted sphere below the mirror and a light directly below it. When OpenGl renders this, will you not get an incorrect specular highlight (or at least part of one) on the side of the reflected sphere?
Then, is the same not conversely true for option 2 except we are moving the eyepoint instead (all the same angles, just objects in different spots).
While I freely admit I could be wrong, my thinking is that in either case (option 1 or 2) you are changing the angle of incidence for the specular lighting calculation. In option 1 you move the light but not the eye, in option 2 you move the eye but not the light (note, diffuse lighting will look fine as this angle is irrelevant).
Or like I said, am I wrong? Maybe my drawings are just not doing the angles justice. It could very well be that while the angle does change that due to laws of reflections (ie physics) that no specular highlight will appear unless it should be there.
I am just looking for a “yes/no, can it be done” type answer and was hoping someone that had implemented it would be able to tell me.