Thursday, October 15, 2009

AMD - GPU Based Crowd Simulations

ManagingLargeCrowds.png



Everything is moving at a good pace towards GPU based computation and rendering, A graphics processing unit or GPU is a dedicated graphics rendering device. GPUs are very efficient at manipulating and displaying computer graphics, and their highly parallel structure makes them more effective than general-purpose CPUs for a range of complex algorithms. Harnessing the power of the GPU will make computer graphics scalable.
The talk was delivered by a group of researchers from AMD who did their Crowd simulations using the ATI HD 4800. The behavior of crowds can be loosely equated to fluids. The crowd elements or characters are referred to as ‘Agents’. Here AMD created Frog-Goblin agents affectionately called ‘Froblins’
The Froblins in the demo had a global navigation attribute set on them, guiding them to a particular destination, based on their final destination and distance the Froblins ‘sense’ their surroundings and adjust their velocity based on the terrain and other agents running around in the scene. This behavior is based on the Binning Algorithm.

The Abstract for the definition of the Binning Algorithm -
“We consider the design of online master algorithms for combining the predictions from a set of experts where the absolute loss of the master is to be close to the absolute loss of the best expert. For the case when the master must produce binary predictions, the Binomial Weighting algorithm is known to be optimal when the number of experts is large. It has remained an open problem how to design master algorithms based on binomial weights when the predictions of the master are allowed to be real valued. In this paper we provide such an algorithm, called the Binning algorithm, and show that it is optimal in a relaxed setting in which we consider experts as continuous quantities. The algorithm is efficient and near-optimal in the standard experts setting.”


The agents also have a congestion behavior, they sense the other agents direction and form a pack and move together towards their universal destination. The Froblin’s direction is determined on the minimum to collision and angle in relation to the global navigation direction and keeping the shortest path in mind. The terrain, density and hazards in the environment determine the factors on the Froblin’s journey. To explain ‘hazards’ the researchers demonstrated the introduction of a ‘Ghost Froblin’ that caused the agents to panic and run all over the terrain. Then fumes were introduced in the atmosphere, the unknowing agents that walked into fumes seem to wander aimlessly while the others avoided the fumes.

Scene Management.
The scene had 60 K agents all over the terrain. When it comes to such large numbers the question of scene management comes into picture. You wouldn't want to render millions of polygons if its not seen or occluded due to terrain or distance from camera. AMD developed various geometry shaders to solve the issues. Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters. Crowd rendering in large environments presents a number of challenges, including visibility culling, animation, and level of detail (LOD) management. These have been traditionally CPU-based tasks, trading some extra CPU work for a larger reduction in the GPU load. However, the per-character cost can be a serious bottleneck in that scenario. Furthermore, CPU-side scene management is difficult if objects are simulated and animated on the GPU as they are in the Froblins demo. This demo uses Direct3D® 10.1 functionality to perform view-frustum culling, occlusion culling, and LOD selection entirely on the GPU, allowing thousands of GPU-simulated characters to be rendered with full shadows in arbitrary environments.

View Frustum Filter - Characters that are not in the Camera Frustum (P.O.V) are removed to save render loads.

Occlusion Culling - Removes occluded characters depending on provided depth buffer.

LOD Filter - Agents are filtered based on their distance from camera with 3 levels of details.
Shadow Culling - Shadow map resolution is based on the distance from camera , which works on a combination of View frustum and LOD filters.

The Froblins demo was designed to showcase many of the new techniques for character-centric entertainment made possible by the GPU available on the ATI Radeon HD 4800 GPU series. In large-scale environments with thousands of highly detailed, intelligent characters, the Froblins are concurrently simulated, animated and rendered entirely on the GPU. In order to create a beautiful and engaging environment, the demo employed many of the advanced lighting and shading techniques you might find in the very latest high-end games. Spherical light maps were used to capture high-quality global illumination. These light maps provide rich lighting response on the surface of the highly detailed terrain and characters and integrate seamlessly with the dynamic soft shadows.

Download the Froblins demo here (EXE, 324MB)
Download the Froblins video here (H264, 136MB)


AMD Froblin demo requires Windows Vista® and an ATI Radeon™ HD 4800 Series product with at least 512MB of video memory, ATI Catalyst™ 8.11 or higher, a dual- or quad-core CPU and 2GB of RAM.

No comments: