Dynamic color change on lightning

Hi everyone!

I’m creating an oniric space in unreal, and I created a world sphere with a changing color texture. The logic of that color change is shown in the next screenshot:

Now I want to change my light’s color in the same way as the world sphere, but I have no idea about how can I cope that.

I tried making the sphere texture an emissive source so I don’t need any lights, but it’s not affecting the world, I suppose that’s because the sphere is too far from the player’s position and the light doesn’t reach.

If anyone has any idea I’d love to hear it!

Take care!

Try what you have here ( the concept ) with the directional light?

1 Like

^ that or use it on the skylight for ambient tint.

1 Like

I already thought about that, but I can’t just copy the material logic into the level blueprint or viceversa, since their nodes are not compatible, so I’m a little lost about how could it be done.

The same with that. It would be great, but I don’t know how to use material nodes into the level blueprint so I can change the skylight color.

Thank you both for your replies!

just do the same math in a ticked blueprint and set the light colors. it’s a global “in software” operation. no need to compute this in every material shader. and per pixel.

Oh right! I’ll try this out tonight, I’ll report the result later.

Thanks for the fast reply! :slight_smile:

1 Like

Recreating the same math it’s not working for me. It’s the first time I try to do this, so it surely is due to a mistake in the logic, but I can’t find the issue.

This is what I’ve tried:

well… in bp you have delta seconds not an absolute time. you gotta add it to a global time parameter and maybe frac it to not overflow the numeric value for this very effect.

I don’t really catch you. I’ll check some info about global time because I’m a bit lost. If you want to explain me better I’d be grateful, but you helped me a lot already!

It’s solved! I just replaced the material color change logic by a vector parameter, then applied the math of the last screenshot into it in the level bp every tick.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.