No shadows in big worlds with world origin rebasing

Since the update from 4.11.2 to 4.12.5 the shadows in our game are only shown near the origin of the world. When moving away some kilometers the shadows of smaller objects disappear and when moving further all shadows disappear. I’ve debugged a little bit and I see that the problem occurs in FSceneRenderer::GatherShadowPrimitives. It seems that the bounds in Scene->PrimitiveOctree aren’t rebased but the ProjectedShadowInfo.

I could reproduce the issue in a Test Project. You can find it in the attachment. We want to release our game in 3 weeks. So it is very important for us to fix the issue very fast. I hope you can help finding the issue.link text

Hi user,

Maybe I’m missing something, but I’m not seeing the issue in the test project you’ve provided.

When I hit PIE and then start to move towards the back of the cube field I still see shadow casting as I would expect. I see the cubes become shadowed on their edges as the max distance starts to shadow them.

Are you sure that your project is set to EPIC for the Engine Scalability settings? Have you tested this particular project on multiple machines?

If I’m missing please explain in detail what I should see or post screenshots/video to demonstrate.

Thank you!

Tim

Oh sorry. I’ve forgot to write you the controls. Press key 2 to go to the position with the issue. With key 1 you jump back to the origin.

Hi Tim,

maybe you have a dirty workaround for us. We urgently need the shadows at saturday because then we have a lot of press here in our studio.

Thank you

Mathias

Thanks for the clarification on using your setup. I’ve entered a ticket that you can check the status on here: Unreal Engine Issues and Bug Tracker (UE-34417)

Unfortunately, I don’t have any workarounds. I tried using a directional light for the individual streaming levels but still a no-go. I did notice that Point and Spot lights do still shadow cast though, so it’s only the directional light that is affected.

Hi Tim,

I’ve found the problem:

In >this commit< the line

RootNodeContext.Bounds.Center += FVector4(InOffset, 0.0f);

was added to

TOctree::ApplyOffset(const FVector& InOffset) in GenericOctree.inl.

This causes that the octree is near the origin but the bounds are at maximum of 1,000,000 (HALF_WORLD_MAX). So everything that is outside of this bounds cannot be correctly added to the octree.

I’ve removed this line and all is fine now.

Yeah, you’ve got one on me here since I’m not a coder! I’ll add the notes to the ticket and see if this can help to resolve it for future versions. I’m not sure if there is design reason or this is something that was an oversight that wasn’t caught.

I’m glad you’ve got everything sorted for your end, though! Good luck with your showing! :slight_smile:

We had a quick turnaround on this one thanks to your help. This will be fixed with 4.13 and if you’re using the preview releases at all you’ll be able to check it in 4.13 Preview 2 once that releases soon.

Thanks again!