(First of all, sorry if this post is tagged wrong I dont make posts often)
Anyway In my experience lights are pretty laggy and unoptimized, tanking fps if you have allot of them, im just curious if setting up a simple client renderer is more performant than having them on the server.
rendering them on the client would allow for proximity checks and chunk based rendering, which “should” improve performance.
ive genuinely never looked into this before, im curious if anyone has given any thoughht to this and can tell me if its a solid method for optimization or if I should just not bother and leave it all on the server.
i guess you could and it might make a different but the way i would go about it is move the rendering of lights to the client while keeping the server responsible for managing light logic and render lights that are close to the player by using proximity checks and chunk-based rendering to load lights from nearby chunks while removing those from faraway areas
having lights and all vfx on the client is the best way to go in terms of performance and latency reasons. you can use remote events or bool values to determine if the lights should be on or off from the server.
not sure what you would mean by rendering “on the server” but creating a light instance on the server or on the client serves no difference performance wise.
now, using proximity checks can be helpful for performance, that would make a difference, but given how roblox already occlusion, frustrum and distance culling, its hard to tell by how much truly.
chunk based rendering would be most useful in your case, but it works best if your environments are indoors and don’t have line of sight of other nearby chunks.
exploiters can manipulate the lights regardless of where the light instance is created (server or client), any instance that the server creates the client can modify or outright delete, its just that the changes wouldn’t reflect back on the server.
Hi, great question! There are actually two types of lighting in the roblox engine:
Environmental lighting
Spotlighting
These two behave differently. Environmental lightingare lighting that are within the environment like sunlight, moonlight, ambient light,… this type of lighting requires server to run. On the other hand, spotlighting are lights that we place, things like spot light and the other lights. You can actaully have a script that turn spotlighting on and off depend on the client position within the map, as well as the shadow associated with it to increase performance. Hope this helps!
I’ve never considered that, probably a good solution, I just know how expensive lights specifically pointlights can be when you have allot of them, so i was looking for a way to get some extra performance
Thank you for the reply! in my experience the new occlusion culling doesnt actually derender any lights or shadows its just assets but that might’ve changed since I last checked.
I’m aware of the risks involved, especially when it comes to exploiters but these objects are strictly non interactable, just decorations. I just want to minimize how many lights are actually being rendered in game to get that little bit more performance.
thank you for your honesty in your reply, I’m definitely going to experiment with the chunk based rendering as I think even though the performance benefit might not be as large as I want it might help with lower end devices.
Yeah then my solution is perfect for you. However in order to understand more in depth for an effective solution for the problem we are trying to solve, allow me to elaborate further! The most costly part about lighting isn’t necessary the light illuminating itself, it’s the shadow that the game has to calculate dynamically in the environment in order to provide real time casting shadows. Also by getting rid of the shadows, from a distance everything would still look normal for the players and the client doesn’t have to calculate far away shadows. Now that you understand this, light is not the thing that you have to deal with but the shadow is! Here’s a video that one of my friend made regarding the topic: