Okay, so I’ve noticed that directional lightmaps are rendered differently depending on whether you are in forward or deferred mode. Specifically, how they are added to the light accumulation buffer in deferred mode. This is a problem for me because it not only makes my dynamic light specular highlights inconsistent across static and dynamic objects, but it also means I can’t do my colored fresnel calculations on my custom lightmap specular.
So my question is, is there any way to force it to render the lightmaps in the material pass rather than the gbuffer pass? Thanks.
Sure that your ‘custom lightmap specular’ implements all the required functions?
Deferred and Forward use different base functions etc for lighting in the shader and you need to implement them on both sides if you want both render modes to be supported.
Okay, after finding out about “#pragma debug”, I saw that that the “_DirLightmap” function actually happens in “PrepassFinal” pass just before the “_Prepass” function. So I do actually have the ability to do some custom handling of lightmaps to fix this problem. It will just involve dropping down to a lower level inside my shaders, and dealing with potential breaks due to future Unity updates.
Not my first choice, but at least I have the option.