Moon Mesh Sky Sphere Overlapping

I saw a post that describes what I’m trying to do.

I have a moon mesh that I put in the sky, however, it’s in front of the clouds. I saw a post on here than RyanB commented on saying

"I would do this by adding a separate mesh in the sky that is just a simple plane mapped with 0-1 UVs and the moon fitting to its extents.

Then you just need to set a “LightVector” for the moon. This can be any normalized vector to position it. Just normalize the vector and then multiply it by the length of the radius of your skydome (slightly less to avoid going behind the sky, or make it translucent and disable depth testing, either way). Then you need to set rotation using “make rotation from Z vector” and the z vector needs to be your light vector times -1. You may also want to specify either an X or Y vector to control the rotation of the moon itself. You can use “make rot from ZX” or “make rot from ZY” as they will both work depending on if you are specifying an up or side vector. Just make sure the Z is first so that it is prioritized.

Then you just scale the mesh accordingly.

You could also of course solve this using coordinates in the world in such a way that allows you to project the texture right into the sky dome but that method is a bit more advanced and relies on some transform math."

Now I’ve been trying to do this, but I’m so confused. I’m new to UE btw, but I can pick things up easily if explained a bit better and not as shallow.

I know I need blueprints, but light vectors, there’s so many and what do I plug into it to start? My minds is spinning!

Help appreciated.

I can tell you from Ryan’s description there that even if you did get all this light vector stuff working, the moon would still be in front of the clouds. This is because ( I assume ) your clouds are drawn on the skysphere.

The only way to get the clouds passing over the moon is to have them in a separate layer and have the moon texture slapped on the sky.

In fact, I have no idea how to do this, and just use:

All you have to do is set the time to midnight :slight_smile: ( and, no, it’s not my asset… )

I figured that much, only problem is I want the moon to have a texture. I’d much prefer to do this with a bit of help than buy it off someone, then I’m not learning much.

You would need to create a BP actor with at least 3 components.
A skysphere mesh for the atmosphere and the sun to appear on.
A mesh for the actual moon itself.
Then a mesh for the clouds.

The reason the clouds always appear in front of the moon is because the clouds are a part of the skysphere material.

I hear you. Then I’d suggest doing the stars and moon as one texture, put that on the inside of a large sphere. Put the clouds on the inside of a smaller sphere, then they will pass in front of the moon.

Would I do that with blueprints?

You don’t need them yet. The night sky is just a texture on the inside of a sphere. The clouds are a material.

Sorry about the questions, I am new to this, I only downloaded UE4 a few weeks ago.

So do I modify the Sky Sphere mesh or make a new one? I am currently using the one UE4 provides

I fear there’s a ‘slightly’ rocky road ahead :wink:

First of all you need to know about using HDR as you screen background:

Easiest thing is to get an HDRI map ( same as HDR ) of the night sky with a moon in it. Something like:

There’s a lot of free ones around, but you have to get one without land in the picture, just the sky otherwise it’s gonna be a real pain.

Once you have that you can basically connect it as the texture to an emmisive only material. Come back here when you get that far, there are some details you need, but I don’t want to type Lord of the Rings here…

Do also try putting just a simple night sky image on the inside of a sphere, but I think it might look weird…

Try it with this one, I think you can hide the ground with UE4 stuff:

Would I need to have multiple hdri backdrops? Say one for the moving clouds, etc? Could you please be a bit more specific? Thank you

No, you have one HDR for the night sky and then you do the clouds as material on a sphere.

You can’t have multiple HDRIs. Once you have one in the scene, it occupies all of your soundings. Try a free one :wink:

Here, I made a little sample project:


I will leave a link in a moment…

( you can make the cloud ball bigger obviously… )

I’ll try that, thanks, I’ll come back if I need any help.

So stars and all that stuff for the regular sky sphere, but clouds for the HDRI plugin backdrop? That does make sense.

Take a look in the project I gave you. The stars are HRDI ( it was free ), and the clouds are just a material on a sphere.

Thanks, I did take a look, I thought you were talking about the HDRI plugin, but that was someone else. What I want to do with clouds is have it in a cel shader style like anime or cartoons, I can add the texture to a sphere but the textures on the outside, how do I ‘invet’ this? If thats even the right word to use. Thanks a ton!

Just click ‘double sided’ in the material :slight_smile:

Saw it! Thank you! Also, I’ve been stuck trying to have the clouds ignore lighting so they don’t cast shadows that make them look fake. Is there a way to do this? I’m making a texture for the clouds instead of a mist kind made from materials.

I don’t notice any shadows from the material I gave you, but you can always untick dynamic / static shadow on the sphere I guess…