- A few months ago, I created a full light transport simulation in order to create a baked lighting system. This was designed to completely replace or add onto Roblox’s current lighting engine.
- To summarize, this system is similar to a light rendering algorithm called Lightmapping used in early 2000’s game engines such as Source. Lightmapping is built for static scenes that don’t have multiple moving parts. Though it’s possible to incorporate dynamic lighting as well, the fact that a static scene is only rendered once makes this rendering option excellent for computers with low processing power, while still providing decent quality lighting, such as grid-based diffuse lighting and shadows for local and global light sources.
Demo scene rendered using the engine, can be found in the place file below.
If you would like a full tutorial on how to use this engine, check out the original post here, though keep in mind the place files are now outdated: Custom Baked Lighting “Engine”
- I ended up switching to using SurfaceGui’s as “canvases” for rendering shadows. This means that shadow tiles are now ImageLabels, and the calculations necessary to convert a position from 3D to SurfaceGui 2D space are taxing. Unfortunately, this makes the new engine approximately 0.003 seconds slower than the old version, though this isn’t always the case depending on the number of instances being generated. In the old engine, execution time would practically scale exponentially depending on the size of the parts. The current engine with the new optimizations rarely suffers from this setback now. This in turn also removes the ambient occlusion effect present in the old version, as SurfaceGui’s clip ImageLabels outside of the size of a part.
- This change had to be made in order to come with the benefit of allowing hundreds of more instances to be generated without over-reaching Studio’s max execution time. Meaning that entire maps such as Crossroads or to some degree, even entire Baseplates can now have Lightmaps rendered onto them in less execution time than the old engine.
- A common issue with edges of shadows appearing brighter even when in shadow is now mostly fixed. This was a result of the size of the Lightmap grid being set incorrectly during rendering.
- Light source diffuse attenuation has been changed to more accurately include Range. Though this is less accurate to how other engines incorporate light sources, it’s more in tune with Roblox’s light falloff.