Lightmass CalculatePointShadowing has regression in UE5.6

Hi,

I’m writing to report a regression/result change we’ve encountered in the Build Lighting process when using Lightmass in Unreal Engine 5.6.

We’ve attached both the reproduction steps and a minimal repro project to help you investigate further.

Summary of the issue:

  • When building lighting with Lightmass that calls CalculatePointShadowing function, the result does not match with the UE5.5 result.
  • We suspect the regression is caused by the Embree upgrade. When we disable Embree in DefaultLightmass.ini, the result matches the UE5.5 result. I attach our observation : ShadowSampleUE55.txt, ShadowSampleUE56.txt, ShadowSampleUE56NoEmbree.txt

Please let us know if you need any additional information or logs. We’d appreciate any guidance or updates you can provide regarding this regression.

Thank you.

Steps to Reproduce

  1. Add this line below CalculatePointShadowing is called in TextureMapping.cpp: UE_LOG(LogLightmass, Log, TEXT(“Shadow Sample %f”), ShadowSample.Visibility);
  2. Build UE5 Editor and UnrealLightmass
  3. Create a game project
  4. Add DefaultLightmass.ini in Config folder and add the lines :
[DevOptions.StaticShadows]
; Using area shadows by default instead of filtering in texture space
bUseZeroAreaLightmapSpaceFilteredLights=True

  1. Open the project and in the project setting check allow static lighting
  2. Add Stationary Spotlight actor. Check cast static shadow and cast shadow. Check “Use Area Shadows for Stationary Light precomputed shadowmaps”
  3. Add two plane actors. Place one plane above the other plane so that it creates a shadow in the second plane. Refer the attach project.
  4. Build Lighting.
  5. Open swarm agent and check log. (Increase the MaximumJobApplicationLogLines to 10K to contain the entire log).
  6. Observe the value of ShadowSample.Visibility.

Do the same steps using UE5.5 and observe the value of ShadowSample.Visibility. UE5.6 and UE5.5 result does not match.

In UE5.6 the result matches UE5.5 result if we disable Embree in DefaultLightmass.ini.

[DevOptions.StaticLighting]
bUseEmbree=false


Hi,

thanks for reporting this issue and adding your observations and minimal repro project. I could reproduce your debug results on my side and have filed a bug report so someone at Epic with more knowledge of the matter can investigate (I will post the link here when it becomes available on the public issue tracker).

I had a look at the code changes related to Unreal Lightmass and Embree that went into UE5.6, but could not immediately identify the reason for the discrepancy in the shadow sample visibility results. There has been a refactoring of the Lightmass FinalGather logic in this commit, which you could try to revert (or perform a git bisect around that particular commit) to see if that affects the point shadowing behaviour.

Please let me know if you have any further questions.

Thanks,

Sam

Hi,

No problem and thanks for trying out the suggestion. The issue is now available on the public issue tracker at this link, where you can track its progress.

Thanks again,

Sam

Thank you for the response.

The commit bf2236a requires Embree 2.7.0. It is difficult to get it compiled because it affects some other source code such as Nanite Ray Tracing. For now we will use the workaround and wait for the investigation result.

Best regards,

Sandy