With the Ogre 1.11.3 release, the 1.11 support cycle isĀ  half way over, which is a good time to recap the features and switches that got introduced since the initial release.

Good time to Contribute

If you are porting your Code to Ogre 1.11 now and find that you have local changes, it is a good time to create a pull-request and contribute them upstream.

This way you make sure that your fixes will be carried forward by the Ogre team as well as getting expert feedback on your change. This will eventually boost your productivity as well as helping Ogre.

OGRECave ecosystem

  • Scape got substantially improved by Tobias Schmidt. Now all tools and import/ export work.
  • ogre-assimp got fixes for Texture exporting with 1.11 and proper normal handling.
  • ogre-video got updated for 1.11 and is now the recommended video plugin.

Overview

But lets turn to the new features now. Specifically:

  • Sampler Objects
  • Improved Compositors
  • Templated Vector
  • Unified Documentation

Sampler Objects

We started adapting the internal RenderSystem API to how modern graphics APIs like Vulkan or Gallium3D work by introducing ColourBlendState and Sampler Objects.

Sampler Objects are Script-User visible and therefore we will describe them in more detail. Essentially they store all parameters controlling how Texture data is fetched. Previously those were scattered around TextureUnitState (TUS).

Now you have separate, named Objects that are created by the TextureManager. This allows you to quickly change the settings for all associated Textures. Typically you have many Textures but only a few sampling states in your application.

We also use this mechanism inside Ogre to providing a DefaultSampler object which is shared by all TextureUnitStates. Calling MaterialManager::setDefaultTextureFiltering now simply modifies this DefaultSampler. If you modify one of the sampler parameters via the existing TUS API, we transparently create a new Sampler for this Unit – which results in a much cleaner implementation compared to the various  flags used before.

sampler NoInterpolation
{
    tex_address_mode clamp
    filtering none
}

material Example
{
    technique
    {
        pass
        {
            ...
            texture_unit
            {
                texture foo.png
                sampler_ref NoInterpolation
            }
            texture_unit
            {
                texture bar.png
                sampler_ref NoInterpolation
            }
        }
    }
}

Currently Samplers only directly map to GL3.3 API Objects, but the same can be done for D3D11 and GLES3.

Improved Compositors

The Compositor System now supports PF_DEPTH16 for RenderTextures and fully integrates with the RTSS, enabling the auto generation of shaders.

Together these features allow you to render and display depth of your scene as easy as

material ShowDepth {
    technique {
        pass {
            lighting off
            texture_unit {
                filtering none
            }
        }
    }
}

compositor Texcoord
{
    technique
    {
        texture depthTex target_width target_height PF_DEPTH16
        target depthTex
        {
            pass clear {}
            pass render_scene {}
        }
        target_output
        {
            pass render_quad
            {
                material ShowDepth
                input 0 depth
            }
        }
    }
}

Note that this script will work across all RenderSystems as the (GLSL/ HLSL) shaders will be auto-generated.

Additionally there is now a new “compute” compositor pass for explicitly dispatching compute shaders

compositor Compute
{
    technique
    {
        target_output
        {
            // just do normal rendering
            input previous
            // execute compute shaders post-render
            pass compute
            {
                material Compute/Compositor
                thread_groups 16 16 1
            }
        }
    }
}

where the Compute/Compositor material has one or more compute only passes, which can access any of the global auto-constants. Note that binding textures for UAV read/ write is not yet possible through scripts yet.

Templated Vector

Vector2, Vector3 and Vector4 are now just typdefs of the Vector<N, type> template. (e.g. Vector3 is Vector<3, Real>)

This allows you to use custom Vector types and is the first step to combat the Real type abuse in the code-base; initially the Real typedef was introduced as a configuration option for SceneNode calculations with double precision.

However at some point Real started to be used instead of float everywhere, but for most part the type must be float and not double. E.g. meshes are always stored at float precision as most RenderSystems did not support it double precision. Therefore all code interacting with meshes should work on floats exclusively (sparing some dot operations with large numbers).

Unified documentation

While we already merged the Ogre manual and the API reference with the 1.10 release, the Docs are now becoming truly unified regarding the content;

An outlook on Ogre 1.12

New features will still land in 1.11.x point releases, so the 1.12.0 will be just the last 1.11 without some deprecated features (just as 1.11.0 was compared to 1.10.12).

Therefore this is mainly to inform you about the API breakage coming with 1.12, which currently is

  • bump required OpenGL version for GL3+ to 3.3
  • remove some of the dragging deprecated API. (including script parameters)
  • switch Overlays to the unified parser.
  • drop compute shader execution during rendering