Large Update - PointLight Rendering, Optimisations and More!
Hey all, this update introduces lots of needed changes and additions.
Let’s start with the biggest addition,
PointLight Rendering with Real-time Baking
Yes, that’s right! We now have a proper support for lights!
Not only that, but light rendering is super fast and uses a lot of optimisation methods that hardly affect frame rate or memory usage at all!
No light rendering (disabled) - 104 FPS
Light rendering (enabled) - 99 FPS
How does this run so well?
Real-time baking
Well first of all, with static lights that aren’t being updated or moved, light calculations are done only once upon in view! The pixel results are then baked into a global 3D cache storing the light’s colour and brightness information of that coordinate with buffers.
This results in incredible performance. Even with 50+ Lights being rendered
However, light calculations will be recalculated every time a light moves or has it’s properties be changed.
Here’s a visual of the baking in action:
(Red shaded pixels = Light calculations)
Frustum and occlusion culling
I have also added both frustum and occlusion culling to the lights, ensuring that only lights you can see will be iterated through during raytracing. This will result in maximum performance and allows users to have lots of lights spread through out their world without consequences!
Please note that currently only PointLights parented to Parts are supported.
Other lights such as SpotLights or SurfaceLights may be supported in a future release
Here’s the full change log:
-
Added support for PointLight rendering
-
Added glass distortion for transparent parts with the glass material
-
Added a new setting which allows the skybox to darkened depending on clock time
-
Improved global lighting for day time
-
Heavily optimised pixel rendering performance when Interlacing is enabled (2X faster)
-
Changed the GUI’s ResetOnSpawn property to false to prevent reloading of the whole rendering after each respawn.
Special thanks to @geocolada for providing a bit of code for the glass distortion and giving me the idea to add light rendering