Ogre 1.12.3 released

Ogre 1.12.3 was just released. Typically we do not write a specific announcement for minor updates, however this one contains some major new features that warrant this one.

Of course there is the usual slew of bug-fixes as well, which are listed here.

New Features

  • Reversed-depth buffer support for D3D11 and OpenGL3+. See the accompanying tutorial for details.
  • Full Unicode Path support, including ZIP archives, on Windows (on by default)
  • The Real Time Shader System, now uses ShaderModel4 style texture sampling, which fixes multiple samples (mainly depth and 1D texture related)
  • Overlays now properly support content scaling, which is needed for HiDPI screens.
  • Native ImGui support through the Overlay component
The new ImGui Sample

Vulkan Progress Report

If you follow my twitter you may have seen I tweeted about it.

Or if you follow our Ogre repo, you may have seen some commits.

Yes, we’re working on Vulkan support.

So far we only got to a clear screen, so this is all you’re gonna get thus far:

It is working with 3 different drivers: AMDVLK, AMD RADV, and Intel Mesa, so that’s nice.
Only X11 (via xcb library) works for now, but more Windowing systems are planned for later.

A very low level library

Vulkan is very low level, and setting this up hasn’t been easy. The motto is that all commands are submitted in order, but they are not guaranteed to end in order unless they’re properly guarded.

Want to present on screen? You better setup a semaphore so the present command waits for the GPU to finish rendering to the backbuffer.

Submitted twice to the GPU? You better sync these two submissions or else they may be reordered

On the plus side, a modern rendering library could take advantage of this to start rendering the next frame while e.g. compute postprocessing is happening on a separate queue on the current frame.

A lot of misinformation

There’s a lot of samples out there. But many of them are wrong or incomplete.

For example the LunarG’s official samples are wrong because they acquire the backbuffer from the GPU using the same semaphore instead of using one semaphore per frame.

In many of the samples this is not a problem because they perform a full stall for demo purposes, but some of the more ‘real world’ samples do not.

They also do not teach how to deal with GPU systems where the present queue and the graphics rendering queue are different (I don’t know which systems have this setup, but I suspect it has to do with Optimus laptops and similar setups where GPU doing rendering is not the one hooked to the monitor).

Google’s samples are much better, but they still miss some stuff, such as inserting a barrier dependency on VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT so that the graphics queue doesn’t start rendering to a backbuffer before it has been fully acquired and no longer used for presentation.

This bug is hard to catch because often the race condition will never happen due to the nature of double and triple buffer, and worst case scenario this could result in tearing or similar artifacts (even if vsync is enabled).

Though there’s the possibility that failing to insert this barrier can result in severe artifacts in AMD GPUs due to DCC compression on render targets being dirty while rendering to it. Godot’s renderer had encountered this problem.

This is covered at the end of Synchronization Examples’ Swapchain Image Acquire and Present .

Last week, Khronos released a new set of official samples. So far these seem to perform all correct practices.

A VERY good resource on Vulkan Synchronization I found is Yet another blog explaining Vulkan synchronization. It is really, really good.

If I were to summarize Vulkan, it reminds me of Javascript async/promises development: Everything is asynchronous and has to be coded with promises.

Once you get into the async mindset, Vulkan makes sense.

Where to next?

There’s a lot that needs to be done: Resizing the swapchain is not yet coded, separate Graphics and Present queues is not handled, there’s zero buffer management, no textures, no shaders.

The next task I’ll be focusing on is shaders; because they are useful to show stuff on screen and see if they’re working. Even if there are no vertex buffers yet, we can use gl_VertexID tricks to render triangles on screen.

And once shaders are working, we can then test if vertex buffers work once they’re ready, and if textures work, etc.

So that’s all for now. Until next time!

Improvements in VR, morph animations, moving to Github and CI

Over the last few weeks a new sample appeared: Tutorial_OpenVR

We’ve integrated OpenVR into Ogre.

The tasks done to achieve this can be summarized into five:

(more…)

Ogre Ecosystem Roundup #3

following the last post about what is going on around Ogre, here is another update.

Ogre-next project split

So lets put first things first; Ogre v1 and Ogre v2 are not only different versions of Ogre, but rather separate projects. Now officially.

While this sounds like big news, actually it is not that much of a change. If you followed the development of Ogre, you already noticed that the two branches moved independently in two separate directions. Hence, we had to write the what version to choose page.

Generally, Ogre2 focuses on the latest and fastest techniques, Ogre1 focuses on backward compatibility and keeping old projects running. Also Ogre1 is developed on github, while Ogre2 still lives on bitbucket.

With bitbucket now abandoning mercurial, we decided to move Ogre2 to github as well. While we could have kept it in a branch, we instead decided to create a separate repository with own issue tracking, landing page etc. So, enter ogre-next.

This also makes it possible to follow semver with Ogre1 and make a 2.0 release when needed.

(more…)

PCC / VCT hybrid progress

Last time I mentioned we were working on PCC / VCT Hybrid (PCC = Parallax Corrected Cubemaps, VCT = Voxel Cone Tracing).

I just implemented storing depth into the alpha channel, which is used to improve the quality of the hybrid.

Because we often use RGBA8 cubemaps, 8-bits is not enough to store the depth. Therefore we only store the deviation from the ideal probe shape.

The original PCC algorithm boils down to:

    posInProbeShape = cameraCenter + reflDir * fDistance;

Where cameraCenter is artist-defined (where the PCC camera was placed to build the probe) and posInProbeShape is also artist-defined (by controlling the size of the probe)

PCC is about finding reflDir mathematically:

    reflDir = (posInProbeShape - cameraCenter) / fDistance;

However we already know reflDir after executing PCC’s code.

Now the depth compression comes to effect by slightly altering the formula:

    realReconstructedPosition = cameraCenter + reflDir * fDistance * depthDeviation;

The variable depthDeviation is in range [0; 2] (which we store in the alpha channel) and thus 8-bit should be enough.

Technically this could introduce a few artifacts because we only store the depth in range [0; maximum_distance * 2]

Storing the depth deviation dramatically improves the hybrid’s quality!

But let’s not rush.

(more…)