找传奇、传世资源到传世资源站!

Introduction to 3D Game Programming with D...

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboardCONTENTSAcknowledgmentsIntroductionIntended AudiencePrerequisitesRequired Development Tools and HardwareUse of the D3DX LibraryUsing the DirectX SDK Documentation and SDK SamplesClaritySample Programs and Online SupplementsDemo Project Setup in Visual Studio 2010Create a Win32 ProjectLinking the DirectX LibrariesSetting up the Search PathsAdding the Source Code and Building the ProjectPART I MATHEMATICAL PREREQUISITESChapter 1 Vector Algebra1.1 Vectors1.1.1 Vectors and Coordinate Systems1.1.2 Left-Handed Versus Right-Handed Coordinate Systems1.1.3 Basic Vector Operations1.2 Length and Unit Vectors1.3 The Dot Product1.3.1 Orthogonalization1.4 The Cross Product1.4.1 Pseudo 2D Cross Product1.4.2 Orthogonalization with the Cross Product1.5 Points1.6 XNA Math Vectors1.6.1 Vector Types1.6.2 Loading and Storage Methods1.6.3 Parameter Passing1.6.4 Constant Vectors1.6.5 Overloaded Operators1.6.6 Miscellaneous1.6.7 Setter Functions1.6.8 Vector Functions1.6.9 Floating-Point Error1.7 Summary1.8 ExercisesChapter 2 Matrix Algebra2.1 Definition2.2 Matrix Multiplication2.2.1 Definition2.2.2 Vector-Matrix Multiplication2.2.3 Associativity2.3 The Transpose of a Matrix2.4 The Identity Matrix2.5 The Determinant of a Matrix2.5.1 Matrix Minors2.5.2 Definition2.6 The Adjoint of a Matrix2.7 The Inverse of a Matrix2.8 XNA Matrices2.8.1 Matrix Types2.8.2 Matrix Functions2.8.3 XNA Matrix Sample Program2.9 Summary2.10 ExercisesChapter 3 Transformations3.1 Linear Transformations3.1.1 Definition3.1.2 Matrix Representation3.1.3 Scaling3.1.4 Rotation3.2 Affine Transformations3.2.1 Homogeneous Coordinates3.2.2 Definition and Matrix Representation3.2.2 Translation3.2.3 Affine Matrices for Scaling and Rotation3.2.4 Geometric Interpretation of an Affine Transformation Matrix.3.3 Composition of Transformations3.4 Change of Coordinate Transformations3.4.1 Vectors3.4.2 Points3.4.3 Matrix Representation3.4.4 Associativity and Change of Coordinate Matrices3.4.5 Inverses and Change of Coordinate Matrices3.5 Transformation Matrix versus Change of Coordinate Matrix3.6 XNA Math Transformation Functions3.7 Summary3.8 ExercisesPART II DIRECT 3D FOUNDATIONSChapter 4 Direct3D Initialization4.1 Preliminaries4.1.1 Direct3D Overview4.1.2 COM4.1.3 Textures and Data Resource Formats4.1.4 The Swap Chain and Page Flipping4.1.5 Depth Buffering4.1.6 Texture Resource Views4.1.7 Multisampling Theory4.1.8 Multisampling in Direct3D4.1.9 Feature Levels4.2 Initializing Direct3D4.2.1 Create the Device and Context4.2.2 Check 4X MSAA Quality Support4.2.3 Describe the Swap Chain4.2.4 Create the Swap Chain4.2.5 Create the Render Target View4.2.6 Create the Depth/Stencil Buffer and View4.2.7 Bind the Views to the Output Merger Stage4.2.8 Set the Viewport4.3 Timing and Animation4.3.1 The Performance Timer4.3.2 Game Timer Class4.3.3 Time Elapsed Between Frames4.3.4 Total Time4.4 The Demo Application Framework4.4.1 D3DApp4.4.2 Non-Framework Methods4.4.3 Framework Methods4.4.4 Frame Statistics4.4.5 The Message Handler4.4.6 Going Full Screen4.4.7 The “Init Direct3D” Demo4.5 Debugging Direct3D Applications4.6 Summary4.7 ExercisesChapter 5 The Rendering Pipeline5.1 The 3D Illusion5.2 Model Representation5.3 Basic Computer Color5.3.1 Color Operations5.3.2 128-Bit Color5.3.3 32-Bit Color5.4 Overview of the Rendering Pipeline5.5 The Input Assembler Stage5.5.1 Vertices5.5.2 Primitive Topology5.5.2.1 Point List5.5.2.2 Line Strip5.5.2.3 Line List5.5.2.4 Triangle Strip5.5.2.5 Triangle List5.5.2.6 Primitives with Adjacency5.5.2.7 Control Point Patch List5.5.3 Indices5.6 The Vertex Shader Stage5.6.1 Local Space and World Space5.6.2 View Space5.6.3 Projection and Homogeneous Clip Space5.6.3.1 Denning a Frustum5.6.3.2 Projecting Vertices5.6.3.3 Normalized Device Coordinates (NDC)5.6.3.4 Writing the Projection Equation with a Matrix5.6.3.5 Normalized Depth Value5.6.3.6 XMMatrixPerspectiveFovLH5.7 The Tessellation Stages5.8 The Geometry Shader Stage5.9 Clipping5.10 The Rasterization Stage5.10.1 Viewport Transform5.10.2 Backface Culling5.10.3 Vertex Attribute Interpolation5.11 The Pixel Shader Stage5.12 The Output Merger Stage5.13 Summary5.14 ExercisesChapter 6 Drawing in Direct3D6.1 Vertices and Input Layouts6.2 Vertex Buffers6.3 Indices and Index Buffers6.4 Example Vertex Shader6.5 Constant Buffers6.6 Example Pixel Shader6.7 Render States6.8 Effects6.8.1 Effect Files6.8.2 Compiling Shaders6.8.3 Interfacing with Effects from the C Application6.8.4 Using Effects to Draw6.8.5 Compiling an Effect at Build Time6.8.6 The Effects Framework as a "Shader Generator"6.8.7 What the Assembly Looks Like6.9 Box Demo6.10 Hills Demo6.10.1 Generating the Grid Vertices6.10.2 Generating the Grid Indices6.10.3 Applying the Height Function6.11 Shapes Demo6.11.1 Generating a Cylinder Mesh6.11.1.1 Cylinder Side Geometry6.11.1.2 Cap Geometry6.11.2 Generating a Sphere Mesh6.11.3 Generating a Geosphere Mesh6.11.4 Demo Code6.12 Loading Geometry from the File6.13 Dynamic Vertex Buffers6.14 Summary6.15 ExercisesChapter 7 Lighting7.1 Light and Material Interaction7.2 Normal Vectors7.2.1 Computing Normal Vectors7.2.2 Transforming Normal Vectors7.3 Lambert’s Cosine Law7.4 Diffuse Lighting7.5 Ambient Lighting7.6 Specular Lighting7.7 Brief Recap7.8 Specifying Materials7.9 Parallel Lights7.10 Point Lights7.10.1 Attenuation7.10.2 Range7.11 Spotlights7.12 Implementation7.12.1 Lighting Structures7.12.2 Structure Packing7.12.3 Implementing Directional Lights7.12.4 Implementing Point Lights7.12.5 Implementing Spotlights7.13 Lighting Demo7.13.1 Effect File7.13.2 C Application Code7.13.3 Normal Computation7.14 Lit Skull Demo7.15 Summary7.16 ExercisesChapter 8 Texturing8.1 Texture and Resource Recap8.2 Texture Coordinates8.3 Creating and Enabling a Texture8.4 Filters8.4.1 Magnification8.4.2 Minification8.4.2.1 Creating of Mipmaps8.4.3 Anisotropic Filtering8.5 Sampling Textures8.6 Textures and Materials8.7 Crate Demo8.7.1 Specifying Texture Coordinates8.7.2 Creating the Texture8.7.3 Setting the Texture8.7.4 Updated Basic Effect8.8 Address Modes8.9 Transforming Textures8.10 Textured Hills and Waves Demo8.10.1 Grid Texture Coordinate Generation8.10.2 Texture Tiling8.10.3 Texture Animation8.11 Compressed Texture Formats8.12 Summary8.13 ExercisesChapter 9 Blending9.1 The Blending Equation9.2 Blend Operations9.3 Blend Factors9.4 Blend State9.5 Examples9.5.1 No Color Write9.5.2 Adding/Subtracting9.5.3 Multiplying9.5.4 Transparency9.5.5 Blending and the Depth Buffer9.6 Alpha Channels9.7 Clipping Pixels9.8 Fog9.9 Summary9.10 ExercisesChapter 10 Stenciling10.1 Depth/Stencil Formats and Clearing10.2 The Stencil Test10.3 The Depth/Stencil State Block10.3.1 Depth Settings10.3.2 Stencil Settings10.3.3 Creating and Binding a Depth/Stencil State10.3.4 Depth/Stencil States in Effect Files10.4 Implementing Planar Mirrors10.4.1 Mirror Overview10.4.2 Defining the Mirror Depth/Stencil States10.4.3 Drawing the Scene10.4.4 Winding Order and Reflections10.5 Implementing Planar Shadows10.5.1 Parallel Light Shadows10.5.2 Point Light Shadows10.5.3 General Shadow Matrix10.5.4 Using the Stencil Buffer to Prevent Double Blending10.5.5 Shadow Code10.6 Summary10.7 ExercisesChapter 11 The Geometry Shader11.1 Programming Geometry Shaders11.2 Tree Billboards Demo11.2.1 Overview11.2.2 Vertex Structure11.2.3 The Effect File11.2.4 SV_PrimitiveID11.3 Texture Arrays11.3.1 Overview11.3.2 Sampling a Texture Array11.3.3 Loading Texture Arrays11.3.4 Texture Subresources11.4 Alpha-To-Coverage11.5 Summary11.6 ExercisesChapter 12 The Compute Shader12.1 Threads and Thread Groups12.2 A Simple Compute Shader12.3 Data Input and Output Resources12.3.1 Texture Inputs12.3.2 Texture Outputs and Unordered Access Views (UAVs)12.3.3 Indexing and Sampling Textures12.3.4 Structured Buffer Resources12.3.5 Copying CS Results to System Memory12.4 Thread Identification System Values12.5 Append and Consume Buffers12.6 Shared Memory and Synchronization12.7 Blur Demo12.7.1 Blurring Theory12.7.2 Render-to-Texture12.7.3 Blur Implementation Overview12.7.4 Compute Shader Program12.8 Further Resources12.9 Summary12.10 ExercisesChapter 13 The Tessellation Stages13.1 Tessellation Primitive Types13.1.1 Tessellation and the Vertex Shader13.2 The Hull Shader13.2.1 Constant Hull Shader13.2.2 Control Point Hull Shader13.3 The Tessellation Stage13.3.1 Quad Patch Tessellation Examples13.3.2 Triangle Patch Tessellation Examples13.4 The Domain Shader13.5 Tessellating a Quad13.6 Cubic Bézier Quad Patches13.6.1 Bézier Curves13.6.2 Cubic Bézier Surfaces13.6.3 Cubic Bézier Surface Evaluation Code13.6.4 Defining the Patch Geometry13.7 Summary13.8 ExercisesPART III TOPICSChapter 14 Building a First Person Camera ,14.1 View Transform Review14.2 The Camera Class14.3 Selected Method Implementations14.3.1 XMVECTOR Return Variations14.3.2 SetLens14.3.3 Derived Frustum Info14.3.4 Transforming the Camera14.3.5 Building the View Matrix14.4 Camera Demo Comments14.5 Summary14.6 ExercisesChapter 15 Instancing and Frustum Culling15.1 Hardware Instancing15.1.1 The Vertex Shader15.1.2 Streaming Instanced Data15.1.3 Drawing Instanced Data15.1.4 Creating the Instanced Buffer15.2 Bounding Volumes and Frustums15.2.1 XNA Collision15.2.2 Boxes15.2.2.1 Rotations and Axis-Aligned Bounding Boxes15.2.3 Spheres15.2.4 Frustums15.2.4.1 Constructing the Frustum Planes15.2.4.2 Frustum/Sphere Intersection15.2.4.3 Frustum/AABB Intersection15.3 Frustum Culling15.4 Summary15.5 ExercisesChapter 16 Picking16.1 Screen to Projection Window Transform16.2 World/Local Space Picking Ray16.3 Ray/Mesh Intersection16.3.1 Ray/AABB Intersection16.3.2 Ray/Sphere Intersection16.3.3 Ray/Triangle Intersection16.4 Demo Application16.5 Summary16.6 ExercisesChapter 17 Cube Mapping17.1 Cube Mapping17.2 Environment Maps17.2.1 Loading and Using Cube Maps in Direct3D17.3 Texturing a Sky17.4 Modeling Reflections17.5 Dynamic Cube Maps17.5.1 Building the Cube Map and Render Target Views17.5.2 Building the Depth Buffer and Viewport17.5.3 Setting up the Cube Map Camera17.5.4 Drawing into the Cube Map17.6 Dynamic Cube Maps with the Geometry Shader17.7 Summary17.8 ExercisesChapter 18 Normal Mapping and Displacement Mapping …..18.1 Motivation18.2 Normal Maps18.3 Texture/Tangent Space18.4 Vertex Tangent Space18.5 Transforming Between Tangent Space and Object Space18.6 Normal Mapping Shader Code18.7 Displacement Mapping18.8 Displacement Mapping Shader Code18.8.1 Primitive Type18.8.2 Vertex Shader18.8.3 Hull Shader18.8.4 Domain Shader18.9 Summary18.10 ExercisesChapter 19 Terrain Rendering19.1 Heightmaps19.1.1 Creating a Heightmap19.1.2 Loading a RAW File19.1.3 Smoothing19.1.4 Heightmap Shader Resource View19.2 Terrain Tessellation19.2.1 Grid Construction19.2.2 Terrain Vertex Shader19.2.3 Tessellation Factors19.2.4 Displacement Mapping19.2.5 Tangent and Normal Vector Estimation19.3 Frustum Culling Patches19.4 Texturing19.5 Terrain Height19.6 Summary19.7 ExercisesChapter 20 Particle Systems and Stream-Out20.1 Particle Representation20.2 Particle Motion20.3 Randomness20.4 Blending and Particle Systems20.5 Stream-Out20.5.1 Creating a Geometry Shader for Stream-Out20.5.2 Stream-Out Only20.5.3 Creating a Vertex Buffer for Stream-Out20.5.4 Binding to the SO Stage20.5.5 Unbinding from the Stream-Out Stage20.5.6 Auto Draw20.5.7 Ping-Ponging Vertex Buffers20.6 GPU Based Particle System20.6.1 Particle Effects20.6.2 The Particle System Class20.6.3 Emitter Particles20.6.4 The Initialization Vertex Buffer20.6.5 The Update/Draw Method20.7 Fire20.8 Rain20.9 Summary20.10 ExercisesChapter 21 Shadow Mapping21.1 Rendering Scene Depth21.2 Orthographic Projections21.3 Projective Texture Coordinates21.3.1 Code Implementation21.3.2 Points Outside the Frustum21.3.3 Orthographic Projections21.4 Shadow Mapping21.4.1 Algorithm Description21.4.2 Biasing and Aliasing21.4.3 PCF Filtering21.4.4 Building the Shadow Map21.4.5 The Shadow Factor21.4.6 The Shadow Map Test21.4.7 Rendering the Shadow Map21.5 Large PCF Kernels21.5.1 The DDX and DDY Functions21.5.2 Solution to the Large PCF Kernel Problem21.5.3 An Alternative Solution to the Large PCF Kernel Problem..21.6 Summary21.7 ExercisesChapter 22 Ambient Occlusion22.1 Ambient Occlusion via Ray Casting22.2 Screen Space Ambient Occlusion22.2.1 Render Normals and Depth Pass22.2.2 Ambient Occlusion Pass22.2.2.1 Reconstruct View Space Position22.2.2.2 Generate Random Samples22.2.2.3 Generate the Potential Occluding Points22.2.2.4 Perform the Occlusion Test22.2.2.5 Finishing the Calculation22.2.2.6 Implementation22.2.3 Blur Pass22.2.4 Using the Ambient Occlusion Map22.3 Summary22.4 ExercisesChapter 23 Meshes23.1 m3d Format23.1.1 Header23.1.2 Materials23.1.3 Subsets23.1.4 Vertices and Triangle Indices23.2 Mesh Geometry23.3 Basic Model23.4 Mesh Viewer Demo23.5 Summary23.6 ExercisesChapter 24 Quaternions24.1 Review of the Complex Numbers24.1.1 Definitions24.1.2 Geometric Interpretation24.1.3 Polar Representation and Rotations24.2 Quaternion Algebra24.2.1 Definition and Basic Operations24.2.2 Special Products24.2.3 Properties24.2.4 Conversions24.2.5 Conjugate and Norm24.2.6 Inverses24.2.7 Polar Representation24.3 Unit Quaternions and Rotations24.3.1 Rotation Operator24.3.2 Quaternion Rotation Operator to Matrix24.3.3 Matrix to Quaternion Rotation Operator24.3.4 Composition24.4 Quaternion Interpolation24.5 XNA Math Quaternion Functions24.6 Rotation Demo24.7 Summary24.8 ExercisesChapter 25 Character Animation25.1 Frame Hierarchies25.1.1 Mathematical Formulation25.2 Skinned Meshes25.2.1 Definitions25.2.2 Reformulating a Bones To-Root Transform25.2.3 The Offset Transform25.2.4 Animating the Skeleton25.2.5 Calculating the Final Transform25.3 Vertex Blending25.4 Loading .m3d Animation Data25.4.1 Skinned Vertex Data25.4.2 Bone Offset Transforms25.4.3 Hierarchy25.4.4 Animation Data25.4.5 M3DLoader25.5 Character Animation Demo25.6 Summary25.7 ExercisesAppendix A: Introduction to Windows ProgrammingA.l OverviewA.1.1 ResourcesA.1.2 Events, the Message Queue, Messages, and the Message Loop…A.1.3 GUIA.1.4 UnicodeA.2 Basic Windows ApplicationA.3 Explaining the Basic Windows ApplicationA.3.1 Includes, Global Variables, and PrototypesA.3.2 WinMainA.3.3 WNDCLASS and RegistrationA.3.4 Creating and Displaying the WindowA.3.5 The Message LoopA.3.6 The Window ProcedureA.3.7 The MessageBox FunctionA.4 A Better Message LoopA.5 SummaryA.6 ExercisesAppendix B: High Level Shader Language ReferenceVariable TypesScalar TypesVector TypesSwizzlesMatrix TypesArraysStructuresThe typedef KeywordVariable PrefixesCastingKeywords and OperatorsKeywordsOperatorsProgram FlowFunctionsUser-Defined FunctionsBuilt-in FunctionsAppendix C: Some Analytic GeometryC.1 Rays, Lines, and SegmentsC.2 ParallelogramsC.3 TrianglesC.4 PlanesC.4.1 XNA Math PlanesC.4.2 Point/Plane Spatial RelationC.4.3 ConstructionC.4.4 Normalizing a PlaneC.4.5 Transforming a PlaneC.4.6 Nearest Point on a Plane to a Given PointC.4.7 Ray/Plane IntersectionC.4.8 Reflecting VectorsC.4.9 Reflecting PointsC.4.10 Reflection MatrixC.5 ExercisesAppendix D: Solutions to ExercisesBibliography and Further ReadingIndex

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复