# In a large space simulation, why is my sun light not reaching the planets?

I want to create a space simulation, but I'm facing some difficulties when I try to create a realistic sun.

Currently, I've a simple Point Light inside a sphere. But for some reasons, no matter the intensity and the attenuation radius of this light, the other objects in the scene (the planets, for instance) aren't lit any more if their centre are separated by more than 1.5 kilometres approximatively.

(Top) Lit planet, 1.4 km away from the sun.
(Bottom) Unlit planet, 1.5 km away from the sun.

Do you know what can cause this phenomenon? Is there a way to bypass it? If not, how can I create a realistic sun light in a large space simulation?

• The 1.5km mark probably comes from your fallof function (something like 1 / r² where r is the distance between light and geometry). That function will hit pretty much 0 at some point and no matter how high the intesity it`ll be dark. Try to modify your falloff to something that doesn´t go down as quickly. maybe (1 / 0.001*r ) or whatever. you gotta experiment a bit. Jul 13, 2015 at 15:56
• @LuisW Sadly, I've already try that. The limit between the two zones is hard: at some point, the planet is lit up ; one centimetre farther, it's unlit. Jul 13, 2015 at 15:58
• Apparently your simulation is too large. You need to think about ways to create the simulation on a smaller scale. Something similar to the way Kerbal Space Program does it. (They broke it up into a 1/6000 scale scene and a 1/1 scale scene mixed together). Jul 13, 2015 at 16:16
• @Byte56 Okay, it's look like that's the problem, indeed. Scaling down the sun, the planet and the distance between them by a constant factor has solved it. Now, I have to find the perfect factor, but that's another story. Anyway, if you want to make an answer from your comment, I'll be happy to give you some rep! Jul 13, 2015 at 17:00
• Well, it doesn't actually answer the question you've asked. It's more a of an alternative solution. I'd suggest you create an answer talking about how you solved the problem. Jul 13, 2015 at 17:03

It is definitely the size of your scene and the culling of light that is causing your light to 'disappear' from the planet at that distance. There were a lot of suggestions that are good and answer your question of bypassing it.

Another one would be to actually tweak the shaders in UE4 to accomodate lighting such a large simulation space as suggested by a UE4 staffer:

"If you actually need planets or objects to render with the correct light angle that are far enough away from you to get a different light direction, you'd have to do some shader tweaks. Thankfully, round objects like planets will usually look good without casting shadows just using an NdotL lighting term." - RaynB "Creating a massive point-light, has anyone tackled the issues with this?" (forums.unrealengine.com)

One that I have also heard of is the potential of using Light Propagation Volumes that are built into the UE4 engine... but it seemed like a concern that such a large space could still prove to be problematic.

Another suggestion would be to just turn off the Inverse Square Fall-off of your light to see if that works in your un-scaled simulation.

"...have you tried disabling exponential light falloff? You may have to expand the light properties a bit to see that option. Then the radius and exponent values should be literal and you can get as much light as you need. You might have quality issues with dynamic shadows in that situation however." - RyanB

If you are making a single player game with only one sun (they cannot travel between solar systems) the suggestion of rotating the angle of your Directional Light based on the player's position between the sun and view is another way to go about it.

"Pointlights are not really intended to work as a sunlight for a huge scene, >directional lights were created to solve many of the problems you will get by doing that. What I would probably do is use a directional light but use the level blueprint to rotate the directional light according to the player's orientation around the sun."-RyanB

Personally, If you want 1:1 scale simulations and need the lighting to work for that, I would suggest altering the culling of the UE4 shaders for this. Just remember that this may have a performance impact.