Realistic skybox

Hello… I started making a realistic day/night system with durations and height of zenith based on geographical coordinates and date .

The next step once I finish with sun/moon and day/night, is to make skyboxes (starting with the night sky) and then move to other things like weather etc.

My question, is there a way to make realistic skyboxes (or are there any premade ones) with the actual stars of the night sky (at least the most visible ones) instead of random dots? Also… Any idea how I could make it rotate depending on long/latitude and date so I have a realistic depiction of the night sky? In the end I’d like to be able to use a sextant to find your actual coordinates. I think the spacescape doesn’t offer realistic star placement and while I know there’s a plugin in c4d to do that, that I could create skyboxes from a 6 camera setup renders, I don’t have c4d. I thought of creating the stars from paticles so I can move them around (that is IF i can define each particle placement, which I have no idea if it’s possible), but I’m pretty sure there are more clever people with more clever ways to achieve this.

1 Like

I’ve been wanting to do this with the stars. Having an 99% accurate star map that I can put in a latitude, longitude, date, time, and light pollution and get an accurate result. NASA does have spherical star maps with various exposures. I haven’t started trying to implement it yet because I always got bad seams when trying to map it.

Here’s one of the maps, should be good enough to use as a starting point. I cannot seem to find the multiple exposure version of it I’ve seen before.

https://svs.gsfc.nasa.gov/3895

The math and calculations on how to get it accurate to the time of year and location is out there with a simple google search, should be easily blueprint-able.

1 Like

Thanks for that source. Didn’t think of checking nasa for it. Now I need to find a way to map the sky map (probably the celestial coordinates one) in a skysphere. Once that’s done it’ll be easy(ish) to animate it. But I have no idea how to map that on a sphere…

I assume the celestial coordinate grid is there to help make sure the projection is correct, I’ll try to mess with it later tonight.

I can’t work on it for the next month or so (need to finish with trimester finals first). After a month I’ll start working on it. Right now I’m just brainstorming plus doing the day/night on my free time, so there’s no hurry. But if you want to try it yourself if it can be mapped properly, I’d appreciate if you post your results here

Thanks for your time.

This topic comes up in searches but doesnt really have an answer.

here are a couple of things to consider when you are trying this.

  1. the default sky sphere is not really meant for this.
  2. the stars can and some times are visible before sunset.
  3. earth’s rotation… in unreal your stars need to move.

I will be making a tutorial on how I go about fixing this up and making use of the NASA files listed above once I’m done figuring it all out. Meanwhile, here is a brief tutorial that might get you started in the right direction.

  1. enable view engine content, find the skysphere, copy all of its files to your project folders.
    Make sure you don’t modify the engine files since any time the launcher verifies the file you loose all modifications.

  2. replace the defualt skybox with your copy and hook up the dynamic light. Refresh materials and make sure everything is working like the engine version.

  3. create an FBX with a sphere that unwraps into a flat map. You can use the grid off the NASA files to help in checking and scaling your UVs to fit.
    Remember to flip your normals. The sphere texture needs to be applied on the inside.

  4. import the FBX, open the copy of the sky sphere, drag the mesh to it and scale it up to be slightly larger and enclose the sky sphere.

  5. star material creation. You may want to preserve the scalar parameters and apply/remove on the render via blueprint. While in the BP you may want to create all the needed variables like LAT LON Azimuth and whatever else you might know or think you know. I still haven’t figured it all out or the tutorial would be done :stuck_out_tongue:

  6. remove star from sky sphere - simply remove the texture nodes. Change the material to enable opacity. Create a scalar to control the opacity.

  7. in BP on update sun direction take the sun height and clamp sequence for the opacity.
    the goal is to have a value between 1 and 0 based on the sun height. How you do this is up to you. I have my range between a-0.1 b.3 to a.0 b.1 this makes the skybox invisible and the stars shine through when the sun is below the horizon.

In a nutshell that’s it. The star map from NASA shows up in the sky at night instead of the repeating star pattern.

adjusting the angle and everything else based on Parallel Meridian and Date is something I’m still working on.

a couple of things worth mentioning:

The sun (and moon) or anything with a rotating movement actor end up getting stuck around 90 and -90 degrees. I’m not sure why but there are tons of bug reports here on the forums about that. The best way to tackle this is the exact same way that the Sun Height seems to work.

create 2 float value, angle and speed.
Add the speed to the angle and set the angle on the update function. If this value is above 360 set it back to 0. This should convert the game time (fed into the speed) into the actual angle of the sun or whatever is rotating in a value you can interpret more efficiently then -1 to 1.
I just use this value in world space coords to set the current rotation and solve any problem about things “snagging” and throwing my time table of sunset/moonrise off.
It runs very smoothly though I’m sure it adds overhead which might end up being an issue for mobile and slower computers at the same time it enables you to do other mathematical magic so it’s a necessary evil in my opinion.

Also worth a mention, the sky sphere “T_Sky_Blue” has issues. I’m not sure how I’m fixing it myself, but just know that once you notice the tiling issue you can’t un-see it :stuck_out_tongue:

Here is a GIF sneak-peak of how things look from the edge of my empty level map.

Is there an update on this?
I have just watched a Demo for the new Atmosphere but it seems it only supports sun data?? Im missing the stars and the moon.
Kinda look’s like the first half of what it could be.

Closest what i have found so far…