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:
Post-Bake:
Is this a bug, because it seems serious if so. If not, I assume I am missing something and would appreciate any help
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.
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.
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.