The separated main dir light buffer is no longer bound as render target during the base pass. It is used for the DFShadow only.
The main dir light contribution flow thgouth the Strata mateiral buffer.
#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/6273d021b86624d2e8cab0f0
[CL 20056963 by Sebastien Hillaire in ue5-main branch]
Storing water in gbuffer and runnign extra lighting pass would be too expenssiv. So instead, when in deferred, single layer water always output the main dir light luminance into a separate 111110 texture.
DF shadow is applied on that texture. DFShadow culling step is cached the first time for a given view in order to be able to reapply DFShadow later with a depth buffer containing water. This save 0.4ms on a base console.
DFShadow is naturaly skipped if the directional light does not have that feature enabled.
When DFShadow is executed, it is basically 0.24ms extra on a base console @ 1080p.
The separated light buffer is an extra 8MB allocated when in deferred.
This only works with deferred for now (forward does not run the reflection/composite pass).
Render target slot assignement is a bit fuzzy but this is a mostly static setup so should be fine. And could change with Strata down the line.
r.Water.SingleLayer.ShaderSupportDistanceFieldShadow is to enabled dfshadow on water for the shaders. Defaults to 1 and will only be enalbed when using deferred and when distance fields are enabled.
r.Water.SingleLayer.DistanceFieldShadow is a runtime toggle of the feature (if enabled the shaders still output to the separate light render target, but that is simply discarded).
Follow up: tile upsample, tile traceshadow, make it work with strata.
Tested shooter and console.
#rb Tiago.Costa, Kevin.Ortegren
#preflight https://horde.devtools.epicgames.com/job/62457ad79f404234145cd424
[CL 19613312 by Sebastien Hillaire in ue5-main branch]