Instanced Static Meshes Don't Receive Direct Light From Shadow Casting Stationary Lights

When I bake lighting on actors I have placed that add instanced static mesh components via blueprint, the direct lighting from stationary shadow casting lights is missing. If I turn off shadow casting on the lights and bake again, it works fine. It also seems to work if the light radius encompasses the bounds of the parent actor that holds the instanced static meshes.

The baked indirect lighting seems to work fine in both cases.

Pre-Baking:

103891-beforebake.png

Post-Bake:

103892-baked.png

Is this a bug, because it seems serious if so. If not, I assume I am missing something and would appreciate any help

Hi Rujuro,

I was able to reproduce this issue and have filed a bug report here: Unreal Engine Issues and Bug Tracker (UE-35414)

While testing I noticed at times that the shadow would bake as if the light was casting towards the root component location. The only work around I can think of in this situation is strategically placing the Blueprints in a way so that they intersect the attenuation radius at the root component.

Hope that helps,

Ed, unfortunately I am just having to eat the performance cost and use actual static mesh components until this is resolved. It is pretty impossible to always make sure that the root is within all possible influencing lights when the point is to cheaply render a large number of meshes (since often that implies some area coverage, at least in our use case).

Glad the bug is filed though, hopefully it will be addressed, I voted for it.

The cause of the problem is that the bounds of the instanced mesh component are not recalculated after new instances are added, causing static lights to be culled incorrectly during light baking.

I was able to fix the issue locally by adding a to UpdateBounds() at the end of UInstancedStaticMeshComponent::AddInstance.

1 Like

Owen! I’ll try this and see if it fixes my test case.

So the problem with this is it does require a change to the engine code, and can’t be fixed in the Blueprint since there is no UpdateBounds() BP function.

hey could you tell where specifically i have to change this