Movable static meshes do not receive shadows from indirect light cache until moved on HTML5

Hello,

I have made a door using a movable static mesh. On the HTML5 version of my app, the door does not receive any shadows from the indirect light cache until it is moved (opened). It receives correct lighting after it has been moved. It just remains a bright white color until then. Everything works fine in the editor. Both in SM5 and Mobile/HTML5 preview. I’ve tried invalidating both the door actor and static mesh component’s lighting cache through C++, but it had no effect. Also, the shadows only update if the door is visible in the frame. The shadows will not be updated if the door opens/closes behind the camera.

How can I fix this? How can I force the indirect lighting cache to update all movable meshes in the world from the game thread? I’ve tried running functions like ApplyWorldOffset and Add/RemovePrecomputedLightingVolume which indirectly should update the lighting cache, but they had no effect either.

Unopened door, no shadows from ILC.

Door after it has been moved. Correct shadowing from ILC

Closed door. Correct shadowing from ILC.

Thanks.

Hi PerWikman -

I have been trying to reproduce this issue you are reporting and so far have not been successful. If you can take a look at the attached test project and see what setup you are using that is different. Feel free to make adjusts and reupload the project afterwards.

Thank You -

Eric Ketchum

Test Project

Hi Eric,

Okay, so I managed to reproduce my issue using your project. I believe the problem is that my door is in the persistent level, and the static mesh props (wall etc) are in another level that is always visible and loaded. Perhaps there is no valid ILC data for the doors to pick from when the persistent level is loaded? The correct ILC data becomes available after the second level has loaded.

In my project I’ve put the walls in a separate level that is loaded and visible on startup and left the movable sphere in the persistent level. The movable sphere in the persistent level remains black until it moves when the app has loaded.

The reason my doors are in a separate level is so that they have a persistent state while I switch between different rooms with different lighting.

Thanks

EDIT: Creating a separate level (Blueprint type) containing the doors and placing it after the level with the room in the level list seems to have resolved my issue.

Project

Hi -

Thank you for the additional information, I was able to reproduce it internally and have reported the issue as UE-17218. I will keep you informed as we investigate a solution.

Eric Ketchum

Besides the bug, Eric, do you have an anser to “How can I force the indirect lighting cache to update all movable meshes in the world”? Or maybe force a mesh to update without actually moving it?

Hi -

Since the Indirect Lighting Cache uses samples generated by Lightmass at build-time to calculate the indirect lighting for dynamic objects at runtime, the only way to force all movable meshes in the world to update would be to invalidate the lightmass build. At that point you would probably want to switch to dynamic lighting anyway since Static elements would be light improperly. You could try tightening the volume samples, but there will be a performance cost for increasing the samples too high. You can alter this in World Settings, under Lightmass, Volume Light Sample Placement. It defaults to a value of 1.0, lower values will give you more samples and high fidelity, but at the cost of increasing the sample update times.

Thank You

Eric Ketchum