Using UIRenderer in PowerVR Framework

UIRenderer provides functionality for creating 2D objects in 2D and 3D scenes

UIRenderer (both the OpenGL ES and Vulkan versions) is a library for laying out and rendering 2D objects in a 2D or 3D scene. The main class of the library is pvr::ui::UIRenderer. The UIRenderer is part of the PVRUtils library.

  • In Vulkan, UIRenderer refers to and is therefore compatible with a specific RenderPass, and UI Rendering commands are packaged and recorded into a pvrvk::CommandBuffer.
  • In OpenGL ES, the OpenGL state is recorded, rendering commands are executed inline, and then the OpenGL ES state is restored.

An example of using UIRenderer can be found in the SDK. IntroducingUIRenderer demonstrates how to create a Star Wars intro scrolling marquee effect using the PowerVR Framework and specifically UIRenderer.

Initialising UIRenderer

During initialisation, the rendering surface of the UIRenderer is configured. Note that it is not implied that this surface is the entire canvas, and it will not cull the rendering. It is only a coordinate system transformation from pixels to normalised coordinates and back.

  1. In both OpenGL ES and Vulkan, beginRendering(...) is normally used on the UIRenderer objects, either to push and configure the OpenGL state, or to open the Vulkan command buffer.
  2. Any sprites required are then rendered.
  3. Finally, endRendering(...) follows to either signify closing command buffers, or pop the GL state.