Ogre-Next 3.0.0 Eris released

It’s been 2 years since 2.3.0 and almost a year since the last 2.3.x release. It’s about time for 3.0.0!

Ogre to OgreNext name migration

We’re trying to make OgreNext and Ogre able to be installed side-by-side. The details can be found in the manual.
But the short version is that we’re moving forward to have Ogre.dll and OgreNext.dll as different DLLs so that
Ogre and OgreNext can coexist for projects who want to support both, and for Linux distros that want to support
both without getting into name clashes.

Given that this requires changes in client projects (e.g. CMakeLists.txt and *.sln, etc) that depend on OgreNext,
the old naming can be selected using the CMake variable OGRE_USE_NEW_PROJECT_NAME which defaults to OFF for 3.0, but will default to ON for 4.0; and will be scheduled for removal in OgreNext 5.0.

Dealing with ABI mismatches: AbiCookie

A common problem in our community are crashes that were caused by simple mistakes such as mixing OgreNext.dll (Release) with OgreNext.dll (Debug). Or upgrading to a newer version of OgreNext but a lingering old DLL got loaded instead.

This can cause quite cryptic errors and crashes our users were having trouble to deal with.

AbiCookie is here to fix most of this issues, as it validates on load that the DLL being loaded matches the one it is supposed to be linked against.

The ABI cookie is used like this during Ogre::Root creation:

const Ogre::AbiCookie abiCookie = Ogre::generateAbiCookie();
mRoot = OGRE_NEW Ogre::Root( &abiCookie, pluginsPath, cfgPath,
                         mWriteAccessFolder + "Ogre.log", windowTitle );

While the AbiCookie may not catch all sort of ABI mismatches, it should catch the most common mistakes.
Plugins are also always validated by the AbiCookie.

ABI Semver

Starting 3.0.0; OgreNext will follow a modified semver versioning, where 3.0.x increments must absolutely not break the ABI, but 3.x.0 MIGHT be allowed to break the ABI in subtle changes. See this ticket comment for an explanation.

For this reason, most development will focus on 4.x.x; with 3.0.x for small fixes. Changes that would involve a 3.x.0 change will mostly be considered upon contract request.

Move to C++11 and general cleanup

The biggest focus of Ogre-Next 3.0.0 was easier maintenance and porting to newer versions; rather than new features.

We started aggressively using C++11’s override keyword, which makes much easier to catch derived classes whose functions have changed slightly in signature at compile-time.

We are also enforcing clang-format through CI to ensure code formatting stays consistent across the project and contributors.

Another important factor is that we fixed all warnings (or most, depending on your compiler version) in OgreNext.
Now compiling OgreNext results in a clean log. This results in a more robust codebase.

Furthermore, including headers no longer generates warnings in client applications, which is unacceptable.

This is not to say all changes were coding-style and C++ version related.

Particularly there have been PBR/PBS changes to better match what other engines are doing, with compatibility functions to restore the old look.

Towards the future: Ogre-Next 4.0

Actually Ogre-Next 4.0 is far more exciting! Development started a year ago as 3.0.0 stabilized and 4.0 has already interesting features:

  • Multithreaded Shader Compilation and PSO generation: This greatly speeds up shader compilation, app loading and greatly reduces stutter. Available for Vulkan and Metal.
  • ParticleFX2 plugin: An alternate plugin for ParticleFX2 with a focus on performance (parallel CPU simulation + vertex-shader-based geometry generation). The original ParticleFX plugin will not be deprecated as it serves different means. Certain FXs are easier to perform with the original PFX, while PFX2 focus on performance for large amount of particles and special rendering features.
  • Alpha Hashing and Alpha Hashing with A2C (Alpha to Coverage): A very decent trick that gets impressive results to perform transparency with depth writes enabled, which means it’s Order Independent (unlike traditional alpha blending).

About the 3.0.0 release

For porting information see:

For a full list of changes see the Github release.

Source and SDK is in the download page.

Discussion in forum thread.

Thank you to everyone involved (see Github release) in making this release possible.

Ogre-Next 2.3.3 Daedalus & 2.2.7 Cerberus released

These are maintenance releases. Little effort should be spent porting to these newer versions.

OgreNext 2.3.2 release is skipped because there was a relatively minor issue discovered after its release and 2.3.3 fixed that.

For a full list of changes see the Github release for 2.3.3 and the Github release for 2.2.7

Source and SDK is in the download page.

Discussion in forum thread.

Pst! We’re deciding on name candidates for the upcoming Ogre-Next 3.0 release. Make sure to chime in!

Removing bloat and reducing size in Ogre Next 2.4 by up to 20%

As we mentioned last time, Ogre-Next 2.4 will be mostly focusing on maintenance and fixing code debt.

Over a week we’ve fixed a lot of warnings.

With default settings on Clang on Linux, there’s no errors (except on OgreMeshTool).

But we haven’t taken a look at deprecated warnings yet.

On Apple/XCode and MSVC there’s very few warnings now

GCC needs Wconversion off because it’s incredibly dumb. It’s got too many false positives.
Fixing them would hurt readability too much, causing more harm than good.

Some CMake settings may cause warnings, e.g. we generate lots of warnings if OGRE_CONFIG_DOUBLE is on.

We also applied clang format to everything, and added C++11 override everywhere.

We’ve also removed dead code and added an option to turn off custom memory allocators off which is the default.

We’ve removed Boost, thus CMake won’t waste its time (and that was a lot) looking for an optional dependency we didn’t really need anymore.

Overall in Debug builds we’re seeing a 20% reduction in binary size (incl. symbols)!!
While Release builds have between 1% and 3% reductions.

The only drawback is that merging code 2.3 -> 2.4 is now harder as it’s almost guaranteed to cause a merge conflict, since nearly every line got touched.

Nonetheless it seems that merging by “merge using always theirs”, then applying clang format, then seeing the diff of what’s going to be merge is a good approach to prevent bad merges and fix accidentally introducing bugs

The numbers are in MBs

Linux Clang 9 – Debug

Lib Name

Before (2.3)

After (2.4)

Diff

libOgreHlmsPbs_d.so

8,69

7,53

-15,48 %

libOgreHlmsUnlit_d.so

1,92

1,59

-20,48 %

libOgreMain_d.so

65,00

55,01

-18,17 %

libOgreMeshLodGenerator_d.so

4,27

3,71

-15,11 %

libOgreOverlay_d.so

3,87

3,30

-17,23 %

libOgreSamplesCommon_d.a

10,80

9,10

-18,64 %

libOgreSceneFormat_d.so

2,55

2,03

-25,44 %

Plugin_ParticleFX_d.so

1,79

1,63

-9,85 %

RenderSystem_GL3Plus_d.so

6,97

5,23

-33,25 %

RenderSystem_NULL_d.so

1,70

1,35

-25,87 %

RenderSystem_Vulkan_d.so

15,82

14,63

-8,18 %





Total

123,39

105,12

-17,39 %

Linux Clang 9 – Release

Lib Name

Before (2.3)

After (2.4)

Diff

libOgreHlmsPbs.so

0,80

0,78

-3,03 %

libOgreHlmsUnlit.so

0,19

0,19

-3,58 %

libOgreMain.so

7,31

6,93

-5,61 %

libOgreMeshLodGenerator.so

0,24

0,22

-5,21 %

libOgreOverlay.so

1,00

1,00

-0,14 %

libOgreSamplesCommon.a

0,43

0,41

-3,85 %

libOgreSceneFormat.so

0,23

0,23

0,95 %

Plugin_ParticleFX.so

0,25

0,24

-5,38 %

RenderSystem_GL3Plus.so

0,85

0,76

-11,86 %

RenderSystem_NULL.so

0,16

0,16

-0,94 %

RenderSystem_Vulkan.so

7,93

7,91

-0,22 %





Total

19,40

18,83

-3,02 %

MSVC 2019 – Debug

Lib Name

Before (2.3)

After (2.4)

Diff

OgreHlmsPbs_d.dll

1,89

1,82

-3,45 %

OgreHlmsPbs_d.pdb

15,53

12,82

-21,15 %

OgreHlmsUnlit_d.dll

0,47

0,45

-4,50 %

OgreHlmsUnlit_d.pdb

9,51

6,89

-37,96 %

OgreMain_d.dll

24,28

22,81

-6,45 %

OgreMain_d.pdb

101,56

81,94

-23,94 %

OgreMeshLodGenerator_d.dll

1,02

0,98

-4,90 %

OgreMeshLodGenerator_d.pdb

10,57

8,64

-22,34 %

OgreMeshTool_d.pdb

11,95

8,66

-37,98 %

OgreOverlay_d.dll

1,77

1,75

-1,45 %

OgreOverlay_d.pdb

13,28

9,50

-39,70 %

OgreSceneFormat_d.dll

0,58

0,57

-1,78 %

OgreSceneFormat_d.pdb

11,07

8,04

-37,82 %

Plugin_ParticleFX_d.dll

0,39

0,37

-5,59 %

Plugin_ParticleFX_d.pdb

6,18

5,12

-20,59 %

RenderSystem_Direct3D11_d.dll

2,02

1,90

-6,32 %

RenderSystem_Direct3D11_d.pdb

17,13

14,11

-21,37 %

RenderSystem_GL3Plus_d.dll

2,00

1,69

-18,41 %

RenderSystem_GL3Plus_d.pdb

16,17

12,25

-32,03 %

RenderSystem_NULL_d.dll

0,39

0,36

-8,09 %

RenderSystem_NULL_d.pdb

8,96

6,26

-43,04 %

RenderSystem_Vulkan_d.dll

17,69

17,58

-0,66 %

RenderSystem_Vulkan_d.pdb

104,54

87,89

-18,94 %

OgreSamplesCommon_d.lib

12,83

11,63

-10,28 %

OgreSamplesCommon_d.pdb

7,74

6,78

-14,18 %





Total

399,51

330,81

-20,77 %

MSVC 2019 – Release

Lib Name

Before (2.3)

After (2.4)

Diff

OgreHlmsPbs.dll

0,55

0,55

0,09 %

OgreHlmsUnlit.dll

0,14

0,13

-1,45 %

OgreMain.dll

6,91

6,82

-1,32 %

OgreMeshLodGenerator.dll

0,20

0,21

2,12 %

OgreOverlay.dll

0,71

0,71

-0,28 %

OgreSceneFormat.dll

0,17

0,17

0,00 %

Plugin_ParticleFX.dll

0,14

0,14

0,35 %

RenderSystem_Direct3D11.dll

0,52

0,51

-0,38 %

RenderSystem_GL3Plus.dll

0,59

0,54

-9,37 %

RenderSystem_NULL.dll

0,12

0,12

-2,54 %

RenderSystem_Vulkan.dll

3,81

3,80

-0,18 %

OgreSamplesCommon.lib

1,48

1,41

-4,72 %





Total

15,33

15,11

-1,44 %

That’s all for now. Ogre 2.3 was released just a week ago and we wanted to share such an exciting development already happening on 2.4.

Discussion in forum thread.

Ogre-Next 2.3.0 Deadalus Released and Merry Christmas!

First of all, Merry Christmas to all those who celebrate it on behalf of the OGRE Team! (and if you don’t, have a nice day too!)

Second, after a bit more than a year in development, Ogre-Next 2.3.0 is released!

Magnificent work on Device Lost handling by Eugene Golushkov!

Most games don’t care too much about device lost because games can assume they own almost the entire computer while they’re running, and nothing else will be happening. A device lost is considered a critical failure and very uncommon, typically because of a Hardware or Software malfunction. Or a Windows Update in the middle of a gaming session, in which case the gaming experience is already interrupted anyway.

However this is not true for non-gaming apps: device lost can happen because of multiple reasons, but the two most common are:

  • The graphics driver is upgraded
  • Switching from power saving mode to performance or viceversa (mostly on laptops or other mobile devices)

Due to these two reasons, device lost becomes an almost certainty for long-running applications that could encounter a graphics driver suddenly upgrading; or for mobile/laptop-oriented applications where power mode switching can be very frequent.

Recovering from device lost can range from very easy to very difficult; depending on the complexity of an application and what the application was doing at the time the device was lost.

Eugene’s work goes to great lengths to try to gracefully recover from a Device Lost.

Switch importV1 to createByImportingV1

In 2.2.2 and earlier we had a function called Mesh::importV1 which would populate a v2 mesh by filling it with data from a v1 mesh, effectively importing it.

In 2.2.3 users should use MeshManager::createByImportingV1 instead. This function ‘remembers’ which meshes have been created through a conversion process, which allows device lost handling to repeat this import process and recreate the resources.

Aside from this little difference, there are no major functionality changes and the function arguments are the same.

Shadow’s Normal Offset Bias

We’ve had a couple complaints, but it wasn’t until user SolarPortal made a more exhaustive research where we realized we were not using state of the art shadow mapping techniques.

We were relying on hlmsManager->setShadowMappingUseBackFaces( true ) to hide most self-occlussion errors, but this caused other visual errors.

Normal Offset Bias is a technique from 2011 (yes, it’s old!) which drastically improves self occlussion and shadow acne while improving overall shadow quality; and is much more robust than using inverted-culling during the caster pass.

Therefore this technique replaced the old one and the function HlmsManager::setShadowMappingUseBackFaces() has been removed.

Users can globally control normal-offset and constant biases per cascade by tweaking ShadowTextureDefinition::normalOffsetBias and ShadowTextureDefinition::constantBiasScale respectively.

You can also control them via compositors scripts in the shadow node declaration, using the new keywords constant_bias_scale and normal_offset_bias

Users porting from 2.2.x may notice their shadows are a bit different (for the better!), but may encounter some self shadowing artifacts. Thus they may have to adjust these two biases if they need to.

Unlit vertex and pixel shaders unified

Unlit shaders were still duplicating its code 3 times (one for each RenderSystem) and all of its vertex & pixel shader code has been unified into a single .any file.

Although this shouldn’t impact you at all, users porting from 2.2.x need to make sure old Hlms shader templates from Unlit don’t linger and get mixed with the new files.

Pay special attention the files from Samples/Media/Hlms/Unlit match 1:1 the ones in your project and there aren’t stray .glsl/.hlsl/.metal files from an older version.

If you have customized the Unlit implementation, you may find your customizations to be broken. But they’re easy to fix. For reference look at Colibri’s two commits which ported its Unlit customizations from 2.2.x to 2.3.0

Added HlmsMacroblock::mDepthClamp

It is now possible to toggle Depth Clamp on/off. Check if it’s supported via RSC_DEPTH_CLAMP. All desktop GPU should support it unless you’re using extremely old OpenGL drivers.
iOS supports it since A11 chip (iPhone 8 or newer)

Users upgrading from older Ogre versions should be careful their libraries and headers don’t get out of sync. A full rebuild is recommended.

The reason being is that HlmsMacroblock (which is used almost anywhere in Ogre) added a new member variable. And if a DLL or header gets out of sync, it likely won’t crash but the artifacts will be very funny (most likely depth buffer will be disabled).

Added shadow pancaking

With the addition of depth clamp, we are now able to push the near plane of directional shadow maps in PSSM (non-stable variant). This greatly enhances depth buffer precision and reduces self-occlusion and acne bugs.

This improvement may make it possible for users to try using PFG_D16_UNORM instead of PFG_D32_FLOAT for shadow mapping, halving memory consumption.

Shadow pancaking is automatically disabled when depth clamp is not supported.

Vulkan is ready!

In Ogre-Next 2.3, Vulkan is considered stable. If you find a bug, please report it.

Most notable known issue is that it appears there are some issues when integrating with Qt we haven’t looked into yet.

PluginOptional

Old timers may remember that Ogre could crash if the latest DirectX runtimes were not installed, despite having an OpenGL backend as a fallback.

This was specially true during the Win 9x and Win XP eras which may not have DirectX 9.0c support. And stopped being an issue in the last decade sinceā€¦ well everyone has it now.

This problem came back with the Vulkan plugin, as laptops having very old drivers (e.g. from 2014) with GPUs that were perfectly capable of running Vulkan would crash due to missing system DLLs.

Furthermore, if the GPU cannot do Vulkan, Ogre would also crash.

We added the keyword PluginOptional to the Plugins.cfg file. With this, Ogre will try to load OpenGL, D3D11, Metal and/or Vulkan; and if these plugins fail to load, they will be ignored.

Make sure to update your Plugins.cfg to use this feature to provide a good experience to all of your users, even if they’ve got old HW or SW.

Other relevant information when porting

See What’s New in Ogre 2.3 from the manual for detailed info.

Also see Root Layouts section if you are customizing Hlms implementations and want to support Vulkan.

The future: Ogre 2.4

We already have a ticket tracking 2.4 roadmap.

Rather than rendering features, Ogre 2.4 will be focusing on robusting its source code base. There is a lot of code debt which needs to be addressed.

Most notably:

  • We will change the project from “Ogre” to “Ogre-Next”. The PR is already on its way and has been sitting in the backburner because we didn’t want to risk such a potentially breaking change so close to 2.3’s release. This change will allow installing Ogre 1.x and Ogre-Next side by side at the same time
  • Move to C++11 and up
    • Users may remembers my stance on C++11 adoption. Since then, while sadly the bloat is still there (literally compiling with C++98 is just faster because std headers bring in a lot of unnecessary baggage) HW has become faster, compilers did make some marginal improvements on build speeds, and most importantly we’re seeing more trouble maintaining C++98/03 support than just moving to C++11.
    • Additionally, we’ve long been wanting to use some of the C++11 (and up) built in features such as override keyword which help improve code quality.
  • Remove dead and deprecated code
  • Remove Boost (all Boost functionality we depended on can be found on the STL in C++11)

As for features, we will work on those needed by CIVCT:

  • Metal will start using Root Layouts, just like Vulkan. This will allow us to support a lot more textures and UAVs per shader.
  • Hlms implementations have a lot of duplicate Samplers for per-pass resources. We must merge them because on D3D11 CIVCT runs out of the limit of 16 samplers.

About the 2.3.0 release

For a full list of changes see the Github release

Source and SDK is in the download page.

Discussion in forum thread.

Thanks to Open Source Robotics Corporation for sponsoring CIVCT feature for their Ignition Project