it has been a while since I last invested considerable time on the reflections mod.
over the last few weeks I worked on the mod again and I would like to take the time and talk a bit about the things I investigated and the work I did.
Let's start with a screenshot of the reflections inside the mages guild with reflections mod activated:
there is one aspect that I dislike about the reflections in the screenshot - they make the floor too bright. reason is that till now the reflections are done in a surface shader which basically alters the albedo color.
No matter what you do (blending it with the original color or any other operation) it makes surfaces with reflections look different than surfaces without (as unity applies its lighting model).
Another problem with the old implementation is that every floor material needs to be exchanged with a custom material using the surface shader and some custom shader parameters. This worked but it has a major drawback. It is not possible to use the standard unity material anymore and more important one can not just simple change the floor material again. With this proprietary texture injection solution (part of the old reflection mod) a coexistance with a potential future texture replacement mod would not have worked or only with lots of quirks.
So the motivation was to "inject" the reflection computation for floor planes into unity's deferred pipeline so that (1) the lighting would look better and (2) materials with unity's standard shader could be used as floor materials and still get the floor reflections.
So I decided to take a closer look at unity's deferred rendering pipeline and ways to customize it. I learned lots of new techniques including replacement shaders and command buffers.
There were lots of problems but I was able to solve most of them. So I think it is time to show off some progress and talk about the remaining issues:
it does not look too spectacular but you can see that the floor now is lighted similarly as the walls. But keep in mind that it uses now unity's standard shader on all floor materials.
one issue you can see in the image is one of the remaining "problems" (it is not really a bug or problem just a consequence of the light rig used in indoor scenes by DFTFU):
it is the reflection of one of the 3 directional lights used in the light rig that ends up in the light probe buffer and is drawn (indeed all 3 lights can be found when walking around the indoor environment) - this issue is not a problem of the floor reflections, it is intended behaviour by unity since every directional light gets rendered in the light probe buffer - if DFUnity would have any default texture with some metallic amount and smoothness < 1 one would see the light reflections on those surfaces.
@interkarma: the question now from myself would be: is this lightrig really necessary? - I mean 3 directional lights are not really realistic - in indoor scenes there should only be spot and point lights in my opinion.
I also realized that e.g. castle daggerfall imports/create lights at light source positions (e.g. torches) but it looks that for buildings no lights are created for the light sources.
there is no easy way to prevent lights to end up in the light probe buffers unfortunately.
nevertheless I think it is already in a pretty good state - will take me some more weeks to finish and polish it