Progress Update: July 2019


#1

Hi guys, time for progress update for July!

This has been a very busy month for me, and I didn’t have as much time to focus on bsf as I’d like.

We did get some stuff done however:

  • More bug fixes for the editor, with a focus on macOS version, Vulkan and the animation window
  • Brand new screen space lens flare effect!
  • Bulk of the work done on a Bokeh DOF effect (not yet pushed, but on its own branch)
  • Bulk of the work for HDR color support in the editor
  • Overhaul of the GPU pooling system
  • Animation system rotation overhaul

Highlights

Screen space lens flare effect


Lens flare can now be enabled through RenderSettings::screenSpaceLensFlare. The effect works out of the box, with no additonal setup required, but you can tweak various options to control where and how it shows up. I plan on adding a separate fully customizable lens flare system in the future as well, for those that need exact control.

Bokeh DOF

I’ve written the majority of the shader and C++ code for a new Bokeh DOF effect. It’s a much prettier type of depth of field effect, compared to the current gaussian depth of field. But at the same time it comes with a significant performance cost and should mostly be usable for cinematics. I also plan to add another depth-of-field effect, that’s closely follows physical properties of a real-world camera, but more on that later.

You should be seeing the full effect running in early August.

HDR support in the editor

So far the GUI elements in the editor assumed a low-dynamic range (i.e. 0-1) colors. I’ve updated the color picker so it allows control over color intensity (i.e. colors outside of [0-1] range), and added [hdr] attribute to BSL and [HDR] attribute to C# to mark colors as HDR. Such colors will then be editable using the new picker that allows intensity to be selected.

This feature is not fully implemented yet, but you should expect the rest of it to be integrated in early August.

GPU pooling improvements

The GPU resource pooling system was completely overhauled. GPU pooling system was in place to allow the renderer to pool render targets and buffers it uses commonly (e.g. G-buffer textures, various intermediate render targets and buffers, etc.). The current system was doing a very poor job, causing many of those targets & buffers to get destroyed and re-created every frame. The new system provides the same API but works much better, only destroying resources if they haven’t been used in a while. I haven’t profiled but this should also yield a nice performance boost in some cases.

Editor animation is now euler

Editor’s animation window so far allowed animation rotation editing using euler angles, but internally the data was stored as quaternions. Due to the way the conversion between these two was done, some information was lost every time it happened. And it happened any time you edited the animation and saved it, causing a cumulative information loss. Additonally quaternions cannot preserve some properties of euler angles, especially multiple spins (e.g. doing a 720 degree rotation between two keyframes).

The system was overhauled so it now stored euler rotation in its original form for editing purposes. This way no information is lost. The actual animation internally still uses quaternions, meaning we don’t get any down-sides of euler angle rotation. Also euler -> quaternion conversion will now preserve multiple animation spins.

Bicubic upsampling shader


Left - Bicubic upsampling, Right - Normal upsampling (Notice the blockiness on the right lens flare)

Added a general purpose bicubic upsampling shader that can be used in variety of rendering effects. yielding higher upsampling quality.

Features

Framework

  • Bunch of really nice improvements for the logging system by @guestnone
  • GUI style names can now be passed using const char* instead of requiring String (and therefore a dynamic allocation)
  • imgui plugin that uses Banshee’s render backend by @pgruenbacher
  • Improved/added vector/quaternion normalization safety checks across both C++ and C#
  • Euler -> Quaternion animation curve conversion now properly preserves multiple spins (i.e. degrees over 360)
  • CMake toggle to enable/disable RTTI or exceptions by @hyyrylainen

Editor

  • Scene icon view size is now controllable from the scene camera options
  • Improved animation window zoom behaviour to make it more intuitive
  • Builtin primitives now come with colliders by default

Bug fixes

Framework

  • Vulkan will no longer leak memory when constantly rebuilding pipeline states
  • Vulkan now handles render passes and frame buffers in a lot more efficient manner
  • Fixed OpenGL scissor rectangle not getting applied if set after the pipeline state
  • Fixed a crash on Windows that would sometimes happen with gamepad connected
  • Fixed material not refreshing after one of the textures it’s referencing finishes loading
  • Don’t show a warning if width/height aren’t a multiple of compressed block size, as this is okay in some cases (e.g. mip-maps smaller than block size)
  • Fix crash on Vulkan when using 0-sized textures
  • Fix GUI line rendering being flipped on Y axis, on Vulkan
  • Fixed Vulkan image layout being wrong for render targets in some cases
  • Do not focus new non-modal window if there is any modal window present by @jayrulez
  • Generated C# project files are now placed in the build folder, so they don’t overwrite each other when user has multiple build folders
  • Fixed a crash when attempting a normal write on a dynamic texture on DirectX

Editor

  • Fixing a /really/ nasty memory corruption issue that caused crashes on macOS, and could have caused instability across all platforms
  • Fixed animation window undo commands complaining about not being serializable
  • GUIColorGradient should not attempt to create a zero sized textures
  • Fixed an occasional crash when docking windows
  • Fixed curve rendering issue that caused the curve to be partially drawn
  • Scale handles have been fixed so they transform objects correctly
  • Fixed a hang when selecting an object with the animation window open but hidden
  • Fixed an issue where library items could sometimes not be dragged

What’s next?

Another busy month ahead of me, perhaps even more so than July. I’ll try to wrap up Bokeh DOF and HDR color support features in early August, continue with bug fixes for the editor (which is running pretty smoothly now, but I don’t want to deal with a release while I’m this busy). In the second half of August I’ll start on a new rendering effect, or work on some GUI updates such as vector rendering, high DPI support or low power rendering.

Until next time, cheers!