x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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):

alt text

And here it is with the option off:

alt text

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.

Product Version: UE 4.11
Tags:
lighting_bug.jpg (491.9 kB)
lighting_ok.jpg (471.6 kB)
more ▼

asked Apr 21 '16 at 11:11 PM in Bug Reports

avatar image

muchcharles
267 11 16 24

avatar image AndrewHurley Apr 22 '16 at 06:04 PM

Hey muchcharles,

Would you happen to be able to reproduce this issue in a blank project using some simple steps and assets?

Also, is the object in question set as a 'Static' or 'Movable' object?

I am not too familiar with this setting, so I am going to need to read up on its functionality in order to understand the bug in question.

Thank you,

Andrew Hurley

avatar image muchcharles Apr 22 '16 at 06:17 PM

I'm going to try and reproduce in a simpler project; thing to note in the image above is the tower is composed of two pieces, the part at the top that is partially in shadow is fine, the lower part that is fully in shadow is glitched.

avatar image muchcharles Apr 22 '16 at 06:27 PM

Ok, I was able to reproduce with a very simple project. Create a new project, check "Selectively output to the GBuffer rendertargets in edit:project settings: rendering: optimizations. You'll need to relaunch to recompile shaders at that point. Then add a cube and stretch it out so it casts a big shadow. Put a smaller cube completely within the shadow. Rebuild lighting. The smaller cube will be getting light instead of being in shadow.

Here's a picture: alt text

avatar image muchcharles Apr 22 '16 at 06:29 PM

(and if you then scale the smaller cube up so that it is only partially shadowed, and rebuild lighting, it will again get the appropriate shadowing)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey muchcharles,

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

BasePassPixelShader.usf

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.

Thank you,

Andrew Hurley

more ▼

answered Apr 28 '16 at 01:40 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question