This program is freely distributable without licensing fees and is provided without guarantee or warrantee expressed or implied.
Robust reflections use stenciling.
Robust projected shadows use both stenciling and polygon offset. The program has modes for disabling the stenciling and polygon offset uses. It is worth running this example with these features toggled off so you can see the sort of artifacts that result. Notice that the floor texturing, reflections, and shadowing all co-exist properly. Right mouse button pops up menu.