So, I’ve previously attempted to create a moon texture added to the skybox, and this worked nicely, as long as the moon does not move. I had it set up to deal with occlusion correctly (clouds > moon > stars), and it provided lighting in the scene. Now, I’d like to create a blueprint and material that allows two separate directional lights, one for the moon, one for the sun, and create the sky material to match. The sun disc is easy, as that’s just a simple circle projected onto the skybox, and already built into the standard skybox (which I’m using as a base). The moon disc, however, is more complex. I’m not just creating a bright circle, but a textured object (for my purposes, I can’t just use a circle, either). I’ve managed to get this texture to follow the directional light, but because it’s projected onto a sphere, I can’t seem to keep a consistent shape and size.
I’ve seen people produce skyboxes with moon discs everywhere, and it’s such a commonly needed feature that I can’t help but think I must be doing something wrong. How can I render a texture onto the sky sphere such that:
- It remains a consistent shape and reasonably consistent size regardless of position
- I can move it around at will be changing the direction vector parameter
- It will occlude stars, and be correctly occluded by clouds (this rules out using a decal or 3D shape)
I can’t seem to get a system that allows all three at once. I’ve produced systems that give me any two of these, but I really need one that allows all 3. Can someone help?