Material: Is it possible to clamp a texture to a sphere mask?

I’m trying to create a dynamic moon for my sky. The sphere mask approach used in the BP_DayCycle_Skydome work’s well for the sun, but not as well for the moon. If possible, I’d like to keep the same approach for the moon, but add my moon texture on top of it.

The closest I’ve gotten is using the sphere mask as the alpha that lerps the sky and moon texture together. However, the UVs on the moon don’t scroll so I end up with this effect:

How would the math work for the moon uv’s to keep these clamped together? Is there a better way entirely to go about this for a dynamic moon? Any help is appreciated!

Hey Breakobs -

The short answer to the question is no you cannot clamp a texture to a sphere mask. You will need to use a separate mesh, billboard or particle system to get the effect. A colleague has answered a similar question before and here is how you would go about setting that up for a billboard, How to rotate a billboard around origin? - Programming & Scripting - Unreal Engine Forums.

You could use this logic and tie it into your light vector location from the material above and still have them both work on the same logic.

Thank You

Eric Ketchum

Hi there,

i know this question is a bit old but maybe someone will find it helpfull: If you want to clamp an image to a spheremask you would use a skyboximage-node in material editor. You can place an image at your sky-material using a 3 dimensional vector (similar to spheremask + cameravector and dotproduct) for positioning. Furthermore you can adjust the scale and rotation of your image. The node gives you the rgb (tiled and repeated across the whole geometry) and apropriate masks to remove the tilings.

You may checkout this answer: Updating Custom Sun Texture Using SkyboxImage - Community & Industry Discussion - Epic Developer Community Forums