I have a nice reflection effect where the reflection of lights on the ceiling show on the floor. I do this with a little trick in the DisplayRegions.
DirectStart sets up the display regions in the main window as such:
- unused
- render
- render2d
- render2dp
And what I did was added my own scene tree, camera, and DisplayRegion to show it:
- unused
- render
- reflection
- render2d
- render2dp
The only catch is: I made the reflection DisplayRegion clear the depth buffer, and gave its camera a blur shader.
…
This works perfectly, IF you don’t walk off of the reflective surface. Because the depth buffer is totally CLEARED, the reflections will appear on top of any surface, not just where there’s a reflective surface.
Now, here’s my possible solution:
If I add another DisplayRegion in between the reflection and render ones, dedicated just to the reflective floors, and I somehow stop the “reflective” DisplayRegion from changing the depth buffer (but still depth testing to see where the floor is allowed to draw), then the desired effect will occur.
Anybody know how I’d make a DisplayRegion not change the depth buffer, still depth test, and still change the color buffer?