Bright Engine v0.1.5b Released – Shadows & Effects Expanded

March 5, 2019

After two months of vigorously sweeping through thousands of lines of code, ripping out old systems with new ones and altering the architecture of the renderer, we are very proud to present a much more visually stunning engine! With brand-new lighting algorithms, advanced shadows, new post-processing and more detailed GPU diagnostics, Bright Engine has drastically improved both its performance and results!

New Features

Reflection Probes

In order to achieve accurate and realistic lighting for any game, reflections play a huge role. Even if they aren’t crystal clear like a mirror, the amount of detail reflected off a smooth surface defines much of the material properties and why it may not seem like it in real life, reflections are everywhere. This problem has puzzled game developers for years as simply reflecting the world in real-time onto each object is far too expensive to maintain 60 fps. So how do games pull it off? Well, they fake it with Reflection Probes!

A reflection Probe is an invisible point within the world which stores a baked render of the scene around it. Whenever an object is within the specified range of the reflection probe, it will use the corresponding baked data when calculating the specular reflections. Through clever placements and smart blending between probes, you are able to effectively fake real-time reflections of your environment without your player even noticing and with virtually no impact on the frame rate!

Bright Engine now has an entire Reflection Probe toolbox, including the ability to bake the surrounding environment from within the editor! This baking system has laid the foundation upon which we will expand for other baking solutions in the future, such as lighting and shadows!

Changes & Improvements

PBR Shader Fixes

Bright Engine’s visuals, while initially decent, simply weren’t decent enough, and so we fixed that problem by pretty much rewriting the whole lighting system. But before we dive into that rabbit hole, we had to perform some cleanup in our PBR shaders and discovered a lot of redundant code, which was dragging performance down. While developing the Reflection Probe system, we uncovered some serious maths errors when it came to normals. The calculation of the TBN matrix was incorrect but only noticeable when looking directly down on top of a smooth surface, which resulted in an inverted vortex reflection instead of the correct sky reflection.

As you can see, we fixed the maths but, at the same time, found a much more efficient method of calculating the matrix, which lead to a small boost in the general performance of the entire scene! This further led to our parallax occlusion mathematics. While it was correct, the chosen method resulted in a large unnecessary overhead, so we rewrote that, too and managed to get better results than before!

Subsurface Scattering

Now let’s talk about lighting. Most of the problems that existed before were discovered to be caused by the incorrect normals, but with the old method, everything was treated as if it had the density of a neutron star when in fact, in reality, different materials absorb and reflect light in very different ways. Ever noticed that the lighting on dynamic foliage was horrible when a light source was placed near it? Well, that’s because, in reality, light can partially pass through materials like leaves or skin, illuminating the other side slightly.

The scientific term is Subsurface Scattering, and that’s exactly what we have added to the PBR shaders to fix this problem!

Materials now have a new collection of settings which allow you to control the intensity of the effect and apply thickness maps for an additional level of detailing!

The process of Subsurface scattering has a history of being quite a performance-intensive one. However, our approach with thickness maps means it has virtually no impact on performance. But we have added options to disable it for individual objects where it is not needed!

Shadows

Let’s talk shadows. They remain one of the most costly rendering operations for modern engines due to the additional draw calls. Regardless, being the stubborn developers that we are, we looked for ways to not only improve the quality of Bright Engine’s shadows but also increase their efficiency. This was no easy task, and yet we manage to succeed! The biggest difference came from a revamped drawing architecture when calculating real-time shadows for Point lights.

Aside from the faster data transfer between the CPU and GPU each frame, it also freed up 3 texture unit slots which was a particularly useful upgrade for the terrain shader as it allows for the possibility for additional textures to paint with!

Visually speaking, shadows got a complete makeover! With new options for fading and bias control, the quality of detail has significantly improved while giving more power to the user. One long-standing problem, was shadows were calculated based on geometry which caused this visual error

While shadows are still geometry based (as this significantly improves performance), we added some additional trickery to introduce alpha consideration, solving the above problem and producing accurate shadows!

Onto more specific shadow casters, Spot Lights now officially cast shadows! This has been something we’ve wanted to add for a long time but kept pushing down the list due to other priorities. But after a long put-off period, they are finally implemented (the community insisted!)

The last shadow upgrade was that of a directional nature. Directional shadows are probably the trickiest to get right due to the notorious Peter Panning visual error. In layman’s terms, this is where shadows become misaligned with their casters due to the inaccuracy of the depth buffer over long distances, and Bright had a serious Peter Panning problem!

Truth is, it’s just not possible to have a global solution due to the infinite possibilities of environment design, so we simply opened up the drawing settings to the user, and while not perfect, it is drastically better!

Post Processing

Moving on from the lighting, the next biggest method of making stuff pretty is Post Processing, and we have doubled the possibilities of our suite by adding a plethora of new effects and settings!

  • Filmic Tonemapping has made its appearance with complete control over the colour curve.
  • Additional Color Correction settings to add even more vibrance and contrast to your scene.
  • Refine your render clarity with sharpness modifiers
  • Depth of Field with three-dimensional focal points and transition blurring for epic results
  • Chromatic Aberration for the simulation of physical cameras

When combined together, the improvements are frankly astounding!

GPU Diagnostics

The addition of all these new tools and rendering methods adds a lot more data to be diagnosed for the smart developer. We thought we would help out by expanding the GPU diagnostics suite to display a lot more useful information. Aside from a more in-depth analysis of draw calls (along with the inclusion of the newly added spotlight shadows), Depth buffer visualisers have now been linearized, so it’s significantly easier to see what is going on in the scene. We have also added a new real-time graph which tracks draw calls and performance to visually show which parts of the scene are the most resource-intensive, along with identifying areas that may need further optimisation!

Code Cleanup

The final focus of this update was the Editor itself. Over the years of development, our knowledge has expanded and looking back through old code fills your mind with questions like “What on earth is that rubbish?!?”. While it takes more time to continually improve code, we are determined to ensure Bright has always got the best possible architecture for both performance and general tidiness. This resulted in us spending a week reworking the Data Management system of Bright Engine.

From a user’s perspective, there will be no difference, but when taking a look under the hood, then a wonderful surprise lies in wait. We removed nearly 1500 lines of unnecessary duplicated or redundant code while also streamlining lots of methods into a single function. Not only does this save on memory (albeit small) it saves us a lot of time when implementing new systems as we only have to edit one function instead of the original five (and that was just for adding an object to the scene)!

User Experience

In terms of the less technical stuff, interactions with spotlights are now far more pleasant, with a new rotation system and a blocker to prevent you from setting the outer radius of the cone lower than the inner radius, which produced some pretty nasty results.

We have removed the post-processing section of the Render Panel as all the settings are now located within the Post-Processing Panel itself, along with adding new visualisers for debugging.

And to top things off, we found further improvements to the UI integration reducing overhead, allowing for faster data passing between the CPU and GPU and adding helpful dialogues that prevent adding a model or texture to your scene if it is not located in the correct folder of your project (before it would just add it and crash).

Bug Fixes

World Editor

  • Fixed a bug where duplicating an object without then editing it would prevent the zone from being reloaded.
  • Fixed a bug where changing the enabled state of post-processing effects without changing any other settings would cause the data to save incorrectly, inverting the chosen settings.
  • Fixed a bug where Spotlights were not correctly reflecting off smooth surfaces.
  • Fixed a bug where adjusting the strength value of a spotlight did nothing.
  • Fixed a bug where adjusting the flickering settings of a spotlight did nothing.
  • Fixed a bug where the UI for flickering lights was not enabling/disabling properly when turning it on and off.
  • Fixed a bug where post-processing settings for a zone sometimes would be reset for no particular reason.
  • Fixed a bug where Fog was not correctly rendered on terrain, causing it to lose density if the camera was rotated.
  • Fixed various mathematical errors in the PBR shader for Dynamic Foliage.
  • Fixed a bug where Disabling rendering Shadows caused strange artefacts on terrain and dynamic foliage.
  • Fixed a bug where Dynamic foliage was being incorrectly illuminated by Point Lights.
  • Fixed a bug where the sculpting brush would sometimes appear black.
  • Fixed a bug where creating more than one foliage layer caused dynamic foliage to draw incorrectly.
  • Fixed a bug where adding a new object to the scene didn’t update the hierarchy correctly.
  • Fixed a bug where data wasn’t being cleared from the memory correctly when generating textures. (memory leak)
  • Fixed a bug where deselecting an object by clicking in an empty space caused the 3D cursor to linger.
  • Fixed a bug where textures were being flipped upside down (this problem still persists for DDS format, a temporary solution is to manually flip textures in image editing software).
  • Fixed a bug where texture quality and grid size wasn’t being saved.
  • Fixed a bug where texture quality didn’t apply to Terrain and Dynamic foliage.
  • Fixed a bug where selecting a texture for Terrain or Dynamic foliage caused an update even if the cancel button was pressed.
  • Fixed a bug where selecting a Foliage layer, then selecting a different object, and then re-selecting the terrain object caused a crash.
  • Fixed a bug where enabling SSAO disabled baked AO textures
  • Fixed a bug where instancing wasn’t correctly removing objects from their corresponding cores if over 299 duplicates existed.

What’s Next?

We now enter into our final update of the 0.1.5 series. As previously stated, these updates are entirely focused on improving on what we already have before we begin the next chapter of Bright Engine’s development (Gameplay). So what you can expect from the next update is a vast collection of bug fixes and general improvements, along with a few new features to top off this rendering upgrade patch!

Home » News » Patch Notes » Bright Engine v0.1.5b Released – Shadows & Effects Expanded
Bright Engine 2022 R3 Released – Performance & Optimisation

Bright Engine 2022 R3 Released – Performance & Optimisation

Continuing on from the upgrades introduced in R2, the engineering team have been redesigning major parts of Bright Engine’s rendering system. Plenty of redundant code has been removed, and significant chunks of the CPU-sided code have been rewritten to be both more memory efficient and reduce GPU idling.

Bright Engine 2022 R2 Released – Performance & Optimisation

Bright Engine 2022 R2 Released – Performance & Optimisation

It’s been two months of an architectural overhaul for the Bright Engine render pipeline. The engineering team have been making substantial changes to how the engine draws the scene, resulting in significant performance boosts without loss of graphical fidelity. Let’s dive under the hood to see what’s changed.

Bright Engine 2022 R1 Released – UI & Resource Management

Bright Engine 2022 R1 Released – UI & Resource Management

After months of programming, the time has come again to show off what our engineering team has been up to. A lot of under-the-hood architecture has been rewritten, drastically reducing memory usage and improving frame rate. Meanwhile, a brand new UI system and editor have emerged. This is more of a technical update than a visual, so pretty pictures will make a return next time.