« June 08, 2008 - June 14, 2008 | Main | June 22, 2008 - June 28, 2008 »

June 20, 2008

Solving Old Triangle Rendering Problems

Programmer Timothy Farrar has collected several solutions he has come across for old problems he has encountered during his trials with triangle rendering.

On level of detail and large view distance occlusion, Farrar suggests you build surfaces up with layers of small triangles: "Each layer independent. New LOD blends in new fine layer, blends out a previous course layer, keeping enough middle layers to insure a good effect. Course layers are mostly inner hulls, fine LOD layers mostly extend the surface, or split into disjoint shapes."

He describes the method as similar to an artist painting a scene, laying out rough shapes of color (lower LOD layers) before refining them (fine LOD layers): "Occlusion culling is an easy and solved problem, with occlusion queries and a hierarchical layered world structure."

With the LOD problem solved, developers can now control the overall size of triangles in a given region on the screen: "Small triangles enables more work to be pushed back to the vertex shader. Even soft shadows and diffuse transparency effects. Gets rid of the need for multiple passes for lighting. All lighting + dynamic global illumination computed per vertex, interpolate spherical harmonics for single pass per pixel lighting."

Farrar continues: "Keep in mind at 720P at 30fps, the GPU is solving for only 30 Mpix/sec, but has the capacity of over 200 Mtri/sec in setup. So small triangles are not a problem (until reaching the size of micro triangles, with bad pixel quad utilization)."

June 18, 2008

Lock and Lock-Free Code Compared, Optimized With Intel Thread Profiler

CD Projekt Red (The Witcher) senior programmer Maciej Sinilo has posted his experience with using an evaluation version of Intel Thread Profiler on a dual-core machine to see if there was any real difference between code based on locks and lock-free versions with his multi-threaded experiments.

Aimed at helping users "tune multi-threaded applications faster, for optimal performance on Intel multi-core processors," Intel Thread Profiler enables developers to visualize what percent of code is optimally parallel and where application performance issues exist.

Using Intel Thread Profiler's timeline view, Sinilo found that the average concurrency for his test using code based on locks was 1.99, with 5902.61 transitions per second. His results for the lock-free implementation test showed average concurrency at 3.04 with 57.36 transitions per second.

Sinilo found the lock-free implementation better, but not better. He tried a few methods to optimize the results, including eliminating as many semaphore waits as possible and a trick he found in Intel's Threading Building Blocks: "Every worker thread has its own task queue, if it's empty it tries to steal work from another thread. It wont sleep immediately, instead spin a little bit trying to steal something (yielding from time to time and pausing for a very short periods of time… It may be tricky to fine tune this).

He continued, "Eventually, it may wait, but it shouldn't happen that often. Wake-up events are not signaled every time task is added, only when changing queue state from empty to full (possible contention here, as I guard gate state variable, but it's very short). I do not need to implement work-stealing, as all threads acquire tasks from one queue, so it more or less auto-balances itself. I simply spin a little bit waiting for new task to arrive."

His final lock-free implementation had a an average concurrency of 3.58 with 6.29 transitions per second. Sinilo admitted that the improved results didn't amount to much on his dual-core system: "Anyway, what's [the] 'real' difference between all those versions? Not that big, honestly, fractions of one frame. I blame [the] test machine, partially. I may test it on my quad-core work machine and will get back with the results (if they're interesting)."

Supported Feature: 'Microsoft Flight Simulator X & Multi-Threading'

The seminal Flight Simulator franchise is embracing multithreading with the latest version, Microsoft Flight Simulator X, and in this supported feature for Intel's Visual Computing microsite, engineers explain the threading techniques that help enhance the sim's visuals.

Though it might not be obvious at first, processor demands are considerable for a complex application like Microsoft Flight Simulator, which requires launching a computer-generated aircraft, tracking and displaying the craft's movements above diverse landscapes, and responding to flight maneuver physics: "For many years (since 1982 when the IBM* PC version was released), Microsoft Flight Simulator has pushed the boundaries of processing power and graphics display capabilities.

Not everyone realizes that the first version of Flight Simulator, created by Bruce Artwick, flew on an Apple* II computer in 1980, where budding pilots had to use a lot of imagination with only a four-color or monochrome screen to display the surroundings and a rudimentary two-gauge panel that delivered airspeed and altitude data.

The second generation Microsoft release, FS 1.0, modeled the behavior of a Cessna 182, improving on the prior Apple version by offering eight gauges, an improved coordinate system, four unique scenery areas with 20 airports to choose from, a pair of COM radios, and distance measurement equipment (DME).

The simulator factored weather into the flight performance, giving the user nine different view directions, but the display characteristics were closer to abstract art than photorealism, with only four colors plus dithering to replicate the cockpit and scenery."

Improvements in Microsoft Flight Simulator over the past 25 years have followed improvements in personal computing as displays, and an Intel-Microsoft joint effort has led to multi-threading specific changes in the latest version:

"The collaborative engineering engagement between Microsoft and Intel took place over approximately six months, beginning in December 2006. Early in the engagement, the Microsoft developers and Intel development support team targeted their efforts on enhancing the visual quality of Flight Simulator X, rather than on improving the frame rate.

The Flight Simulator X Service Pack 1 download includes these performance improvements and graphics enhancements along with the architecture optimizations and the multi-threading capabilities."

You can now read the full feature, with engineers explaining the threading techniques that've helped enhance Microsoft Flight Simulator X's visuals (no registration required, please feel free to link to this feature from other websites).

June 16, 2008

Paul Debevec To Speak At Mundos Digitales, Procams 2008

In addition to his SIGGRAPH 2008 sessions on high-dynamic-range imaging and image-based lighting, Paul Debevec, USC IT's Graphics Research associate director and HDRI/IBMR pioneer, will be appearing at a couple more upcoming events which you might want to mark on your calendar.

At Mundos Digitales 2008, a five-day (July 1-5) international festival in Spain focusing on animation, visual effects, and videogames, Debevec will hold an Electronic Theatre screening and a session titled "New Techniques for Acquiring, Rendering, and Displaying Human Performances." He plans to present "recent work for acquiring, rendering, and displaying photo real models of people, objects, and dynamic performances. "

Other notable points for his Mundos Digitales talk include "a new 3D face scanning process that captures high-resolution skin detail by estimating surface orientation from the skin's reflection of polarized spherical gradient illumination," as well as "a new 3D display that leverages 5,000 frames per second video projection to show autostereoscopic, interactive 3D imagery to any number of viewers simultaneously."

At Procams 2008, a projector-camera systems international workshop co-located with SIGGRAPH 2008 in Los Angeles, Debevec will be offering attendees an open-house tour of the USC ICT graphics laboratory, where "an impressive array of projector-camera systems" are being used and developed.

About

This specially written weblog combines Gamasutra and Intel knowhow to present and deconstruct the latest happenings in visual computing and game technology.

Editor: Eric Caoili