This book covers real-time shading systems, their design and how they work. Procedural shading, long valued for off-line rendering and production animation is now possible on interactive graphics hardware. These developments are important for areas such as game development, product design, and scientific visualization, among others. The authors include examples of techniques for achieving common effects efficiently in a real-time shading language ranging from full procedural shading on advanced specialized hardware to limited, yet surprisingly flexible shading on unextended OpenGL, to modern PC graphics accelerators.
Author(s): Marc Olano, Wolfgang Heidrich
Edition: 1st
Publisher: A K Peters
Year: 2002
Language: English
Commentary: index is missing
Pages: 360
Tags: Информатика и вычислительная техника;Компьютерная графика;
Contents......Page 8
Preface......Page 16
Acknoledgment......Page 20
I: Fundamentals......Page 24
1. Introduction......Page 26
1.1.1 Real Time......Page 27
1.1.2 Shading......Page 28
1.2.2 Procedural Shaders......Page 29
1.2.3 Textures and Sampled Representations......Page 31
1.3 A Grammatical Model for Shading Pipelines......Page 33
1.3.2 Deferred Shading......Page 35
2. Reflectance......Page 38
2.1 BRDFs and Lighting Models......Page 39
2.2 Physical Plausibility......Page 44
2.2.1 Energy Conservation......Page 45
2.2.2 Reciprocity......Page 46
2.3 Isotropy and Anisotropy......Page 47
2.4 Surface Coordinate Conventions......Page 48
2.5.1 Diffuse Reflection......Page 51
2.5.2 Specular Reflection......Page 52
2.5.3 Fresnel Effect......Page 53
2.6.1 Phong Model......Page 56
2.6.3 Blinn-Phong Model......Page 57
2.6.4 Lafortune Generalized Phong Model......Page 58
2.6.5 Banks Anisotropic Model......Page 59
2.7 Physically Based Models......Page 60
2.7.1 Cook-Torrance Model......Page 62
2.7.2 Ashikhmin Model......Page 65
3.1 Texture Mapping......Page 68
3.2.1 Ambient and Diffuse Textures......Page 71
3.2.2 Environment Maps......Page 72
3.2.3 Displacement Maps......Page 77
3.2.4 Bump Maps......Page 78
3.2.5 Shadow Maps......Page 81
3.3 Image Texture Antialiasing......Page 82
3.3.1 Texture Magnification......Page 84
3.3.2 Texture Prefiltering for Minification......Page 86
3.4 Solid Texturing......Page 90
3.5 Procedural Texturing......Page 91
3.6 Noise Functions......Page 92
3.6.1 Implementations......Page 94
3.6.2 A Multipass Implementation......Page 95
4.1 Logical Model......Page 98
4.2 Procedural Shading Testbeds......Page 100
4.3 RenderMan......Page 102
4.4 Elements of Procedural Shaders......Page 104
4.4.1 Maps......Page 106
4.4.2 Modeling......Page 107
4.4.3 Transformation......Page 110
4.4.4 Primitives......Page 113
4.4.5 Interpolation......Page 114
4.4.6 Surface Shading......Page 115
4.4.7 Lighting......Page 117
4.4.8 Volume and Atmospheric Effects......Page 119
4.4.9 Image Warping and Filtering......Page 120
4.4.10 Shading Capabilities......Page 121
4.5 Antialiasing......Page 123
4.5.2 Frequency Attenuation......Page 124
4.5.3 Super Sampling......Page 125
5.1 Graphics Accelerators......Page 126
5.2 Programmable Shading Hardware......Page 127
5.4 Pixel Shaders......Page 129
5.4.1 Dependent Texturing......Page 130
5.6 Logical Models for Consumer Hardware......Page 131
II: Building Blocks for Shading......Page 134
6. Texture Shading......Page 136
6.1 One-Texture Shading......Page 138
6.2 Parameterization and Interpolation......Page 139
6.3 Normal Lighting......Page 141
6.4 Factored Multitexture Models......Page 142
6.5 Anisotropic Models......Page 147
6.5.1 Banks Model......Page 148
6.5.2 Ashikhmin Model......Page 149
6.6 Numerical Factorization......Page 154
6.6.1 Singular Value Decomposition......Page 155
6.6.2 Homomorphic Factorization......Page 157
6.7 Texture Mapping Revisited......Page 160
6.7.1 Material Mapping......Page 161
6.7.2 Bump, Twist, and Frame Mapping......Page 163
7. Environment Maps for Illumination......Page 166
7.1 Decomposition......Page 167
7.1.1 Generalized Mirror Reflections Using a Fresnel Term......Page 168
7.2 Prefiltered Environment Maps......Page 170
7.2.1 Diffusely Prefiltered Maps......Page 172
7.2.2 Glossy Prefiltering of Environment Maps......Page 174
7.2.3 Approximations of General Isotropic BRDFs......Page 176
7.2.4 Hardware-Accelerated Prefiltering......Page 177
7.3 Environment Map Interpolation......Page 181
8.1 Shading with a Texture Atlas......Page 186
8.2 Texture Atlas Layout......Page 189
8.3 Avoiding Seam Artifacts......Page 192
III: High-Level Procedural Shading......Page 196
9.2 Parameterized Shading......Page 198
9.3 Programmable Shading......Page 200
9.4 Procedural Shading......Page 201
9.5 Why Use Procedural Shading?......Page 202
10. APST: Antialiased Parameterized Solid Texturing......Page 206
10.1 Examples......Page 207
10.2 Antialiasing......Page 211
10.3 Implementation......Page 216
11.1 Organization of a Compiler......Page 218
11.1.1 Parsing......Page 219
11.1.2 Internal Passes......Page 220
11.1.3 Optimizations......Page 222
11.1.4 Instruction Selection......Page 223
11.2 Intermediate Forms......Page 224
11.3 Optimization for Graphics Hardware......Page 225
11.3.2 Specializing Shaders......Page 226
11.4.1 Parsing......Page 227
11.4.2 Code Generation......Page 228
12.1 Shader Types......Page 234
12.2 Illuminate......Page 235
12.4 Functions......Page 237
13.2 The Pfman Language......Page 242
13.2.1 Fixed Point......Page 243
13.2.2 Common Shader Parameters......Page 245
13.3 Pfman Implementation......Page 246
13.3.2 Compiler Passes......Page 251
14. ISL: Interactive Shading Language......Page 254
14.2 The ISL Language......Page 255
14.2.1 Data Types......Page 257
14.2.2 Control Constructs......Page 258
14.3.1 Conversion to Linear Form......Page 259
14.3.2 Targeting Hardware......Page 260
14.3.3 Emitting Code......Page 261
15.1 Logical Model......Page 262
15.2.1 Computational Frequency......Page 263
15.2.2 Data Types......Page 264
15.3 Functions......Page 265
15.3.1 Operations......Page 266
15.4 RTSL Implementation......Page 268
15.4.2 Register Combiner Back-End......Page 269
16. ESMTL: The Evans & Sutherland Multitexturing Language......Page 272
16.1.1 Scalar Bracketing......Page 273
16.1.3 Interpolation of Bracketed Expressions......Page 274
16.2 Multipass/Multitextured Texture Shading......Page 276
16.3 Example: A Seeliger Skin Shader......Page 277
16.4 Stratification......Page 279
17.1 Logical Model......Page 284
17.2 Data Types......Page 285
17.4 Functions......Page 286
17.5 Comparison......Page 287
18. APIs......Page 290
18.1.1 Shading Parameters......Page 291
18.1.2 Shader Instances......Page 292
18.1.3 Lights......Page 294
18.2.1 Callbacks......Page 295
18.2.2 Class Hierarchy......Page 296
18.3 SMASH......Page 297
18.3.2 Activating Shaders......Page 299
18.3.4 Saving and Restoring Precompiled Shaders......Page 300
18.3.6 Shader Programming Calls......Page 301
18.3.7 Subshaders......Page 315
18.3.8 Base Example......Page 316
18.3.9 Macros......Page 317
18.3.10 Textual Infix Expressions......Page 319
18.3.11 Textual Shading Languages......Page 324
18.3.12 Object-Oriented Toolkits......Page 325
IV: And Beyond......Page 330
19.1 Predicting the Recent Past......Page 332
19.2 Increasing Range and Precision......Page 333
19.3 Real-Time RenderMan versus Real-Time Toy Story......Page 337
19.4 Render to Texture......Page 340
19.6 Transparency and Order Independence......Page 341
19.7 The GPU as a Supercomputing Co-Processor......Page 342
Bibliography......Page 346