Hey! I’m trying to find a way to give rendering priority to one of my SpotLights.
I’m using the Future lightning, and some areas in my game have detailed interiors with bright, often complex lighting setups.
I also have a client sided flashlight that follows where the player is looking, giving a nice realistic effect. The problem is when the player enters these highly lit/detailed areas the flashlight starts to lag or “frame drop”, like it’s not being rendered as a priority (because it isn’t).
So basically, I’m looking for a way to make the flashlight always render as the most important light source.
Is there any way to achieve this? If not, this should definitely be a thing.
The reason that lag happens in those areas is because so many shadows are being drawn at once.
You should use the CastShadow property sparingly, really only when you have to have shadows.
Also it’s a good idea to disable CanTouch on anchored parts, unless it’s needed.
To sum it all up, when the property is enabled on a part, it makes the server(or client if it exists exclusively there) constantly check for an unanchored part to hit it, causing lag if not required.