How to make a physical sun that affects the whole scene with urp?

so i use URP i want to make a star gameobject that can light up a whole scene which also features moving planets i was able to do so by using a point light component but it broke and i cant fix it anymore and i dont want to fake it if there another way

i just found out that the intensity was too low but if i turn it up it give rather weird results so the only way i can think of is pointing a directional light at the camera this is not really what i wanted but i dont have a choice

Your problem is probably light attenuation. In Unity it’s set to some kind of physically accurate number based on optical properties of air and whatever. Looks good if you are making a realistic, earthbound, every-day, real-life scenario, but doesn’t work for space. In space there really is no light attenuation because there is nothing physically blocking the light.

Unfortunately, it’s not a setting that you can just change. If you search around you can find where people have written their own custom shaders to work around this limitation.

1 Like

You can probably do this with a point light and you’ll want to disable shadows on the planets. As I imagine shadows will work in a very funky way at that scale?

If the fall off is a problem, you may want to do one of two things, look into custom shaders (therefore excluding light fall off entirely), or look into modifying the light fall off. There’s some forums here for that.

If you’re talking about doing like space and then showing the planet surface, you might want to try transitioning to a directional light with shadows in that scenario.

1 Like