When Geomerics, a game middleware developer, decided to tackle the problem of real-time, ray-traced global illumination, it didn’t want to work alone. While building its cutting-edge product Enlighten*, which processes lighting geometry in real time and ends the need for offline rendering, the company had help from Intel and instrumented its code to support the Intel® Graphics Performance Analyzers (Intel® GPA).
"Game developers are continually balancing their resources," said Chris Doran, founder and chief operating officer of UK-based Geomerics. "Intel GPA allows us to show the developer exactly what Enlighten tasks are running, and for how long and when."
To perform its light-rendering magic, Enlighten generates a set of CPU tasks that Doran said typically run in parallel to the application's CPU threads and to GPU rendering tasks.
The Enlighten middleware implements high- and low-level runtime APIs, the tasks of which also appear in Intel GPA. "Developers using the high-level API can see the low-level API calls made on their behalf [that are] nested within the high-level API on the trace timeline," explained Doran. “This information, along with performance data, also gives the developer an understanding of the inner workings of the Enlighten runtime system, which can lead to better performance on a variety of platforms.”
Image from Eve Online by CCP Games
"By seeing how Enlighten is being [used] at runtime, developers can tune the middleware to best fit their target CPU usage,” he said. Enlighten is optimized for Sony PlayStation*3, Microsoft Xbox 360*, and the PC, but can be used to target mobile devices too. And by tracking the usage of Enlighten over time, Doran said developers also can identify stalls, bottlenecks, and other performance issues, and identify ways to improve performance through better CPU task scheduling.
In addition to its ability to render global lighting conditions while a game is being played, Enlighten enables developers to preview scenes and levels of a game immediately while it is being built, instead of having to wait hours, potentially, for a scene’s lighting to be rendered (aka pre-baking).
According to Doran, the integration of Intel GPA and Enlighten was straightforward. “Using the provided API, we needed to instrument only our main tasks,” which he said amounted simply to adding “start” and “end” calls in a few places in the source code. “The game developer using our middleware needs to make only a single extra function call to enable instrumented profiling of Enlighten with Intel GPA. It provides a clear benefit for our customers and ourselves.”
For Geomerics customers, the company worked closely with Intel to integrate Intel GPA tools, both for profiling the Enlighten runtime and to better enable game developers to optimize their games using Enlighten. "We are able to do a lot more profiling in fine detail of how the runtime is performing on the CPU, resulting in some optimizations," said Doran. "And with Intel's help, [we've] shipped with some of the Intel GPA hooks built into Enlighten so that developers can immediately turn on Intel GPA in their own engine and see exactly how it's performing."
Intel GPA integration also will benefit shops using the Unreal Engine 3* (with which Enlighten is pre-integrated), Havok* Physics, and other middleware that will be competing for CPU resources. “It's useful for game developers to see exactly what's going on and to see what a small amount of the actual computation is due to Enlighten. The game developer has to not only balance these demands against each other, but [also must] tailor their CPU usage to the needs of their game.”
Intel GPA provides detailed information about CPU utilization and scheduling, and “. . .is the only practical way to understanding what’s happening under the hood,” said Doran, adding that “it's important for developers to realize that they can put Enlighten into their game without any performance hits."
What’s Going On
In essence, Enlighten consists of two parts: One part slots into the developer’s standard art and tools pipeline, and the other is a set of lightweight runtime components that are put directly into the game. The latter part handles dynamic changes to in-game lighting conditions. “These components update all the bounce lighting in real time from a small amount of data prepared offline,” Doran said. "They take in some lighting configuration information and return a light map, which is essentially a texture full of lighting information."
Versions of the runtime are available for Android* and iOS*. Doran said the company set a performance goal for the Enlighten runtime to consume no more than five milliseconds of computation per frame. And since it runs asynchronously, there is no requirement to stay in lockstep with the frame rate, he said. “So putting Enlighten into your game shouldn't affect your frame rates negatively at all.” An additional benefit of computer-aided bounce lighting, Doran added, is that developers can get away with having far fewer light sources in their worlds.
It didn’t take much convincing for Geomerics to begin using Intel GPA tools; it was first recommended by Intel’s developer support team. “Once we were aware of the technology it was a very straightforward argument to add the minimal instrumentation it requires,” said Doran, adding that “it’s extremely useful, simple to set up and use, and it’s free. It’s hard to find an argument not to use it.”
Intel GPA Upgrades
Intel is always hard at work improving its Graphics Performance Analyzers, which it provides free of charge to developers who register. The latest release (www.intel.com/software/gpa) delivers major enhancements to the Intel GPA System Analyzer, Intel GPA Frame Analyzer, and Intel GPA Platform Analyzer components.
New in Intel GPA System Analyzer is a remote version of the Intel GPA System Analyzer heads-up display, which lets developers analyze target systems over a networked laptop, netbook, or other lightweight client. Intel GPA Platform Analyzer now allows logical threads and display-task states to be shown or hidden in the Task Timeline Panel, giving developers a simplified view when needed.
Beta versions of two new advisors are included with Intel GPA Frame Advisor that can help identify potential issues at the frame and draw-call level. The Intel GPA Frame Analyzer can also now filter API details and allow developers to enter pixel coordinates in the Pixel History panel to quickly zero in on a pixel of interest.
Intel GPA also now supports Microsoft DirectX* 9Ex and can analyze workloads created with its corresponding API. New ease-of-use features include the ability to launch tools from within the tool tray and automatic notifications of updates to the Intel® HD Graphics driver.
Make Your Move
Geomerics openly invites developers to try Enlighten for themselves at no cost. According to Doran, the middleware can be integrated with an existing tool chain in about two weeks; less if you’re using the Unreal Engine 3 where Enlighten is pre-integrated. Geomerics will also lend a hand with the integration process. Said Doran, "Often we go onsite and help integrate it into [a customer’s] own world editors.”
As for GPA, Intel says that GPA 2012 should be generally available in March 2012. Sounds like the perfect time for a performance tune-up.
About the Author
Edward J. Correia has been a part of the computer industry since 1980, when he began selling (and occasionally hacking) computers from Atari and Commodore. In addition to writing for RH+M3, Correia currently serves as technical editor at the CRN Test Center, a computer and networking test lab that he helped establish in 1995. During a 10-year hiatus from CRN’s parent company, United Business Media, Correia was editor of Software Test and Performance magazine and executive editor of SD Times.