The Performance Impact from Processing Clipped Triangles in State-Of-The-Art Games

The Performance Impact from Processing Clipped Triangles in State-Of-The-Art Games

Master of Science in Computer Science May 2018 The performance impact from processing clipped triangles in state-of-the-art games. Christoffer Karlsson Faculty of Computing, Blekinge Institute of Technology, 371 79 Karlskrona, Sweden This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfilment of the requirements for the degree of Master of Science in Computer Science. The thesis is equivalent to 10 weeks of full time studies. The authors declare that they are the sole authors of this thesis and that they have not used any sources other than those listed in the bibliography and identified as references. They further declare that they have not submitted this thesis at any other institution to obtain a degree. Contact Information: Author: Christoffer Karlsson E-mail: [email protected] University advisors: Associate Professor Hans Tap Department of Department of Creative Technologies Lecturer Stefan Petersson Department of Department of Creative Technologies Faculty of Computing Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 SE{371 79 Karlskrona, Sweden Fax : +46 455 38 50 57 Abstract Background. Modern game applications pressures hardware to its limits, and af- fects how graphics hardware and APIs are designed. In games, rendering geometry plays a vital role, and the implementation of optimization techniques, such as view frustum culling, is generally necessary to meet the quality expected by the customers. Failing to optimize a game application can potentially lead to higher system require- ments or less quality in terms of visual effects and content. Many optimization techniques, and studies of the performance of such techniques exist. However, no research was found where the utilization of computational resources in the GPU, in state-of-the-art games, was analyzed. Objectives. The aim of this thesis was to investigate the potential problem of com- mercial game applications wasting computational resources. Specifically, the focus was set on the triangle data processed in the geometry stage of the graphics pipeline, and the amount of triangles discarded through clipping. Methods. The objectives were met by conducting a case study and an empiri- cal data analysis of the amount triangles and entire draw calls that were discarded through clipping, as well as the vertex data size and the time spent on processing these triangles, in eight games. The data was collected using Triangelplockaren, a tool which collects the triangle data that reaches the rasterizer stage. This data was then analyzed and discussed through relational findings in the results. Results. The results produced consisted of 30 captures of benchmark and gameplay sessions. The average of each captured session was used to make observations and to draw conclusions. Conclusions. This study showed evidence of noteworthy amounts of data being pro- cessed in the GPU which is discarded through clipping later in the graphics pipeline. This was seen in all of the game applications included in this study. While it was impossible to draw conclusions regarding the direct impact on performance, it was safe to say that the performance relative to the geometry processed was significant in each of the analyzed cases, and in many cases extreme. Keywords: game, optimization, geometry, graphics pipeline i Acknowledgments Many thanks to Stefan Petersson { whom without, this project would not have been possible, as Triangelplockaren is the only tool found which could measure the data required. ii Contents Abstract i Acknowledgments ii 1 Introduction 2 1.1 The graphics pipeline . 2 1.2 Performance and optimization . 4 1.3 Aim . 5 1.4 Research questions . 5 2 Related Work 6 2.1 Culling techniques . 6 3 Method 8 3.1 Game application selection . 8 3.2 Data collection tool { Triangelplockaren . 9 3.3 Experiment setup . 12 3.4 Data collection . 13 3.5 Restrictions . 13 4 Results 14 5 Analysis and Discussion 24 5.1 Battlefield 1 . 24 5.2 Deus Ex: Mankind Divided . 25 5.3 FIFA 18 . 25 5.4 Hitman . 25 5.5 Rise of the Tomb Raider . 26 5.6 Sniper Elite 4 . 26 5.7 Tom Clancy's The division . 26 5.8 Total War: Warhammer II . 27 6 Conclusions 28 7 Future work 29 References 30 iii List of Figures 1.1 An overview of the stages geometry go through when rendering graph- ics in Direct3D. The full pipeline represents the process for presenting a geometrical object on the screen, where all stages except the ver- tex shader stage is optional. The geometry stage, marked with a blue clamp, incorporates the processing and transformation of geometri- cal information in the GPU. In the remaining stages, the geometry is converted to fragments through scan conversion, and colored in one or more pixel-shaders. This is also where post-processing is applied. 3 1.2 Illustration of a camera view frustum. The frustum is essentially the mathematical combination of a view- and projection matrix, which defines the orientation and bounds of the frustum. 4 3.1 Screen capture from Battlefield 1 gameplay. 10 3.2 Screen capture from Battlefield 1 gameplay, representing the perspec- tive projected triangles rendered to the screen, from the player cameras perspective, and captured by Triangelplockaren in the current frame. This image only shows triangles that have been projected using the player camera transform matrices, and does not show, for example, triangles rendered in a draw call for effects such as shadow mapping. 11 3.3 Screen capture from Battlefield 1 gameplay, representing geometry in the same way as in Figure 3.2, but seen from a different angle through Triangelplockaren. Red colored geometry represents geometry which is outside the player camera viewing frustum, green geometry is inside the frustum, and triangles where only edges are visible uses alpha blending (mostly particles). Again, perspective projected triangles from other viewing frustums are left out in this image. 12 4.1 Graphs representing the data collected in the Battlefield 1 gameplay capture. 16 4.2 Graphs representing the data collected in the Deus Ex: Mankind Di- vided gameplay capture. 17 4.3 Graphs representing the data collected in the FIFA 18 gameplay capture. 18 4.4 Graphs representing the data collected in the Hitman gameplay capture. 19 4.5 Graphs representing the data collected in the Rise of the Tomb Raider gameplay capture. 20 4.6 Graphs representing the data collected in the Sniper Elite 4 gameplay capture. 21 iv 4.7 Graphs representing the data collected in the Tom Clancy's The Di- vision gameplay capture. 22 4.8 Graphs representing the data collected in the Total War: Warhammer II gameplay capture. 23 v List of Tables 4.1 A table showing the average per frame data for each capture. The val- ues displayed for each capture have been divided into four categories: Time, presenting the percentage of time spent on processing triangles outside the viewing frustum in relation to the time to process all tri- angles. Triangles, presenting the average number of triangles rendered per frame, and the percentage of triangles residing outside the view- ing frustum. Draw calls, presenting the average number of draw calls and the percentage of whole draw calls outside the viewing frustum. Vertex data, presenting the average vertex data size in bytes, and the percentage residing outside the viewing frustum. 15 vi Glossary Draw call A call to the graphics APIs draw operation. A draw call submits work to the render- ing pipeline and executes it. The amount of work (geometry to be rendered) varies between draw calls. State-of-the-art game State-of-the-art game in this context is defined as a game supporting Direct3D 12, where the publishing organization is well established, with a larger number of pub- lished titles. Vertex A point in space, consisting of information such as positional coordinates. Typically a point where two or more lines meet. A triangle would, for example, have three vertices. 1 Chapter 1 Introduction As computer hardware advances, video game developers continue to push the hard- ware to its limits by producing more resource demanding applications. In game applications, rendering objects generally plays a key role, and hardware developers are tailoring GPUs to suit the needs of modern games. This involves adding new features, such as the programmable geometry engine in the Vega Architecture[8], as well as improving the performance of certain tasks [1][11]. 1.1 The graphics pipeline Game objects rendered to a screen go through a series of stages called the graphics pipeline. This pipeline differs between graphics APIs, but essentially includes the same steps and operations. The graphics pipeline structure for Direct3D can be seen in Figure 1.1. Older depictions of the graphics pipeline also includes a stage prior to this, called the application stage, which represents the CPU-side of a game. This is where things like game logic, sound and input is handled, as well as the configuration of how game object geometry should be processed by the GPU. This configuration specifies which hardware functionality to utilize and in what way it should perform certain tasks. The configuration also includes specifications of the format and layout of the geometric data. After the application stage, the geometric data, which can consist of points, lines, triangles, or any other primitive-type the developer has specified, is read by GPU. The remaining stages of the graphics pipeline takes place in the GPU [9], starting with the geometry stage. As presented in Figure 1.1, the geometry stage includes several stages, which will from now on be referred to as functional stages. These functional stages vary in complexity, an example being the shader stages, which are programmable and used to transform the input geometry.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    41 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us