Sun-like shadow caster possible?

I’m trying to port a Space-based game to Unreal Engine 4 and hit a roadblock with the sun. Previously (old engine) I had one point light with a cubemap shadow capture attached, which would be used in postprocess to determine if shadowed or not (basically an ugly hack that worked pretty well). The whole scene was dynamically lit, as everything is moving. Well, except the sun that is.

I don’t seem to be able to do this in Unreal Engine 4 with Point Lights, do I have to implement a solution like that too? Or am I missing something in the Point Light settings? It works fine with Mesh Distance Fields, but not every computer can handle them (targeting lower end PCs like Nvidia GTX 550 and similar cards).

My attempt looks like this:

Ideally there should be a shadow there with and without Mesh Distance Fields enabled.

Considering you have a space scene there will probably be a lot of empty space between the objects. Additionally you stated that your sun doesn’t move.

In this case it is probably best to use a stationary light for your sun and use inset shadows for the object. This will cause each shadow casting dynamic mesh to get a shadow map that fits snugly around the object, instead of using a single huge cube of which only a few pixels will effectively cause shadows.

Inset shadows are the default for stationary lights, so simply changing your light to stationary should be the only change you have to make.

Thanks, that actually worked. For some reason it didn’t before when toggling off mesh distance fields, so I may have to put a warning up in the options menu that a restart is necessary.

You might want to test that in a build first, those kind of things tend to be handled differently in game versus the editor.

I actually ran into a different issue before building for shipping:

They’re receiving shadows from something that doesn’t exist.