3D游戏引擎设计实时计算机图形学的应用方法(英文版)(第2版)(图灵原版计算机科学系列)(3D Game Engine Design A Practical Approach to Real-Time Computer Graphics Second Edition)
![3D游戏引擎设计实时计算机图形学的应用方法(英文版)(第2版)(图灵原版计算机科学系列)(3D Game Engine Design A Practical Approach to Real-Time Computer Graphics Second Edition)](http://image.wangchao.net.cn/small/product/1247224512918.jpg)
分類: 图书,计算机与互联网,图形图像、动画、多媒体与网页开发,计算机图形学,
品牌: David H.Eberly
基本信息·出版社:人民邮电出版社
·页码:1015 页
·出版日期:2009年
·ISBN:7115195536/9787115195531
·条形码:9787115195531
·包装版本:1版
·装帧:平装
·开本:16
·正文语种:中文
·丛书名:图灵原版计算机科学系列
·外文书名:3D Game Engine Design A Practical Approach to Real-Time Computer Graphics Second Edition
产品信息有问题吗?请帮我们更新产品信息。
内容简介《3D游戏引擎设计实时计算机图形学的应用方法》(英文版·第2版)深入剖析了3D游戏引擎的设计,书中许多内容对于更好地理解3D计算机图形学也极有帮助。《3D游戏引擎设计实时计算机图形学的应用方法》(英文版·第2版)首先介绍了几何转换和坐标系统等较基础的内容,然后介绍曲线、渲染、效果等高级知识。《3D游戏引擎设计实时计算机图形学的应用方法》(英文版·第2版)基于作者自身在游戏产业中的工作、研究经验,提供了算法、编程技术、代码等大量实用信息,对于游戏设计者及相应的编程人员来说,是一本非常有价值的参考书。《3D游戏引擎设计实时计算机图形学的应用方法》(英文版·第2版)适合高等院校相关专业的师生、接受游戏软件开发培训的学生、相关技术人员及游戏开发人员阅读。
作者简介David H.Eberly著名游戏开发大师。实时三维游戏引擎Netlmmerse和Gamebryo(支持了文明、辐射和战锤等著名游戏)的核心开发者之一。目前是Geometric Tools公司总裁,主持设计了实时三维游戏引擎Wild Magic。他拥有数学和计算机科学两个博士学位。除本书外,他还著有Game Physics和3D Game Engine Architecture等名著。
媒体推荐“这是一部杰作,出自一位著名引擎开发人员之手。书中公开了大量的实战技术内幕。强烈推荐!”
——Tim Sweeney,游戏开发大师,Unreal引擎之父,Epic公司创始人
“我相信,这部力作将成为游戏开发领域的圣经,它会大大提升游戏开发人员的整体水平。”
——Andrea Pessino,《魔兽争霸3》核心开发人员
编辑推荐《3D游戏引擎设计实时计算机图形学的应用方法》(英文版·第2版)是3D游戏引擎设计的经典著作,是作者多年游戏开发工作经验的结晶。书中以一个真实的引擎Wild Magic为例,对3D游戏引擎的开发进行了全面而且深入的阐释,不仅讲述了必要的数学、物理和图形学理论知识和基本算法,还第一次揭示了设计和构建一个真实的实时图形引擎所需的各种复杂技术和过程。内容涵盖图形系统、软件和硬件渲染、场景图形、基于控制器的动画、空间排序、碰撞检测、数值方法、内存管理等。书中附有大量代码示例,完整实现了核心算法。
目录
Chapter 1Introduction1
1.1The Evolution of Graphics Hardware and Games1
1.2The Evolution of This Book and Its Software2
1.3A Summary of the Chapters3
Chapter 2The Graphics System7
2.1The Foundation8
2.1.1Coordinate Systems9
2.1.2Handedness and Cross Products10
2.1.3Points and Vectors15
2.2Transformations18
2.2.1Linear Transformations18
2.2.2Affine Transformations29
2.2.3Projective Transformations31
2.2.4Properties of Perspective Projection35
2.2.5Homogeneous Points and Matrices40
2.3Cameras43
2.3.1The Perspective Camera Model43
2.3.2Model or Object Space48
2.3.3World Space48
2.3.4View, Camera, or Eye Space50
2.3.5Clip, Projection, or Homogeneous Space52
2.3.6Window Space56
2.3.7Putting Them All Together58
2.4Culling and Clipping66
2.4.1Object Culling66
2.4.2Back-Face Culling67
2.4.3Clipping to the View Frustum70
2.5Rasterizing77
2.5.1Line Segments77
2.5.2Circles82
2.5.3Ellipses84
2.5.4Triangles89
2.6Vertex Attributes92
2.6.1Colors92
2.6.2Lighting and Materials92
2.6.3Textures99
2.6.4Transparency, Opacity, and Blending117
2.6.5Fog122
2.6.6And Many More123
2.6.7Rasterizing Attributes124
2.7Issues of Software, Hardware, and APIs125
2.7.1A General Discussion125
2.7.2Portability versus Performance127
2.8API Conventions128
2.8.1Matrix Representation and Storage129
2.8.2Matrix Composition134
2.8.3View Matrices134
2.8.4Projection Matrices136
2.8.5Window Handedness139
2.8.6Rotations140
2.8.7Fast Computations Using the Graphics API143
Chapter 3Renderers147
3.1Software Rendering149
3.1.1Vertex Shaders149
3.1.2Back-Face Culling151
3.1.3Clipping154
3.1.4Rasterizing158
3.1.5Edge Buffers159
3.1.6Scan Line Processing161
3.1.7Pixel Shaders164
3.1.8Stencil Buffering167
3.1.9Depth Buffering169
3.1.10Alpha Blending170
3.1.11Color Masking171
3.1.12Texture Sampling171
3.1.13Frame Buffers172
3.2Hardware Rendering173
3.3An Abstract Rendering API175
3.3.1Construction and Destruction175
3.3.2Camera Management176
3.3.3Global-State Management177
3.3.4Buffer Clearing178
3.3.5Object Drawing179
3.3.6Text and 2D Drawing180
3.3.7Miscellaneous180
3.3.8Resource Management182
3.4The Heart of the Renderer194
3.4.1Drawing a Scene195
3.4.2Drawing a Geometric Primitive198
3.4.3Applying an Effect199
3.4.4Loading and Parsing Shader Programs201
3.4.5Validation of Shader Programs213
Chapter 4Scene Graphs217
4.1Scene Graph Design Issues217
4.1.1The Core Classes221
4.1.2Spatial Hierarchy Design226
4.1.3Sharing of Objects230
4.2Geometric State233
4.2.1Vertex Buffers and Index Buffers233
4.2.2Transformations234
4.2.3Bounding Volumes244
4.2.4Geometric Types251
4.3Render State259
4.3.1Global State259
4.3.2Lights261
4.3.3Effects266
4.4The Update Pass268
4.4.1Geometric-State Updates268
4.4.2Render-State Updates280
4.5The Culling Pass289
4.5.1Hierarchical Culling293
4.5.2Sorted Culling296
4.6The Drawing Pass297
4.6.1Single-Pass Drawing298
4.6.2Single-Effect, Multipass Drawing302
4.6.3Multiple-Effect Drawing304
4.7Scene Graph Compilers305
4.7.1A Scene Graph as an Expression307
4.7.2Semantics of Compilation311
Chapter 5Controller-Based Animation315
5.1Keyframe Animation317
5.1.1Interpolation of Position317
5.1.2Interpolation of Orientation318
5.1.3Interpolation of Scale318
5.2Keyframe Compression320
5.2.1Fitting Points with a B-Spline Curve321
5.2.2Evaluation of a B-Spline Curve325
5.2.3Optimized Evaluation for Degree 3333
5.3Inverse Kinematics339
5.3.1Numerical Solution by Jacobian Methods341
5.3.2Numerical Solution by Nonlinear Optimization342
5.3.3Numerical Solution by Cyclic Coordinate Descent342
5.4Skinning347
5.5Vertex Morphing349
5.6Particle Systems350
Chapter 6Spatial Sorting353
6.1Binary Space Partitioning Trees354
6.1.1BSP Tree Construction355
6.1.2BSP Tree Usage357
6.2Node-Based Sorting365
6.3Portals366
6.4User-Defined Maps375
6.5Occlusion Culling375
Chapter 7Level of Detail377
7.1Sprites and Billboards378
7.2Discrete Level of Detail379
7.3Continuous Level of Detail380
7.3.1Simplification Using Quadric Error Metrics380
7.3.2Reordering of Vertices and Indices385
7.3.3Terrain386
7.4Infinite Level of Detail387
Chapter 8Collision Detection389
8.1The Method of Separating Axes393
8.1.1Extrema of Convex Polygons or Convex Polyhedra394
8.1.2Stationary Objects404
8.1.3Objects Moving with Constant Linear Velocity412
8.1.4Oriented Bounding Boxes436
8.2Finding Collisions between Moving Objects444
8.2.1Pseudodistance444
8.2.2Contact between Moving Intervals446
8.2.3Computing the First Time of Contact448
8.2.4Estimating the First Derivative453
8.3A Dynamic Collision Detection System455
8.3.1The Abstract Base Class455
8.3.2Pseudodistances for Specific Pairs of Object Types461
8.3.3Collision Culling with Axis-Aligned Bounding Boxes465
8.4Object Picking472
8.4.1Constructing a Pick Ray472
8.4.2Scene Graph Support475
8.4.3Staying on Top of Things479
8.4.4Staying Out of Things481
8.5Pathfinding to Avoid Collisions481
8.5.1Environments, Levels, and Rooms482
8.5.2Moving between Rooms486
8.5.3Moving between Levels486
8.5.4Moving through the Outdoor Environment488
8.5.5Blueprints488
8.5.6Visibility Graphs489
8.5.7Envelope Construction494
8.5.8Basic Data Structures503
8.5.9Efficient Calculation of the Visibility Graph504
Chapter 9Physics507
9.1Particle Systems508
9.2Mass-Spring Systems510
9.2.1Curve Masses510
9.2.2Surface Masses513
9.2.3Volume Masses516
9.2.4Arbitrary Configurations519
9.3Deformable Bodies521
9.4Rigid Bodies522
9.4.1The Rigid Body Class525
9.4.2Computing the Inertia Tensor527
Chapter 10Standard Objects529
10.1Linear Components529
10.2Planar Components532
10.3Boxes534
10.4Quadrics535
10.4.1Spheres535
10.4.2Ellipsoids535
10.4.3Cylinders537
10.4.4Cones537
10.5Sphere-Swept Volumes538
10.5.1Capsules539
10.5.2Lozenges539
Chapter 11Curves541
11.1Definitions542
11.2Reparameterization by Arc Length543
11.3B′ezier Curves545
11.3.1Definitions545
11.3.2Evaluation545
11.3.3Degree Elevation546
11.3.4Degree Reduction546
11.4Natural, Clamped, and Closed Cubic Splines548
11.4.1Natural Splines550
11.4.2Clamped Splines550
11.4.3Closed Splines550
11.5B-Spline Curves551
11.5.1Types of Knot Vectors552
11.5.2Evaluation553
11.5.3Local Control558
11.5.4Closed Curves558
11.6NURBS Curves560
11.7Tension-Continuity-Bias Splines562
11.8Parametric Subdivision566
11.8.1Subdivision by Uniform Sampling566
11.8.2Subdivision by Arc Length566
11.8.3Subdivision by Midpoint Distance567
11.8.4Fast Subdivision for Cubic Curves568
11.9Orientation of Objects on Curved Paths570
11.9.1Orientation Using the Frenet Frame571
11.9.2Orientation Using a Fixed Up-Vector571
Chapter 12Surfaces573
12.1Introduction573
12.2B′ezier Rectangle Patches574
12.2.1Definitions574
12.2.2Evaluation575
12.2.3Degree Elevation575
12.2.4Degree Reduction576
12.3B′ezier Triangle Patches578
12.3.1Definitions578
12.3.2Evaluation578
12.3.3Degree Elevation580
12.3.4Degree Reduction580
12.4B-Spline Rectangle Patches582
12.5NURBS Rectangle Patches583
12.6Surfaces Built from Curves584
12.6.1Cylinder Surfaces584
12.6.2Generalized Cylinder Surfaces585
12.6.3Revolution Surfaces586
12.6.4Tube Surfaces586
12.7Parametric Subdivision587
12.7.1Subdivision of Rectangle Patches587
12.7.2Subdivision of Triangle Patches602
Chapter 13Containment Methods609
13.1Spheres609
13.1.1Point in Sphere609
13.1.2Sphere Containing Points610
13.1.3Merging Spheres616
13.2Boxes617
13.2.1Point in Box617
13.2.2Box Containing Points618
13.2.3Merging Boxes625
13.3Capsules627
13.3.1Point in Capsule627
13.3.2Capsule Containing Points628
13.3.3Merging Capsules629
13.4Lozenges630
13.4.1Point in Lozenge631
13.4.2Lozenge Containing Points631
13.4.3Merging Lozenges633
13.5Cylinders634
13.5.1Point in Cylinder634
13.5.2Cylinder Containing Points634
13.5.3Least-Squares Line Moved to Minimum-Area Center635
13.5.4Merging Cylinders635
13.6Ellipsoids636
13.6.1Point in Ellipsoid636
13.6.2Ellipsoid Containing Points637
13.6.3Merging Ellipsoids638
Chapter 14Distance Methods639
14.1Point to Linear Component639
14.1.1Point to Line640
14.1.2Point to Ray640
14.1.3Point to Segment641
14.2Linear Component to Linear Component642
14.2.1Line to Line642
14.2.2Line to Ray643
14.2.3Line to Segment644
14.2.4Ray to Ray645
14.2.5Ray to Segment645
14.2.6Segment to Segment645
14.3Point to Triangle646
14.4Linear Component to Triangle651
14.4.1Line to Triangle651
14.4.2Ray to Triangle654
14.4.3Segment to Triangle654
14.5Point to Rectangle655
14.6Linear Component to Rectangle657
14.6.1Line to Rectangle657
14.6.2Ray to Rectangle659
14.6.3Segment to Rectangle660
14.7Triangle or Rectangle to Triangle or Rectangle661
14.8Point to Oriented Box663
14.9Linear Component to Oriented Box663
14.9.1Line to Oriented Box664
14.9.2Ray to Oriented Box666
14.9.3Segment to Oriented Box666
14.10Triangle to Oriented Box667
14.11Rectangle to Oriented Box669
14.12Oriented Box to Oriented Box670
14.13Miscellaneous672
14.13.1Point to Ellipse672
14.13.2Point to Ellipsoid673
14.13.3Point to Quadratic Curve or to Quadric Surface674
14.13.4Point to Circle in 3D675
14.13.5Circle to Circle in 3D676
Chapter 15Intersection Methods681
15.1Linear Components and Convex Objects681
15.2Linear Component and Planar Component684
15.3Linear Component and Oriented Box686
15.3.1Test-Intersection Query686
15.3.2Find-Intersection Query693
15.4Linear Component and Sphere698
15.4.1Line and Sphere698
15.4.2Ray and Sphere700
15.4.3Segment and Sphere701
15.5Line and Sphere-Swept Volume703
15.5.1Line and Capsule703
15.5.2Line and Lozenge708
15.6Line and Quadric Surface709
15.6.1Line and Ellipsoid709
15.6.2Line and Cylinder710
15.6.3Line and Cone710
15.7Culling Objects by Planes710
15.7.1Oriented Boxes711
15.7.2Spheres712
15.7.3Capsules712
15.7.4Lozenges713
15.7.5Ellipsoids713
15.7.6Cylinders715
15.7.7Cones716
15.7.8Convex Polygons or Convex Polyhedra717
Chapter 16Numerical Methods719
16.1Systems of Equations719
16.1.1Linear Systems719
16.1.2Polynomial Systems720
16.2Eigensystems722
16.2.1Extrema of Quadratic Forms722
16.2.2Extrema of Constrained Quadratic Forms723
16.3Least-Squares Fitting724
16.3.1Linear Fitting of Points (x, f (x))724
16.3.2Linear Fitting of Points Using Orthogonal Regression725
16.3.3Planar Fitting of Points (x,y,f (x,y))726
16.3.4Planar Fitting of Points Using Orthogonal Regression726
16.3.5Fitting a Circle to 2D Points727
16.3.6Fitting a Sphere to 3D Points729
16.3.7Fitting a Quadratic Curve to 2D Points731
16.3.8Fitting a Quadric Surface to 3D Points731
16.4Minimization732
16.4.1Methods in One Dimension732
16.4.2Methods in Many Dimensions733
16.5Root Finding736
16.5.1Methods in One Dimension736
16.5.2Methods in Many Dimensions740
16.6Integration742
16.6.1Romberg Integration742
16.6.2Gaussian Quadrature746
16.7Differential Equations747
16.7.1Ordinary Differential Equations747
16.7.2Partial Differential Equations750
16.8Fast Function Evaluation754
16.8.1Square Root and Inverse Square Root754
16.8.2Sine, Cosine, and Tangent755
16.8.3Inverse Tangent756
Chapter 17Rotations759
17.1Rotation Matrices759
17.1.1Axis/Angle to Matrix760
17.1.2Matrix to Axis/Angle762
17.1.3Interpolation763
17.2Quaternions764
17.2.1The Linear Algebraic View of Quaternions766
17.2.2Rotation of a Vector769
17.2.3Product of Rotations769
17.2.4The Classical View of Quaternions770
17.2.5Axis/Angle to Quaternion772
17.2.6Quaternion to Axis/Angle773
17.2.7Matrix to Quaternion773
17.2.8Quaternion to Matrix773
17.2.9Interpolation774
17.3Euler Angles774
17.4Performance Issues777
17.5The Curse of Nonuniform Scaling778
17.5.1Gram-Schmidt Orthonormalization779
17.5.2Eigendecomposition781
17.5.3Polar Decomposition781
17.5.4Singular Value Decomposition781
Chapter 18Object-Oriented Infrastructure783
18.1Object-Oriented Software Construction783
18.1.1Software Quality784
18.1.2Modularity785
18.1.3Reusability787
18.1.4Functions and Data788
18.1.5Object Orientation789
18.2Style, Naming Conventions, and Namespaces790
18.3Run-Time Type Information793
18.3.1Single-Inheritance Systems793
18.3.2Multiple-Inheritance Systems797
18.3.3Macro Support799
18.4Templates800
18.5Shared Objects and Reference Counting802
18.6Streaming808
18.6.1The Stream API809
18.6.2The Object API812
18.7Names and Unique Identifiers819
18.7.1Name String820
18.7.2Unique Identification820
18.8Initialization and Termination822
18.8.1Potential Problems822
18.8.2A Generic Solution for Classes825
18.9An Application Layer831
18.9.1Processing Command-Line Parameters832
18.9.2The Application Class836
18.9.3The ConsoleApplication Class839
18.9.4TheWindowApplication Class842
18.9.5TheWindowApplication3 Class849
18.9.6Managing the Engines867
Chapter 19Memory Management873
19.1Memory Budgets for Game Consoles873
19.2Leak Detection and Collecting Statistics875
19.3General Memory Management Concepts882
19.3.1Allocation Using Sequential-Fit Methods882
19.3.2Allocation Using Buddy-System Methods891
19.3.3Allocation Using Segregated-Storage Methods895
19.3.4Memory Compaction895
Chapter 20Special Effects Using Shaders897
20.1Vertex Colors897
20.2Lighting and Materials899
20.2.1Ambient Lights901
20.2.2Directional Lights902
20.2.3Point Lights903
20.2.4Spotlights904
20.3Textures909
20.4Multitextures911
20.5Bump Maps914
20.5.1Generating Normal Maps914
20.5.2Generating Tangent-Space Information916
20.5.3The Shader Programs919
20.6Gloss Maps923
20.7Sphere Maps926
20.8Cube Maps929
20.9Refraction932
20.10Planar Reflection935
20.11Planar Shadows939
20.12Projected Textures943
20.13Shadow Maps945
20.14Volumetric Fog947
20.15Skinning950
20.16Iridescence951
20.17Water Effects955
AppendixCreating a Shader in Wild Magic957
A.1Shader Programs for an Illustrative Application958
A.2Creating the Geometric Data963
A.3A Classless Shader Effect965
A.4Creating a Class Derived from ShaderEffect968
A.5Dynamic Updates for the Shader Constants970
References973
Index981
About the CD-ROM1017
……[看更多目录]
序言~The first edition of 3D Game Engine Design appeared in print over six years ago (September 2000). At that time, shader programming did not exist on consumer graphics hardware. All rendering was performed using the fixed-function pipeline, which consisted
文摘This chapter provides some basic concepts that occur in a computer graphics system. Some of these concepts are mathematical in nature. I am assuming that you are familiar with trigonometry, vector and matrix algebra, and dot products and cross products. A warning to those who have a significant mathematical background: I intentionally discuss the mathematical concepts in a somewhat informal manner. My goal is to present the relevant ideas without getting tied down in the minutiae of stating rigorous definitions for the concepts. The first edition of this book was criticized for overemphasizing the mathematical details——and rightly so. Learn computer graphics first, and then later explore the beauty of formal mathematical exposition!
The foundations of coordinate systems (Section 2.1) and transformations (Section 2.2) are pervasive throughout a game engine. They are found not only in the graphics engines but in the physics engines and sound engines. Getting a model out of a modeling package and into the game world, setting up a camera for viewing, and displaying the model vertices and triangles is a process for which you must absolutely understand the coordinate systems and transformations. Scene graph management (Chapter 4) also requires a thorough understanding of these topics.
Sections 2.3 through 2.6 are the foundation for drawing 3D objects on a 2D screen. In a programming environment using graphics APIs such as OpenGL or Direct3D to access the graphics hardware, your participation in the process is typically restricted to selecting the parameters of the camera, providing the triangle primitives whose vertices have been assigned various attributes, and identifying objects that are not within the viewing region so that you do not have to draw them. The low-level processing of vertices and triangles is the responsibility of the graphics drivers. A discussion of the low-level processing is provided in this book, and a software renderer is part of the
……[看更多书摘]