Download

Moon texture in Skysphere

Hi, is possible to add a image (moon) on skysphere, and controll it? I want like the Sun… but idk how I can put the texture by vector direction.

Buuuuuuuuuuuuump

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.

so, you tell me to create a plane object and textured?
I can add the 3d moon, but I don’t know what to say about quality…

If you have a 3d moon model then by all means use that, that is not changing any of the steps I talked about. You will still want to use the same orientation tricks. After all, there isn’t an album called the dark side of the moon for nuthin.

Can you give me an example for this?

Its just a plane mesh with a circle texture of the moon on it. What do you need to see? There are plane meshes in the ue4 engine content folder already and there are also textures that are circle shaped. Just go to engine\content and set the filter to show meshes and then set it to show meshes and scroll through and you will find them.

Its just a plane mesh with a circle texture of the moon on it. What do you need to see? There are plane meshes in the ue4 engine content folder already and there are also textures that are circle shaped. Just go to engine\content and set the filter to show meshes and then set it to show meshes and scroll through and you will find them.

But as I mentioned, the mesh itself is not important. Just use any old sphere mesh in the engine\content folder for now.


This?

EDIT:

I did this

I set Translucent at Blend Mode, and in Photoshop I entered in Layer - Layer Mask - From Transparency
And I saved it .psd, how I can fix it?

EDIT2:

Fixed

I changed Blend mode in Masked.
The texture set to Emissive Color
And the alpha channel to opacity Mask