Solar System Lighting & Shadowing

So I’m itching to make a space game, kinda like (Long list of space games…)

So I first wanted to make sure unreal could handle long distances.

This seems to be ok with origin shifting and or keeping the camera / player at 0.0. So this passed.
I then tried multiple lighting solutions and found the best method was a directional light that does a lookat rotation transform to the player/camera. Put the directional light in the middle of the sun with a sun shader. So this passed.

So far so good, we have long distance (talking all 9999999 cm in the coordinates) scaling is working (talking 10000 or more).

Lighting is all 100% dynamic. I plan on having the planets move and rotate and have multiple moons, gas giants, etc ,etc.
Got a little solar system setup with a ship that I can fly around. everything looks awesome and majestic with a space skybox… etc .etc…

Everything seems good, but then I run into a snag. I used JBaldwin saturn planet, which is awesome btw (FX Gas Planet Starter Kit vA - Marketplace - Epic Developer Community Forums)
So i had a full working solar system… until… I added in moons and tried to get a few of them to cast shadows on their planets, and I also tried to get a shadow casted on the rings of the gas giant.

I’ve tried light mass volumes, i’ve tried changing shadow cascading options, I’ve tried changing lightmas options, I’ve tried turning on Distance Field Soft Shadows and adjust those settings that come with it.

So I feel like I’m stuck. My only option is to make a static solar system, problem with this approach is I would have to create a directional light from the center of the solar system for each planetary body (or major grouping of planets).
But this would also look weird since i now have random directional lights in random directions, which would affect ships nearby the planets or flying to and from.

Has anyone tackled this problem? Not sure what my options here are. Only two i can think of… try this in unity, or start digging into the unreal engine source code and overide the shadow restrictions. (max out shadow cascades)

Have you tried enabling Far Shadows option for those planets and moons? That’s a 4.8 and above feature, by the way.

For the lighting are you rotating the directional light based on the player position relative to the sun (as there’s no way to simulate a giant point light right now) unless you’re not able to move “around” the sun? You should just use one sun to light the whole environment and set the light direction as player position subtracted from the sun position.

Haven’t heard about this. I’ve messed around with the shadow cascade options on the light, changed the distances (it maxes out at 20000) and tweaked a bunch of other settings. But if the camera is too far away from the planet or moon, the shadow vanishes. (I’m not that far away really… maybe .5km but the planet and moon take up half my screen, shadow vanishes)

I found this he’s having similar problems… Shadows disappear with increased camera distance - Rendering - Epic Developer Community Forums

Yes its a light blueprint in the center of the solar system (its a sun mesh with a directional light in the center of the mesh) It just constantly updates and aims at the player/camera so if I visit any planets they are lit up and same goes for my ship or ships/stations nearby, basically it emulates how a sun would act in a solar system, since unreal does not have a omni directional light (they should add it!)

Yes its a light blueprint in the center of the solar system (its a sun mesh with a directional light in the center of the mesh) It just constantly updates and aims at the player/camera so if I visit any planets they are lit up and same goes for my ship or ships/stations nearby, basically it emulates how a sun would act in a solar system, since unreal does not have a omni directional light (they should add it!)
[/QUOTE]

Point lights are omnidirectional. But if you can cope with directional light changing direction towards camera position then distance field shadows should be perfect. If you only have couple planets you could calculate shadows from point light at light function material. Basically you just need to test intersection of light ray with all shadow casting spheres.

Yeah my first attempt was with point lights and maxing out the light intensity and distance. Point lights can only light up small scenes. Maybe a football field in size (maybe a little bigger). Any thing bigger than this the light doesn’t reach.

The solar system im making is not a real to scale solar system, but a mock one that seems big enough (stuff is pretty far out, like 500,000cm or more).

Maybe ill get a screenshot together showing an example of the light/shadow limitations on large objects and or distances.

So here’s an example of what I’m talking about. You can see the 3rd person model to the left on the platform. I did 4 examples, here, each example I move the spheres further apart and make them bigger.


First sphere is at 0,0,0 and then another sphere is at 5000,0,0. this one you can see the shadow.The perspective makes it look like its right above the platform.
The next sphere you can see the shadow. Next 2 pairs there is no shadow. They are just the sphere mesh, one scaled at 40x and one at 80x. on is 40000 away and the other 20000.
If I move the camera closer you can see the shadows. But as I continue to scale, to make planetsize spheres, gas giants, etc etc, the shadows just don’t work anymore unless I light map them. But if I do that, I can’t have planetary bodies
revolve around the sun realtime.

bump up from 2nd page.