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"

SSS is affected by Skylight. Shouldn't be.

Hello,

Subsurface Scattering shows when it's hit with direct light. I.E:

alt text

In UE4 However, I've setup a scene using only a skylight, with flat lighting or ambient lighting, you should only see the diffuse color, not SSS. BUT:

SSS Intensity = 1

alt text

SSS Intensity = 10

alt text

Skylight influences the SSS way too much!

Engine version: 4.15.1 Repro Steps: 1. Create a new map. 2. Remove pre-baked lighting. 3. Remove directional light. 4. Add Skylight. 5. Add PPV, disable auto exposure (just so you see the issue easier). 6. Add a SSS material to a mesh and change the SSS multiplier.

SSS shouldn't make a visible difference while in flat ambient lighting condition.

Product Version: UE 4.15
Tags:
more ▼

asked Apr 24 '17 at 08:01 AM in Bug Reports

avatar image

Maximum-Dev
544 7 15 18

avatar image Maximum-Dev Apr 25 '17 at 10:17 AM

Another test.

Material:

alt text

Direct + Skylight:

alt text

Skylight only. Since Skylight has Lower Hemisphere being black, it's only casting light from above hence you see red on the bottom, but it should have been grey all the way since skylight is not a directional light source but is an ambient light.

alt text

Lower Hemisphere is not solid black in this one, should have been grey all the way here too but it's not.

alt text

Please fix this asap. All foliage look wrong in shadows.

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

2 answers: sort voted first

I've entered a bug to see what the developers say regarding this issue. You can track and vote on the issue by following the link below.

UE-44851

Thanks,

Andrew H.

more ▼

answered May 09 '17 at 07:03 PM

avatar image Maximum-Dev May 09 '17 at 07:33 PM

Thanks Andrew. The repro steps on the ticket seem to be wrong though. If you uncheck affect world on skylight the scene everything goes black and it's no longer visible how skylight is influencing the SSS.

avatar image AndrewHurley May 09 '17 at 07:41 PM

They are correct, since I set the Skylight on by default in the test project provided. The point is to show the visual influence Skylights have when the are on vs. off so getting them to visualize either state is important. I updated the steps to also add switching between Stationary and Movable and comparing those results.

avatar image Maximum-Dev May 27 '17 at 10:02 AM

Actually both Stationary and Movable skylight result in the same wrong behavior so if they do that they wouldn't see any visual different. As mentioned by @zeOrb only static Skylight with built lighting shows the correct result.

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

Hello Maximum-Dev,

So I asked around to confirm what you are saying, but Skylights are expected to affect Subsurface Scattering. This is because Skylights are still emitting photons whether direct or indirect, it makes no difference. Now, the actual phenomenon in real life outside of video games, the effect can be more visible and pronounced with direct lighting; however, in Unreal we are dealing with calculating emitted photons from all light sources. There is no difference between Skylight photons and Directional Light photons, and in reality there is no difference between direct and indirect light, its only a term we use in rendering since direct lighting is much easier to calculate.

I ran some tests on my end just to see for myself, and its outcome is clear and expected.

Subsurface Material alt text

As you can see I used a completely black input for my base color. I also exposed the opacity input as this determines the amount of simulated light scattered to show the SS effect.

Movable Spotlight alt text

I also made sure to rebuild my lighting before viewing any of my results. You want to make sure you discard all the old indirect lighting.

Movable Skylight with Cubemap alt text

Movable Skylight Captured Scene alt text

In summary the results I am getting are expected because the Skylight is still emitting photons which is going to be picked up by the Subsurface Color. Thanks for taking the time to test the issue, but this is not a bug and just how subsurface scattering works with lighting in the engine.

Cheers,

Andrew Hurley

more ▼

answered Apr 27 '17 at 04:21 PM

avatar image Maximum-Dev Apr 27 '17 at 07:37 PM

Hi Andrew,

That's not quite right. It works a bit different from what you said. Direct light and indirect light have different density in real life. That's why when you put a flashlight behind your hand you see your hand getting a red tone, and when you remove the flashlight from the room, even though the room is fully lit by indirect light, you don't see that red tone on your hand anymore. Let's take a look at the example below, I believe this helps to better demonstrate the issue.

This is a room lit by indirect light, then there's a flashlight on the table, and a hand covering the flashlight.

alt text

What you said above essentially means that if we remove the flashlight from the picture above, the hand should still have that red tone because there are still indirect light in the room hitting the hand. That's wrong because i.e 5000 photons from flashlight hitting the hand is not the same as 1000 photons from indirect light hitting the hand, indirect light is sparse photons and not a photon source focused on one direction like a direct light source, hence, indirect light leaves far less noticeable. The reason you don't see your whole body being red under overcast sky is because all that indirect light does not equal to the direct light from a tiny flashlight that makes your hand look red.

As you know, the correct behavior would be for the hand to lose all that red tone as soon as the flashlight is removed. Which means, your green looking ball should lose all the green SSS color as soon as the directional light is removed, and under the skylight it should look black (as your base color is) and with a very, very hard to notice dark shade of green to it.

avatar image AndrewHurley Apr 27 '17 at 09:25 PM

The problem here is that you are comparing a real life situation, with how we handle things in the engine. The information I shared came directly from one of our rendering guys who knows lighting and materials very well. I understand your points about SS in the real life, but what you are seeing as described to me is what is expected. As you are aware, the engine cannot simulate every real life lighting situation as that would be incredibly complex and not really easy to use for games. We use a number of different techniques and features to simulate and fake various effects to try and resemble phenomenons like SSS. This is the beauty of game design, it sometimes doesn't work out of the box like you would expect, so you will need to find a way to work around the problem if it is that much of an issue, which I am sure you can figure out :)

Thank you,

Andrew Hurley

avatar image Maximum-Dev Apr 27 '17 at 09:55 PM

It's not necessarily an incredibly complex calculation for a game. It's as simple as reducing Skylight's power on SSS. I just think they weren't informed very well of the issue. Can you please possible have him read through this report once?

avatar image zeOrb ♦ Apr 28 '17 at 06:05 AM

If this behavior is expected, yet rendering does not reflect the effect properly - should not this at least be logged into issue tracker?

Indirect lighting SSS is messing with proper direct lighting SSS setup which engine tries to provide. While we can try to find workarounds it does not mean that issue should not be treated like not an issue at all.

avatar image zeOrb ♦ Apr 28 '17 at 06:57 AM

It looks like a bug more and more. Here are two scenarios:

Directional Light

  1. Create abovementioned material with SSS color

  2. Create movable Directional light and look how it influence SSS

  3. Change it to Static/Stationary, build lighting and look how it influence SSS It works properly and material get proper SSS intensity during built static light and during movable state

Sky Light

  1. Create abovementioned material with SSS color

  2. Create movable Sky light and look how it influence SSS

  3. Change it to Static/Stationary, build lighting and look how it influence SSS Material get proper SSS intensity(NONE) only during built static/stationary light and get full 1.0 value during movable state. So either someone forgot to change value for movable state or by design Directional light contributes to SSS properly in all modes, but Sky light works properly only in half of cases.

Also, I might found relevant bit in SkyLighting.usf which responsible for diffuse lighting in Movable mode. Here is code snippet

 if (ShadingModelId == SHADINGMODELID_TWOSIDED_FOLIAGE)
         {
             float3 SubsurfaceLookup = GetSkySHDiffuse(-GBuffer.WorldNormal) * View.SkyLightColor.rgb;
             float3 SubsurfaceColor = ExtractSubsurfaceColor(GBuffer);
             Lighting += ScalarFactors * SubsurfaceLookup * SubsurfaceColor;
         }
 
         if (ShadingModelId == SHADINGMODELID_SUBSURFACE || ShadingModelId == SHADINGMODELID_PREINTEGRATED_SKIN)
         {
             float3 SubsurfaceColor = ExtractSubsurfaceColor(GBuffer);
             // Add subsurface energy to diffuse
             DiffuseColor += SubsurfaceColor;
         }

As you can see - for two sided foliage some scaling applied, however for subsurface there is no logic, it just pure max color without scaling.

avatar image Deathrey Apr 29 '17 at 06:55 PM

It is being applied further down, to all sky lighting as a whole, not to SS color in particular. What troubles me is that means that skylight affects diffuse and SSS in a same way. I don't think it should. I actually added additional sky weighting for SS color in response to my artist's complaints about not being able to produce consistent look of objects with SSS under various lighting conditions.

avatar image Maximum-Dev Apr 27 '17 at 09:32 PM

Did I make a mistake by comparing a real life situation to how you handle things in your engine? as far as I know game engines try to replicate real life situations. Your rendering guys might just not be in the mood it seems like because without a flashlight, you neither have a red hand in real life, nor in other game engines. But you do in UE4.

avatar image Deathrey Apr 28 '17 at 12:24 PM

@AndrewHurley ♦♦ That is definitely a bug. I just compared 4.15 and my build.

4.15 launcher version

alt text

My build

alt text

As You can see, SSS is localized where maximum skylight passes though the object, unlike on first shot.

Default lit material for comparison

alt text

I can't say right away what was the change I made or when was the bug introduced, but It feels like it was around 4.12

avatar image Maximum-Dev Apr 28 '17 at 01:33 PM

Yeah looked alright in old builds. But even then the effect was exaggerated. The green should be ever more subtle, but anyway, I hope that's enough evidence to consider this a bug @AndrewHurley ♦♦. Please show your rendering guys Deathrey's old vs. new build comparison. Thanks.

avatar image AndrewHurley Apr 28 '17 at 08:55 PM

I can bring Deathrey's example to the attention of those who know SSS best to see what they think. I'll return once I have more information.

avatar image Deathrey Apr 29 '17 at 07:01 PM

Information about 4.12 might have been a bit misleading from me. I've implemented a change in response to my artist's complaints about not being able to get expected look for SSS objects in overcast skies and difference between static and movable skylights. So might not be actually a newly introduced bug. Complaints about skylight overly affecting SSS materials are still fully valid though.

(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