Lighting messed up in UE 4.11.2 when setting "SelectiveBasePassOutputs"
Objects that are fully in shadow seem to no shadow when SelectiveBasePassOutputs is on:
I have a static skylight and a stationary directional light.
Here's what it looks like with the new SelectiveBasePassOutputs option turned on (Project Settings: Rendering: Optimizations: Selectively output to the GBuffer rendertargets):
And here it is with the option off:
It looks like any object that is fully shadowed ends up not shadowed at all.
I was searching the code for SelectiveBasePassOutputs and a lot of it seems to do checks around is it enabled or is the object using fully static lighting. Based on this I think there must be a bug in one of the checks. These objects being fully in shadow might be considered fully static.
I had to gather some more information on what the setting does in order to determine if what you were seeing or not was in fact a bug. So what you are seeing is definitely a bug, but the engineers believe the issue to be fixed after modifying a typo within the code for this setting. This fix should be integrated into an upcoming full engine release, preview, or hotfix but has not been marked for a specific version as of yet.
In regards to your question on the forums as to what this setting does, I was able to gather that information as well. This feature is an optimization to save bandwidth when reading and writing the gbuffer. The implementation uses some GBufferB.a bits as flags to encode predefined values for other rendertargets.
For instance, if the base passpixelshader is guarantied to not output any precomputed shadow factors, instead of exporting (0,0,0,0) to GBufferE , it does not export to it (saving bandwith) and rather sets the flag ZERO_PRECSHADOW_MASK
if WRITES_PRECSHADOWFACTOR_TO_ZERO -> if WRITES_PRECSHADOWFACTOR_ZERO
which was the typo.
That bug prevented to set the zero mask to shadow factors. That would explain why some primitives that should be fully shadowed end up not shadowed at all.
Let me know if you have further questions or need additional assistance.
answered Apr 28 '16 at 01:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here