I’ve got deferred decals that are rendered to the GBuffer0, GBuffer1, GBuffer2 and CameraTarget (HDR);
And I’m using CameraEvent.BeforeReflections.
While lit by realtime lights they look just fine, but if they applied to the lightmapped surface - they look way dimmer, barely visible. Like the light is not combined properly together. Or just overlayed on top.
I though DD should receive light from the GBuffers contents directly?
This is a known limitation of Unity’s deferred renderer in respect to lightmaps.
Unity’s deferred renderer applies the lightning from lightmaps to the surface albedo and outputs it to the emmisive buffer during the initial gbuffer generation pass. When decals are applied, the emissive buffer is still bound as a write target so you can’t read from it, not that it’s be all that useful since it has the albedo premultiplied into it, and may also contain emissive values you don’t want to multiply with.
Basically the light map information is stored in the original mesh data, and not available in the gbuffers in a useful way after they’ve been rendered.
The only way to have light maps affect decals would be to bake out light maps to additional screen space buffers and read from them when rendering the decals. When doing directional light maps this is a lot of buffers. Usually the solution is to make sure you’ve got a decent set of light probes in your scene for the decals to sample from, just like any other dynamic object.
Many AAA games have moved away from light maps entirely and use only probe or other volumetric based baked lighting systems to ensure lighting on both static and dynamic objects match. This isn’t an option for the built in rendering paths, but it’s possible Unity will choose something like those solutions for a future Enlighten replacement with the SRPs.