For a long time, I had been annoyed by the shadows of stationary lights. The reason for that is that I had been making maps for various Call of Duty titles before I started working with Unreal, and the spot lights on CoD would turn themselves into dynamic lights.
These lights turn of when they go off screen and turn on again when the camera turns to them.
Also on some titles, we were able to decide how many dynamic lights would work on the options menu (4-5 on average).
Like directional lights, I don’t know when cascaded shadow maps will come for stationary lights. However, I almost got what I wanted with a BP actor.
There is a light that is stationary and movable in the BP actor, and there’s a cone mesh and a collision so as to check if the light is on screen. (this mesh has a transparent material)
Here’s how it works. I defined some base functions (radius, intensity, angle etc.) and these functions simultaneously interact with all the objects inside the BP. For example, the collision ball and the cone mesh enlarges when radius is increased.
After asigning certain values and rendering the map, the intensity of stationary light is multipled by 0 and movable light’s is multipled by 1 when the character enters the BP actor. That way, the stationary lights and their shadows stop functioning and, but global illumination lights stay and a sharp movable light works on top of that.
Stationary/Dynamic Hybrid Lighting.
There were limits to those lights on CoD (out 120, inner 90. it’s 60-45 for unreal), so I applied those limits. The reasonfor that is because when maximum values are used, shadows reach too wide and it may cause it to go out of the bounds of the cone mesh.
You can change their refresh rate by changing time. I made it refresh once in every half second.
We are still working on this lighting system. I’m sharing it with you as it is because I can’t seem to make it any better than it is. I would love to hear them if you guys have any different opinions or ideas about it. Thanks in advance.
I would like to thank the community member jacky for his valuable help.