UE5 - Add a Moon Mesh/Texture/Material to SkyAtmosphere Directional Light (Index 1)

As the title suggests, I want the moon to actually look like the Moon, and not a floating light across the sky.
I’ve followed a tutorial found on YouTube to do the lighting, and get the stars to appear during the dark hours throughout the day, but the “Moon” itself is just a blue-ish light, and it doesn’t look realistic.
I’ve created a sphere object and wrapped a moon texture over it as a Material and given it a bit of luminescence but I cannot figure out how to bind it to the “sun disc” that’s in the Sky Atmosphere…

I’ve so far tried to bind the Moon mesh to the “Stars” mesh, and then the stars are rotated based on the directional light rotation (this looks fine in the blueprint preview), but when playing the actual game, the anchor point for the Stars mesh is massively outside of the Stars mesh (even though it isn’t in the blueprint) so the moon is nowhere to be seen because its beyond the SkyAtmosphere and seemingly doesn’t render in.

I can’t help but feel like I’m missing something simple with this… any thoughts/ideas?

1 Like

Anyone at all able to shed some light on this?

I am looking into to this now, if i find a solution i will re.

The proper way to do it is a custom sky material that takes the directional light vector into account and generates the moon with a texture flip map (because the moon does have phases).

I doubt you’ll find any good tutorials relating to the mess that is ue4 or the even worse mess that is ue5.

That said, you can access the light vector in the newer sky athmosphere material according to the videos/talks of the past.

Or you can - which in all likelyhood will be much better towards all aspects - revert to a more similar system to the old sky sphere blueprint.

A sphere, with uvs mapped appropriately (distortion at tops), where you overlay parts within the material to create the sun and moon disks with the proper declinations based on light vectors and parameters.

What you don’t do, is pop a mesh in there and call it a moon…
You can - while still achieving somewhst realistic results for static shots - but it will give tons of issues ranging from mesh size, to shadow casting, to not moving correcly or having light artefacts when used in games.

Generally speaking, look for engine independent stuff off gpugems or similar game dev / shader sources.

Likely anything makred unreal with sun/moon day cycle will be complete trash that will teach you how to absolutely do nothing right. There can be excpetions ofc, but I seriously doubt it.

1 Like

Sjoerd de Jong has a presentation on this. Exploring the depths of the new Sky & Atmosphere system | Unreal Engine - YouTube - he uses a moon model, not just a texture. It is not explained in depth, but maybe this can be helpful for you getting an idea.

1 Like

I haven’t had chance to review this yet - but this looks like it could be the right thing. Once I get chance to get back into UE, I’ll let you know if it covers what’s needed.