Imagination is known for its chip IP for mobile devices such as smartphones and tablets and has a strong reputation as a market leader with regards to performance, power and area. Complementing this, Imagination also has IP related to ray tracing, a technique considered to be the ‘holy grail’ for computer graphics enabling the development of ultra-realistic lighting in a straightforward manner. Imagination’s PowerVR Wizard GR6500 architecture is a graphics processing unit (GPU) design that incorporates functionality that makes it realistic for SoC manufacturers to offer ray tracing capable hardware within mobile power envelopes. The video below describes the demonstration that was given by Imagination earlier this year at the 2017 Game Developers Conference in San Francisco.
The demo hardware
This demonstration uses a system consisting of a standard PC containing a development PCI card with the same hardware as would appear in a mobile device. The PC is running Ubuntu Linux; in production, the mobile operating system would typically be Android.
In the video, we also demonstrate how our hardware may be used with third-party game engines. A game engine is a piece of middleware that sits on top of the graphics device driver and provides a platform for the artwork and gameplay of the individual game. Many different commercial games will use the same game engine. In our example, the third-party game engine that we’re using is Unreal Engine 4, used for many AAA gaming titles such as Gear of War 4 and the recent Final Fantasy game.
Furthermore, we demonstrate the use of the Vulkan graphics API. A graphics API is a standard interface between graphic software and the device driver. The Vulkan API is a relatively new standard that enables performance-critical applications to have more low-level control of resources. The standard was developed by the Khronos Group, of which Imagination Technologies is a member.
Explaining the video
Initially, the video shows the Unreal Engine 4 running an example project called Sun Temple. Here, the engine is using its Vulkan API back-end to talk to our device driver, which in turn controls the PowerVR Wizard GPU.
In order to show the ray-tracing capabilities of the hardware, we also run a scene based on the standard Chair and Tables tutorial project of Unreal Engine. We added some objects to the scene to help exhibit the benefits of ray tracing.
Initially, the Chairs and Table project is shown running in the standard (raster) mode, using the Unreal Engine shaders normally used for mobile devices. The video shows how we can use a hot-key to switch between the regular raster mode and ray traced mode. In the ray trace mode, you can see true reflections in the mirrors, table top and floor. With the regular shaders, reflections are typically done with pre-renders that are then applied in the main render, or sometimes by reading other parts of the screen. Except in special cases, these reflections cannot be accurate. Ray tracing allows for completely accurate reflections within a single render.
Similarly, you can see accurate refraction with the vase on the table; by comparison, the regular shaders just warp the existing render. However, such screen-space tricks, for both reflection and refraction, cannot show anything that isn’t already visible. Ray tracing provides exact, accurate, realistic reflections even in the case of a distorted reflecting surface, such as with the two mirrors in the demo.
Ray tracing may also be used to implement shadows by firing rays from the surface to the light sources. Regular shaders will use a shadow map per light, but these each require a pre-render.
The ray tracing shaders demonstrated in the video have been generated by the Unreal Engine in much the same way that it generates the shaders for the regular renders. We have made relatively small changes to the Unreal Engine 4 to generate these shaders; most of the code for the material properties is unchanged. Both types of shader use the Vulkan API, with the ray tracing shaders using a small set of extensions specific to their needs.
Another advantage of ray tracing is flexibility concerning camera lens and projection. Everything shown in the demo scene is a result of ray tracing, including rays from the camera position to the first object hit. These initial rays are generated by a lens shader – programmable functionality that is not available in regular raster renders.
This lens shader is invoked for every pixel of the frame buffer, allowing for arbitrary lens characteristics.
The last part of the video demo gives an illustration of this flexibility. It shows the generation of a so-called 360° video, in which the full spherical view is available in a single frame. Such videos have been generated as both live-action and computer graphics. They can be viewed in VR headsets or via online players that enable you to pan around the sphere. This last part presents the Chairs and Table project rendered in what’s known as equirectangular projection. The whole spherical view is mapped to the flat rendered rectangle, producing a rather strange image when viewed directly. However, when viewed via YouTube’s VR viewer it is displayed as a smaller segment in which the viewer can interactively pan around.
In conclusion, Imagination Technologies’ PowerVR Wizard architecture provides physically correct reflections, refractions and shadows with the low power consumption required for use in mobile devices. We can use ray tracing’s flexibility to perform virtual-reality renders in a single pass, rather than the multiple passes required with regular raster-based renders. It also fully supports the Vulkan API for both standard renders and ray-tracing (with appropriate extensions to the API).