This latest update brought a much-needed rework on several systems while also laying the foundation for upcoming systems such as Light Probes, Baking and Day/Night Cycles! Skyboxes are now significantly more optimised, and approximately 2500 lines of duplicate/redundant code were removed from the project. Model LOD was introduced to allow for more optimisation capabilities for the artists, along with lots of minor bug fixes.
New Features
Level of Detail
Starting with the most anticipated system that came with this update, Model LODs are fully supported by up to 5 levels of detail. You can complete control over the distances between the camera and the object required before different levels swap out. Smooth blending has also been added as an optional setting which helps remove the ‘popping’ effect that many games suffer from, and instead of a simple fade between stages, you can choose to use a dissolving filter instead to create a less noticeable transition!
One problem we found from our previous experience and looking at another project is exporting lots of separate LOD files for each object is a time-consuming experience and results in a rather messy project folder. We have addressed this issue by allowing Bright Engine to detect the LOD levels of a model from within a single model file, so you only have to export it once, and Bright Engine does all the rest!
Skyboxes
The other addition made in this update was the skybox rework. Visually the results are identical, however, in the backend, the system is drastically more advanced. Memory consumption has been reduced by approximately 10%, and loading times have been reduced from around 4 seconds to almost nothing! In the next update, the Skybox is going to be getting another upgrade with the introduction of a room system, but we’ll talk about that later.
Changes & Improvements
Code Cleanup
One thing which we try to ensure is code quality, and going back through some of the older systems when working on Skyboxes, we found some pretty horrific stuff in the rendering code. We successfully removed just under 2500 lines of duplicate code that dragged performance down for literally no reason. There is bound to be more redundant code scattered throughout the project, so we will continue to be hunting it down and eliminate it!
We also took a look at zone switching and found some nasty memory leaks that managed to go undetected for quite some time, these have been sealed up. It was actually quite fortunate this happened because it lead to us also discovering a bug where textures for 3D models were being loaded twice! (yes, we fixed that too).
Alpha Blending
Alpha blended objects also finally work once again! This bug has been present for a long time, and we thought it was about time we addressed it, so Blending Alpha works perfectly and rather efficiently too!
User Experience
There were some small general tweaks to the UI, making it more responsive and make it feel less clunky. We also switched from Right Click Select to Left Click Select upon community request. We do intend to add an options menu in future where you will be able to set your own keyboard and mouse shortcuts to use.
Bug Fixes
World Editor
- Fixed a bug where creating a new project would cause the engine to create it as an older version.
- Fixed a bug where alpha Blended models didn’t have proper transparency
- Fixed a bug where alpha Blended models retained emission data from other models in the zone
- Fixed a bug where alpha Blended models had a metallic twang to their surfaces
- Fixed a bug where removing a cube map from the Cubemap Manager wouldn’t clear the memory from the temporary files, sometimes causing a crash
- Fixed a bug where Emission textures would only appear if Bloom was enabled
- Fixed a bug where switching between zones sometimes caused a crash
- Fixed a bug where switching zones while having an object selected would cause the 3D cursor to still appear in the new zone without anything selected
- Fixed a bug where some data of Terrain and 3D models wasn’t being removed from memory when switching zones (fixed memory leak)
- Fixed a bug where some data of the Skybox wasn’t being removed from memory when switching zones (fixed memory leak)
- Fixed a bug where adding a new Emitter sometimes gave the error that no emitters exist in the project even though they do
- Fixed a bug where adding a new Cubemap would not be picked up by the Editor until the engine was restarted
- Fixed a bug where calculations for the 3D cursor were being constantly repeated every frame instead of just once (which is all it needs)
What’s Next?
With this performance patch out of the way, we will be working on the last piece of the 0.1.2 patch series. The introduction of Rooms. Rooms will allow you to set the environmental settings of each zone in specified areas. For example, if your character enters a swap, you’d want to adjust the fog settings and ambient lighting to help create a damp, darkish environment rather than being stuck with a single collection of settings for an entire zone.