Adding Texture to a Directional Light?

Hello

I have a question pertaining to the SkyAtmosphere actor / component in Unreal. As you can see. I have a blank scene with a SkyAtmosphere and a directional light (since it is required for use with SkyAtmosphere) that I have renamed “Sun.”

I have included a rough mockup of the type of thing I’m trying to achieve. Would anyone be so kind as to to point me in the right direction as to how I would accomplish adding a texture like this to the directional light, aka the Sun.

Thank you for any insight … I am a big newb.

What effect would adding a texture have on the light, if you could do it? What are trying to achieve?

Ah… I don’t think that’s part of the directional light capabilities. Sure you can make it look like a disc, but there’s no configuration of the disc to make it look like a planet ( unless I totally missed a meeting ).

What you need to do is actually make a planet or star, as an actor, and put it in the area where the directional light seems to be coming from.

The directional light itself can be at 0,0,0. It makes no different where you put it.

Well since the directional light is necessary to act as the sun for the skyatmosphere component, I wish to customize the look of said light for artistic purposes, to make it appear like a giant planet / star on the horizon. The image I attached is just an overlay in photoshop to show what I’m trying to achieve.

There’s 2 images actually, one w/ the photoshop manipulation and one without it.

1 Like

Hmm … so you’re saying the only way to accomplish this is to track the “rotation” of the directional light and place an actor that follows and overlaps it since the skyatmosphere is using the rotation to visually represent the light’s position in the sky?

You could do that. Not too difficult. One blueprint containing a mesh. Because you’d want it to rotate as well ( on it’s own axis ), which the directional light doesn’t.

Like I say, if you want anything that looks like a typical sun, you can configure the default system. It’s only when you want otherworldly looks, you have to do your own thing.

Okay I will mess around with a custom blueprint for the SkyAtmosphere and the Directional Light and see if I can make anything happen. Thanks for the insight Clockwork I will try and report back if I find success in accomplishing this.

Ok that’s good. But to be clear, you can leave the skyatmos as is, and the directional light. But you new BP can contain the planet, move itself, and move the directional light along with it :slight_smile:

Oh … I see. Well I was just thinking since I’ve renamed the directional light sun and if the “mesh” / “texture” or whatever I use will be referencing the rotation property of the directional light …

Wouldn’t it make sense to just make a custom blueprint directional light and try and add that functionality to it? That way the new functionality would be contained within the custom dir. light blueprint and not a separate one that works in conjunction with a default light? Is that flawed reasoning? Otherwise I’m going to have to cast to the directional light every time instead of just being able to reference itself within the blueprint?

Sorry I really am new to Unreal trying my best to understand how all this works. I like to keep things organized and efficient if possible. I appreciate your help.

As a newbie, you have a case of ‘cast-itis’. No cast necessary :slight_smile:

I wouldn’t recommend putting the directional light in a BP. You can, but you’re probably going to confuse the sky atmos system ( if you’re using that ).

Best thing is your ‘sun planet blueprint’ to use ‘getactorofclass’ to get a reference to the light, then you’re set.

Did you ever figure this out?
I wanted to do the same with an actual “Moon” mesh I’d created, but found it very difficult to trace the Moon’s position across the sky with only the rotation angles.