180 likes | 369 Views
Visibility in Games. Harald Riegler. Visibility in Games. What do we need it for? Increase of rendering speed by removing unseen scene data from the rendering pipeline as early as possible Reduction of data transfers to the graphics hardware
E N D
Visibility in Games Harald Riegler
Visibility in Games • What do we need it for? • Increase of rendering speed by removing unseen scene data from the rendering pipeline as early as possible • Reduction of data transfers to the graphics hardware • Current games would not be possible without visibility calculations
Visibility methods • 2 very different categories: • Visibility from a region (Portals, PVS) • (Quake, Unreal, Severance and co.) • Visibility from a point (Z-Buffer, BFC,...) • Racing games, outdoor scenes, sports games etc. • We will focus on Point-Visibility here
Traditional methods • Traditionally used: • Back-Face culling • Z-Buffering • View frustum culling (Quad or Octtree) • New methods are slowly breaking into games
New scientific methods • Image-space occlusion culling • Hierarchical Z-Buffering • Hierarchical Occlusion Maps • Object-space occlusion culling • Hierarchical View Frustum culling • Hierarchical Back-Face culling • More methods in the paper
Hierarchical Z-Buffer • Z-Buffer is arranged in an image pyramid • Scene is partitioned in an oct-tree • Oct-tree nodes are tested against the Z-Pyramid where pixels have the same size • Visible nodes serve as input for the next frame • Relies on HW visibility query
Hierarchical occlusion maps • Potential occluders are pre-selected • These occluders are rendered to the occlusion map. The hierarchy can be built with MIP-Mapping HW • Depth test after occlusion test • Seperate depth estimation buffer
Hierarchical View Frustum Culling • Speeds up VFC by testing only 2 box corners of a bounding box first. • Plane coherency during frame advancing • Test against VF-octants. • BB-Child masking
Hierarchical Back-Face Culling • Partitions each model into clusters • Primitives in one cluster are: • Facing into similar directions • Lie close to each other • If the cluster fails the visibility test, all primitives in this cluster are culled
The Real World (1) • Scientific approaches often too complicated • Science often uses models with hundreds of thousands of vertices, games don’t. (LOD) • Game developers “pick” ideas from different algorithms • Research has impact on hardware design!
The Real World (2) • Parts of the HZB are used sometimes • Runtime-LOD is used as input for a simple HZB • VFC is almost always used. • HOM introduce too much overhead for games, and the z-buffer is there anyway • A simplified HBFC can be used
The Real World (3) • PSX-One doesn’t even have a z-buffer • ATI’s Radeon has parts of a HZB (Called Hyper-Z) • GForce2 only has a z-buffer • GForce3 similar to Radeon, but supports HZB visibility query • Dreamcasts Power-VR2 works pretty different (Infinite planes)
A PSX Example • Iron Soldier 3 on PSX: • VFC based on a quad-tree • BFC • Painters algorithm
Conclusions (1) • Visibility algorithms are used in many different applications • Occlusion culling • Shadow calculations • Radiosity • Volumetric lights • All these fields benefit from advances in visibility techniques
Conclusion (2) • Occlusion culling will gain importance • More OC will be implemented in hardware • Discrepancies between science and gaming industry will alway exist due to different goals