- Home /
How do you globally (per project) occlude specular highlights (probes and basic specular) using a baked lightmap (to fake specular occlusion)?
Hi there
I'd like to emulate specular occlusion by multiplying the baked lightmap by all specularity values in the shaders.
I believe I should do that by editing some external files such as UnityStandardCoreForwardSimple.cginc, found externally, affecting a whole Unity install for some specific version (so I'd have to make such changes every time I install Unity. That's not a problem, I can do that.
What I'm having a hard time, is spotting the exact point where I can dampen reflections (and specular reflections provided by refprobes) with the baked lightmap.
It should be trivial, but I'm getting lost in the files. I believe a simple multiplication/lerp should do the trick, but I can't understand where to do that.
To give you some more context:
I'm targeting mobile, OpenGL ES 3.0, gamma color space, forward rendering, Subtractive mode lightmaps, Unity 2019.2.11f1