Ogre 2.2.5 Cerberus Released and EGL Headless support!

This is a special release! Most Ogre 2.1.x and 2.2.x releases, it only contains maintenance fixes and no new features.

Thus efforts to port from 2.2.4 to 2.2.5 should be minimum. And this still holds true.

But there is a new feature!

This feature was sponsored by Open Source Robotics Corporation and was written to be used by the Ignition Project

EGL Headless

OpenGL traditionally requires a window. Without a window, OpenGL cannot be used. This implies either X11 or Wayland is installed and running; which can be a problem when running on cloud servers, VMs, embedded devices, and similar environments.

Direct3D11 doesn’t have this flaw, but it does not run on Linux.

Vulkan also doesn’t have this flaw, but its support is new (coming in Ogre 2.3) and is not yet robust and tested enough. Additionally SW implementations have yet to catch up.

Ogre can use the NULL RenderSystem to run as a server without a window, however this doesn’t actually render anything. It’s only useful to pretend there is a screen so that apps (mostly games) can reuse and turn client code into server code. It’s also useful for mesh manipulation and conversion tools which need to read Ogre meshes but don’t actually render anything.

Fortunately, Khronos introduced a workaround with EGL + PBuffers (not to be confused with 2000-era PBuffers which competed against FBOs) where an offscreen dummy ‘window’ could be created to satisfy OpenGL’s shenanigans.

Because PBuffer support in some EGL drivers are not well tested (e.g. sRGB support was only added in EGL 1.5, which Mesa does not support) Ogre creates a 1×1 PBuffer alongside the Context and uses an FBO internally for the ‘Window’ class. By using a dummy 1×1 PBuffer tied with the GL context, OpenGL context creation becomes conceptually free of window interfaces, like in D3D11 and Vulkan.

Switchable interfaces: GLX and EGL

When Ogre is built with both OGRE_GLSUPPORT_USE_GLX and OGRE_GLSUPPORT_USE_EGL_HEADLESS, toggling between GLX and EGL can be done at runtime.

This is how it looks:

Originally the GLX interface will be selected:

But after switching it to EGL Headless, only a couple options appear (since stuff like Resolution, VSync, Full Screen no longer make sense)

And like in D3D11/Vulkan, it is possible to select the GPU. /dev/dri/card0 is a dedicated AMD Radeon HD 7770 GPU, /dev/dri/card1 is a dedicated NVIDIA GeForce 1060. Yes, they can coexist:

NVIDIA seems to expose 2 “devices” belonging to the same card. ‘EGL_NV_device_cuda … #0’ is a headless device. Trying to use ‘EGL_EXT_device_drm #1’ will complain that it can’t run in headless mode. It seems it is meant for use with GLX.

‘EGL_EXT_device_drm #2’ is the AMD card.

EGL_MESA_device_software is SW emulation

We chose not to include the marketing names in device selection because Linux drivers (propietary and open source) have the tendency of changing the exposed OpenGL marketing labels quite often in subtle ways. This could break config settings quite often (i.e. the saved chosen device can no longer be found after a driver upgrade), increasing maintenance burden when this feature is meant for automated testing and similar.

Complete X11 independence

Users who need to be completely free of X11 dependencies can build with OGRE_GLSUPPORT_USE_EGL_HEADLESS + OGRE_CONFIG_UNIX_NO_X11.

This will force-disable OGRE_GLSUPPORT_USE_GLX as it is incompatible. GLX requires X11.

Headless SW Rasterization

It is possible to select the Mesa SW rasterization device. So even if there is no HW support, you can still use SW.

Please note Mesa SW at the time of writing supports up to OpenGL 3.3, which is the bare minimum to run Ogre. Some functionality may not be available.

Update: It has been called to my attention that llvmpipe (aka SW emulation) supports OpenGL 4.5 since Mesa 20.3.0

More info

This new feature seems to be very stable and has been tested on NVIDIA, AMD (Mesa drivers) and Intel.
Nonetheless it is disabled by default (i.e. OGRE_GLSUPPORT_USE_EGL_HEADLESS is turned off) which means it should not affect users who are not caring about headless support.

For more details, please see the README of the EglHeadless tutorial.

Running EglHeadless sample should result in a CLI interface:

OpenGL ES 3.x may be around the corner?

With EGL integration, it should be possible to create an EGL window and ask for an ES 3.x context instead of an OpenGL one. There is a lot of similarities between ES 3 and OpenGL 3.3, and we already have workarounds for it as they’re the same ones we use for macOS.

While I don’t have very high hopes for Android, WebGL2 may be another story.

If such feature is added into the roadmap, it would probably be for 2.3 though.

RenderDoc integration

Functions RenderSystem::startGpuDebuggerFrameCapture and RenderSystem::endGpuDebuggerFrameCapture were added to programmatically capture a RenderDoc frame. This was necessary for RenderDoc to work with headless rendering, but it works with all APIs in most platforms.

Users can call RenderSystem::getRenderDocApi if they wish to perform more advanced manipulation:

if( rs->loadRenderDocApi() )
    RENDERDOC_API_1_4_1 *apiHandle = rs->getRenderDocApi();

About the 2.2.5 release

For a full list of changes see the Github release

Source and SDK is in the download page.

Discussion in forum thread.

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

Ogre 2.2.2 Cerberus Released!

This is a maintenance release. Efforts to port from 2.2.1 to 2.2.2 should be minimum.

Notable additions are:

  • Stable PSSM shadows technique added. Use this feature with ‘num_stable_splits 1’ in compositor scripts when defining the shadow node. Stable PSSM shadows tend to improve quality on the first splits, but they can dramatically reduce quality on the last splits of PSSM; thus using num_stable_splits 1 or 2 but not higher than that is recommended
  • D3D11 improved its handling of device lost
  • It is now possible to draw to a cubemap using MSAA, which was an oversight in Ogre 2.2.1. See the updated DynamicCubemap tutorial

For a full list see the Github release

Discussion in forum thread.

Ogre 2.2.1 Cerberus Released!

Whoa! What’s this? Didn’t you announce Ogre 2.1 Baldur was released a few days ago? Yes! Then, what’s going on?

I noticed Ogre 2.1’s release announcement atracted more popularity than I expected (thank you!!!) thus I shall explain:

Ogre 2.1 has been in development for many years, approximately since 2015.

At some point it matured and we started working on the next version: Ogre 2.2

Our regular users who stick around knew 2.1 has been stable for a while now; but we just didn’t have the time or resources to make a release (packaging binaries, ensuring everything works, etc). And many fixes from 2.2 also kept getting backported.

And 2.2 had just reached maturity too.

Ogre 2.1 was a major refactor and users porting existing code from Ogre 1.x is definitely doable, but still requires a lot of effort.

Unlike 1.x -> 2.1 transition though, 2.1 -> 2.2 transition is a much smoother experience, because it mostly touches Texture manipulation code and end users rarely manipulate a lot of Textures via code directly.

The Texture code of 2.1 was entirely replaced by the new TextureGpu code; which supports background streaming and solves many RAM issues that plagued 2.2.

Wait! 2.2.1… where’s Ogre 2.2.0?

Ogre 2.2.1 and 2.2.0 are being released concurrently. This is because during development a few of our users and testers needed to distinguish between more stable features (texture streaming) from the less stable ones (Global Illumination) and we used OGRE_VERSION_PATCH for that.

However our GI code has stabilized now.

Because there is now virtually no reason to use Ogre 2.2.0 over 2.2.1; we just went ahead and make a source-code-only release of Ogre 2.2.0 for archival reasons and a source-code + SDK release of 2.2.1

Ogre 2.2.1 also contained several bug fixes which made no sense to backport to 2.2.0 as it would only increase our work.

Download Ogre 2.2.1

Codename Cerberus

For more information, see the manual

See SW & HW Requirements
See platforms supported
See Ogre 2.1 FAQ
See What’s new in Ogre 2.2

  • Texture streaming! Completely refactored Texture code. It consumes a lot less RAM and supports background streaming
  • Voxel Cone Tracing (VCT): Semi-Realtime GI solution. Supports diffuse and specular. Can consume a lot of VRAM depending on quality. Lighting changes can be done in realtime. Changes to static objects in scene needs to rebuild voxels (not realtime)
  • Irradiance Field with Depth (IFD): Generic variant of DDGI using Voxels (consumes more VRAM) or Rasterization (slower to build). It supports diffuse only and is lower quality than VCT, but is much faster. And if completely static, consumes very little memory.
  • Per-pixel Cubemap probes
  • VR readiness: New sample showing how to integrate OpenVR SDK, deal with running start, performance optimizations such as Instanced Stereo, Hidden Area Mesh and Radial Density Mask
  • Mobile friendly: Added Load and Store actions to control how TBDR GPUs flush their caches

What’s next?

  • Stable PSSM Shadowmaps
  • Vulkan support

All branches except the Vulkan one are being merged back into master. Whatever is in master will likely become Ogre 2.2.2 one day.

That doesn’t mean Vulkan will or will not make it to 2.2.2, it’s just that we want to always keep master branch with a relatively high degree of stability (i.e. rolling release model), which the Vulkan branch cannot yet provide.

Relevant posts: