COMP37111: Advanced Computer Graphics Realistic and Realtime Rendering Steve Pettifer September 2013 School of Computer Science The University of Manchester
COMP37111 Realistic and Realtime Rendering Contents 1 How to use these notes 4 2 What you should know already 5 3 Improving these notes 5 4 Solving The Rendering Equation 6 5 The Bidirectional Reflectance Distribution Function 7 6 Ray Tracing 11 7 The mathematics of ray / object intersections 14 7.1 Intersection of a ray and a sphere . . . . . . . . . . . . . . . . 15 7.2 Intersection of a ray and a polygon . . . . . . . . . . . . . . . 16 7.3 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 7.4 Ray Tracing Ponderings . . . . . . . . . . . . . . . . . . . . . 21 8 Radiosity 22 8.1 Calculating the Form Factor . . . . . . . . . . . . . . . . . . . 28 8.2 Issues with the basic Radiosity technique . . . . . . . . . . . 30 8.3 Pros and cons of Radiosity . . . . . . . . . . . . . . . . . . . . 32 8.4 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.5 Radiosity Ponderings . . . . . . . . . . . . . . . . . . . . . . . 33 9 Volume Rendering 34 10 Direct Volume Rendering 35 10.1 Trilinear Interpolation . . . . . . . . . . . . . . . . . . . . . . 37 10.2 Computing the colour . . . . . . . . . . . . . . . . . . . . . . 39 10.3 Indirect Volume Rendering . . . . . . . . . . . . . . . . . . . 40 10.4 Proxy Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . 48 10.4.1 Splatting . . . . . . . . . . . . . . . . . . . . . . . . . . 49 10.4.2 Shear warp . . . . . . . . . . . . . . . . . . . . . . . . 49 10.4.3 Texture mapping . . . . . . . . . . . . . . . . . . . . . 50 10.4.4 GPU-accelerated Volume Rendering . . . . . . . . . . 50 10.5 A comparison of direct and indirect techniques . . . . . . . . 52 10.6 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 10.7 Volume Rendering Ponderings . . . . . . . . . . . . . . . . . 53 11 Spatial Enumeration 54 11.1 The Gridcell . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 11.2 The Octree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 11.3 Hierarchical Bounding Volumes . . . . . . . . . . . . . . . . . 56 1
COMP37111 Realistic and Realtime Rendering 11.4 Binary Space Partitioning . . . . . . . . . . . . . . . . . . . . 59 11.5 Generating BSP Trees . . . . . . . . . . . . . . . . . . . . . . . 61 11.6 Traversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 11.7 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 11.8 Spatial Enumeration Ponderings . . . . . . . . . . . . . . . . 65 12 Culling 66 12.1 Detail culling . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 12.2 Backface culling . . . . . . . . . . . . . . . . . . . . . . . . . . 66 12.3 Frustum Culling . . . . . . . . . . . . . . . . . . . . . . . . . . 67 12.4 Occlusion Culling . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.5 Culling Ponderings . . . . . . . . . . . . . . . . . . . . . . . . 69 13 Acknowledgements 71 14 License 71 A Reading material 72 A.1 The Rendering Equation . . . . . . . . . . . . . . . . . . . . . 72 A.2 Ray Tracing Jell-O Brand Gelatin . . . . . . . . . . . . . . . . 73 A.3 An Improved Illumination Model for Shaded Display . . . . 74 A.4 Ray Tracing on Programmable Graphics Hardware . . . . . 74 A.5 Distributed Interactive Ray Tracing of Dynamic Scenes . . . 74 A.6 The Hemi-cube: a Radiosity Solution for Complex Environ- ments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 A.7 Perceptually-Driven Radiosity . . . . . . . . . . . . . . . . . . 74 A.8 Volume Rendering: Display of Surfaces from Volume Data . 75 A.9 Multi-GPU Volume Rendering using MapReduce . . . . . . 76 A.10 Introduction to bounding volume hierarchies . . . . . . . . . 76 A.11 Portals and mirrors: Simple, Fast evaluation of Potentially Visible Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 A.12 Hierarchical Z-Buffer Visibility . . . . . . . . . . . . . . . . . 76 B Frequently Asked Questions 77 B.1 Do I need to read through all of the notes you’ve written? . . 77 B.2 If I read and understand all the notes, will I know everything I need to for the exam? . . . . . . . . . . . . . . . . . . . . . . 77 B.3 Do I need to remember all the names of people who invented techniques? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 B.4 There’s a lot of maths. Do I need to remember it all? . . . . . 77 B.5 Am I expected to follow up all the Wikipedia links? . . . . . 77 B.6 Am I expected to read all the papers in the Appendixes? . . 78 B.7 Should I read all the references too? . . . . . . . . . . . . . . 78 B.8 The paper about the Jello equation. It’s a spoof, surely? . . . 78 2
COMP37111 Realistic and Realtime Rendering B.9 Do I need to know the answers to all the ponderings? . . . . 78 C Example GPU code for Phong Shading 79 D Background maths 80 D.1 Simple vector algebra . . . . . . . . . . . . . . . . . . . . . . . 80 D.1.1 Vector addition and subtraction . . . . . . . . . . . . . 81 D.1.2 Scalar product . . . . . . . . . . . . . . . . . . . . . . . 81 D.1.3 Lamberts Cosine Law . . . . . . . . . . . . . . . . . . 82 D.1.4 Vector product . . . . . . . . . . . . . . . . . . . . . . 83 D.2 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3
COMP37111 Realistic and Realtime Rendering 1 How to use these notes These notes are intended to help reinforce (and definitely not replace!) the material that’s presented in the second half of the COMP37111 course unit’s lectures; they’re also a decent starting point for your revision. After each lecture, you should read through the relevant section of these notes to make sure you’ve understood the concepts. Most of the diagrams that are used in the lectures are reproduced here, so you don’t need to copy them down during the lecture; but many of the images, which only make their point when they are large and in colour aren’t included. At the end of each section, there are a series of questions and ‘ponder- ings’. The questions have relatively straightforward and definite answers, which have been covered in some form in the lectures or notes: you should use these to test your understanding of the material. Ponderings, on the other hand, are more open-ended questions about the topic that’s just been covered. In some cases, the answer will already have been hinted at (or even given, obliquely) in the notes or lectures, but in most cases these are designed to provoke you to think a bit more deeply about the concepts you’ve just encountered. There may not even be an answer to some of the ponderings; but if you can come to that conclusion yourself (correctly!), then it means you’ve understood the material pretty well. At the beginning of every lecture, we’ll revisit the ponderings from the previous section for a few minutes, and there will also be an opportunity to ask questions of your own about the previous material. Each section has some associated research papers in Appendix A. Some of these papers are from way back in the mists of computer graphics his- tory, and are the seminal papers that sparked a particular way of doing things. You should be able to understand most of their content fairly easily, since it will have been explained in these notes. Others are more up-to-date papers about recent developments, and these are designed to give you a flavour of what has happened in the field since; for these, don’t worry too much if you don’t understand the details, they are designed to give you a flavour and a bit of breadth to your knowledge. None of the details from either category of papers are examinable in themselves; but even a super- ficial understanding of their contents will help you write more mature and authoritative answers in the exam. Throughout the notes, there are many references to other scholarly pa- pers about computer graphics; apart from those that are given in the Ap- pendix, you don’t need to read these, and the citations are included in case you want to follow something up in a lot more detail. Finally, there are numerous terms highlighted like this W , in bold and with a ‘w’ superscript. If you don’t understand what the term means in the context in which its written (or you do know what the terms means but are curious to broaden your understanding of that topic a bit), then you 4
Recommend
More recommend