visibility in games harald riegler. 2 / 18 visibility in games n what do we need it for? u increase...

18
Visibility in Games Visibility in Games Harald Riegler Harald Riegler

Upload: stuart-simmons

Post on 16-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

Visibility in GamesVisibility in Games

Harald RieglerHarald Riegler

Page 2: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

2 / 18Harald Riegler

Visibility in GamesVisibility in Games

What do we need it for?What do we need it for? Increase of rendering speed by removing Increase of rendering speed by removing

unseen scene data from the rendering unseen scene data from the rendering pipeline as early as possiblepipeline as early as possible

Reduction of data transfers to the Reduction of data transfers to the graphics hardwaregraphics hardware

Current games would not be possible Current games would not be possible without visibility calculationswithout visibility calculations

Page 3: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

3 / 18Harald Riegler

Visibility methodsVisibility methods

2 very different categories:2 very different categories: Visibility from a region (Portals, PVS)Visibility from a region (Portals, PVS)

(Quake, Unreal, Severance and co.)(Quake, Unreal, Severance and co.)

Visibility from a point (Z-Buffer, BFC,...)Visibility from a point (Z-Buffer, BFC,...) Racing games, outdoor scenes, sports Racing games, outdoor scenes, sports

games etc.games etc.

We will focus on Point-Visibility hereWe will focus on Point-Visibility here

Page 4: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

4 / 18Harald Riegler

Traditional methodsTraditional methods

Traditionally used:Traditionally used: Back-Face cullingBack-Face culling Z-BufferingZ-Buffering View frustum culling (Quad or Octtree)View frustum culling (Quad or Octtree)

New methods are slowly breaking into New methods are slowly breaking into gamesgames

Page 5: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

5 / 18Harald Riegler

New scientific methodsNew scientific methods

Image-space occlusion cullingImage-space occlusion culling Hierarchical Z-BufferingHierarchical Z-Buffering Hierarchical Occlusion MapsHierarchical Occlusion Maps

Object-space occlusion cullingObject-space occlusion culling Hierarchical View Frustum cullingHierarchical View Frustum culling Hierarchical Back-Face cullingHierarchical Back-Face culling

More methods in the paperMore methods in the paper

Page 6: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

6 / 18Harald Riegler

Hierarchical Z-BufferHierarchical Z-Buffer

Z-Buffer is arranged in an image pyramidZ-Buffer is arranged in an image pyramid Scene is partitioned in an oct-treeScene is partitioned in an oct-tree Oct-tree nodes are tested against the Z-Oct-tree nodes are tested against the Z-

Pyramid where pixels have the same sizePyramid where pixels have the same size Visible nodes serve as input for the next Visible nodes serve as input for the next

frameframe Relies on HW visibility queryRelies on HW visibility query

Page 7: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

7 / 18Harald Riegler

HZB/Hierarchical occlusion mapsHZB/Hierarchical occlusion maps

Page 8: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

8 / 18Harald Riegler

Hierarchical occlusion mapsHierarchical occlusion maps

Potential occluders are pre-selectedPotential occluders are pre-selected These occluders are rendered to the These occluders are rendered to the

occlusion map. The hierarchy can be built occlusion map. The hierarchy can be built with MIP-Mapping HWwith MIP-Mapping HW

Depth test Depth test afterafter occlusion test occlusion test Seperate depth estimation bufferSeperate depth estimation buffer

Page 9: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

9 / 18Harald Riegler

Hierarchical View Frustum CullingHierarchical View Frustum Culling

Speeds up VFC by testing only 2 box Speeds up VFC by testing only 2 box corners of a bounding box first.corners of a bounding box first.

Plane coherency during frame advancingPlane coherency during frame advancing Test against VF-octants.Test against VF-octants. BB-Child maskingBB-Child masking

Page 10: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

10 / 18Harald Riegler

Hierarchical Back-Face CullingHierarchical Back-Face Culling

Partitions each model into clustersPartitions each model into clusters Primitives in one cluster are:Primitives in one cluster are:

Facing into similar directionsFacing into similar directions Lie close to each otherLie close to each other

If the cluster fails the visibility test, all If the cluster fails the visibility test, all primitives in this cluster are culledprimitives in this cluster are culled

Page 11: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

11 / 18Harald Riegler

Hierarchical Back-Face CullingHierarchical Back-Face Culling

Page 12: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

12 / 18Harald Riegler

The Real World (1)The Real World (1)

Scientific approaches often too complicated Scientific approaches often too complicated Science often uses models with hundreds of Science often uses models with hundreds of

thousands of vertices, games don’t. (LOD)thousands of vertices, games don’t. (LOD) Game developers “pick” ideas from different Game developers “pick” ideas from different

algorithmsalgorithms Research has impact on hardware design!Research has impact on hardware design!

Page 13: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

13 / 18Harald Riegler

The Real World (2)The Real World (2)

Parts of the HZB are used sometimesParts of the HZB are used sometimes Runtime-LOD is used as input for a simple Runtime-LOD is used as input for a simple

HZBHZB VFC is almost always used. VFC is almost always used. HOM introduce too much overhead for HOM introduce too much overhead for

games, and the z-buffer is there anywaygames, and the z-buffer is there anyway A simplified HBFC can be usedA simplified HBFC can be used

Page 14: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

14 / 18Harald Riegler

The Real World (3)The Real World (3)

PSX-One doesn’t even have a z-buffer PSX-One doesn’t even have a z-buffer ATI’s Radeon has parts of a HZB (Called ATI’s Radeon has parts of a HZB (Called

Hyper-Z)Hyper-Z) GForce2 only has a z-bufferGForce2 only has a z-buffer GForce3 similar to Radeon, but supports GForce3 similar to Radeon, but supports

HZB visibility queryHZB visibility query Dreamcasts Power-VR2 works pretty Dreamcasts Power-VR2 works pretty

different (Infinite planes)different (Infinite planes)

Page 15: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

15 / 18Harald Riegler

A PSX ExampleA PSX Example Iron Soldier 3 on PSX:Iron Soldier 3 on PSX:

VFC based on a quad-treeVFC based on a quad-tree BFCBFC Painters algorithmPainters algorithm

Page 16: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

16 / 18Harald Riegler

Conclusions (1)Conclusions (1)

Visibility algorithms are used in many Visibility algorithms are used in many different applicationsdifferent applications Occlusion cullingOcclusion culling Shadow calculationsShadow calculations RadiosityRadiosity Volumetric lightsVolumetric lights

All these fields benefit from advances in All these fields benefit from advances in visibility techniquesvisibility techniques

Page 17: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

17 / 18Harald Riegler

Conclusion (2)Conclusion (2)

Occlusion culling will gain importanceOcclusion culling will gain importance More OC will be implemented in hardwareMore OC will be implemented in hardware Discrepancies between science and gaming Discrepancies between science and gaming

industry will alway exist due to different industry will alway exist due to different goalsgoals

Page 18: Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from

Hope you enjoyed the ride!Hope you enjoyed the ride!