How do i turn a light source into a 3D mesh?

Greetings everyone!

I’m very new to game development so im currently learning many things throughout the course of my project (UE5), and recently i see myself with an issue that i have not been able to solve for the past few days.

Currently i am working on a day/night cycle for my project. The cycle itself is already made and works as intended. For context, i made 2 light sources, each one representing the sun and the moon. I also created a 3D mesh of the moon which is currently stationary.

My objective is to turn said 3D mesh into the light source. At the moment the light source that represents the moon is just a sun (appearance-wise) with 0.9 Lux in order to simulate night time, which i want to replace with my 3D mesh mentioned previously. Sadly i have searched alot for the past few days and i have found nothing that would help me achieve what i intend to do.

Can someone help me with this? Thanks in advance.

It’s not directly possible. The way it’s most commonly done, is to use directional lights, and use a flat image to represent the sun and moon.

But, fret not. You can still use your directional light for the moon, and just make the material on the moon emissive. If you do it right, it will look exactly like the light source.

How do i do that exactly? if i may ask

I got a moon image from google. It’s not a proper UV mappable texture, but it will do for now. Then I made this material:

In the instance, I made it a bit blue, with some emissive:

I popped the material on a sphere, and the I put a blueish directional light in the scene.

Just tested it out and looks exactly how i wanted it, thank you for the suggestion! now i just need to find a way for the mesh to follow the light source and its done

1 Like