More Opengl Game Programming

by
Edition: 2nd
Format: Paperback
Pub. Date: 2005-11-01
Publisher(s): Cengage Learning PTR
List Price: $53.49

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Ready to put the newest, most advanced features of OpenGL to work in your games?"More OpenGL Game Programming" is more than simply a continuation of the successful "Beginning OpenGL Game Programming" and "OpenGL Game Programming." This new version of the book contains contributions by more than 20 OpenGL and game-programming experts, designed to take you beyond the limited scope of most introductory game-programming texts. Focusing on the graphical components of games, More OpenGL Game Programming introduces you to advanced OpenGL features, such as shaders and advanced texture mapping and lighting, and then shows you how to put these features to use by accomplishing such tasks as creating special effects, simulating natural effects, and rendering terrain. Finally, you'll learn how to animate and render models, as well as how to efficiently manage your game objects. If you're an intermediate game programmer who is ready to move on to advanced OpenGL game programming, this book is the reference you need to get you started.

Table of Contents

Introduction xx
Part I: Performance Tips and Hints
1(232)
More OpenGL
3(44)
Vertex Buffer Objects
4(7)
Creating Buffer Objects
5(1)
Placing Data in Buffers
6(1)
Destroying Buffers
7(1)
Using Buffers with Vertex Arrays
7(3)
Using Buffers with Index Arrays
10(1)
Mapping Buffers
10(1)
Vertex Buffer Object Examples
11(1)
Pixel Buffer Objects
11(5)
Binding PBOs
12(1)
Using Pixel Buffer Objects
13(1)
Applications of PBOs
14(2)
Framebuffer Objects
16(10)
Framebuffer Object Overview
17(1)
Advantages of Framebuffer Objects
17(1)
Using FBOs
18(2)
Renderbuffers
20(2)
Setting the Read and Draw Buffer
22(1)
Querying Information
22(2)
FBO Completeness
24(1)
Performance Tips
24(1)
Conclusion
25(1)
Multisampling
26(6)
Using Multisampling
27(5)
Floating-Point Buffers
32(2)
Creating Floating-Point Buffers
33(1)
Color Clamp Control
33(1)
Occlusion Queries
34(4)
Creating and Destroying Queries
35(1)
Using Queries
35(2)
Occlusion Query Example
37(1)
User Clip Planes
38(7)
How to Find a Plane Equation
39(1)
Specifying the Half Space to Cut
40(1)
Clip Planes and Planar Reflections
40(4)
Advanced Clipping Technique
44(1)
Disabling Vsync
45(1)
Summary
46(1)
Introduction to Shaders
47(8)
A Brief History of Shaders
48(1)
What Is a Shader?
49(4)
Shader Input and Output
52(1)
Vertex Shaders
53(1)
Fragment Shaders
53(1)
Applications of Shaders
53(1)
Summary
54(1)
Low-Level Shaders
55(24)
ARB_vertex_program
55(13)
Data Vectors
55(1)
Instructions
56(1)
Write Masking
56(1)
Example 1: Vertex Program
57(1)
OpenGL Functions for ARB_vertex_program
58(1)
Explicit Program Parameters
59(1)
Source-Vector Modifications
60(1)
Example 2: Vertex Interpolation
60(2)
Generic Vertex Attributes and Matrices
62(2)
Lighting
64(1)
Fog
65(1)
Example 3: Vertex Interpolation with Lighting and Fog
65(3)
Program Options
68(1)
Relative Addressing
68(1)
ARB_fragment_program
68(10)
Example 4: Procedural Shading
69(5)
Texture Sampling
74(1)
Example 5: Per-Pixel Reflection
75(2)
KIL: Kill Fragment Instruction
77(1)
Depth Output
77(1)
Summary
78(1)
The OpenGL Shading Language
79(100)
Introduction
79(1)
What Is the OpenGL Shading Language?
79(43)
Variables and Data Types
81(7)
Type Qualifiers
88(4)
Constructors
92(4)
Operators
96(4)
Program Statements and Structures
100(4)
The Preprocessor
104(3)
Built-in Variables
107(6)
Built-in Functions
113(9)
The OpenGL Shading Language C API
122(25)
Vertex- and Fragment-Shader Setup
122(2)
Shader Programs
124(2)
Shader and Program Management
126(2)
Supplying Shaders with Information
128(15)
Shader and Program Object Information Query Functions
143(4)
Using the OpenGL Shading Language
147(29)
Shader Management Classes
147(3)
Texturing
150(12)
Lighting and Fog
162(9)
Using Multiple Render Targets
171(5)
Performance Tips and Hints
176(2)
Write Clear Code
176(1)
Do as Much as You Can as Early as You Can
176(1)
Prefer ALU Operations to Texture Fetches
177(1)
Minimize Array Sizes
177(1)
Avoid Using Vectors to Store Scalars
177(1)
Use Compile-Time Constants Where Possible
177(1)
Use Uniforms Carefully
177(1)
Try to Perform Vector Operations
177(1)
Avoid Unnecessary State Changes
177(1)
Be Careful of Ubershaders
178(1)
Summary
178(1)
References
178(1)
Advanced Texture Mapping
179(54)
Anisotropic Filtering
180(1)
Compressed Textures
181(4)
Automatic Texture Compression
182(2)
Loading Precompressed Textures
184(1)
Floating-Point Textures and Buffers
185(2)
Querying Texture Component Types
186(1)
Half Floats
187(1)
Non-Power-of-Two Textures and Texture Rectangles
187(2)
Non-Power-of-Two Textures
188(1)
Texture Rectangles
188(1)
Alternative Approaches
189(1)
Bump Mapping
189(10)
Working in Texture Space
190(1)
Emboss Mapping
191(2)
Normal Mapping
193(6)
Final Thoughts
199(1)
References
199(1)
Parallax Mapping
199(8)
Methodology
201(2)
The Bad News
203(1)
Offset Limiting
204(1)
Self-Shadowing
204(3)
References
207(1)
Displacement Mapping
207(4)
Methodology
207(1)
Tessellation
208(1)
Implementation
209(2)
References
211(1)
Detail Texturing
211(3)
Multitexturing
213(1)
Conclusion
214(1)
Projective Textures
214(10)
Q Coordinate Division
216(2)
Parallel Texture Projections
218(1)
Fixed-Function Projective Texturing
218(4)
Eliminating Unwanted Artifacts
222(1)
Projective-Texture Implementation Using Shaders
222(2)
Dynamic Texturing
224(7)
Offscreen Rendering with pbuffers
226(1)
RTT Method 1: glReadPixels()
227(1)
RTT Method 2: glCopyTexSublmage()
228(1)
RTT Method 3: WGL_ARB_render_texture
229(1)
RTT Method 4: GL_EXT_framebuffer_object
230(1)
Summary
231(2)
Part II: Graphics Toolbox
233(310)
Advanced Lighting and Shading
235(74)
Advanced Lighting and Materials
235(14)
Review of the OpenGL Lighting Model
236(2)
BRDFs
238(1)
Microfacet Models
239(1)
Oren-Nayar Model
240(3)
Cook-Torrance Model
243(2)
Ashikhmin Model
245(3)
Conclusion
248(1)
References
248(1)
Deferred Shading
249(18)
Limitations of Forward Shading
250(1)
Deferred Shading Overview
251(1)
Working with the G-Buffer
252(8)
Image-Space Lighting
260(5)
Shadows
265(1)
Transparency and Anti-aliasing
266(1)
Conclusion
266(1)
References
266(1)
High Dynamic Range Lighting and Rendering
267(17)
Superbright Pixels
268(2)
Tone Mapping
270(2)
HDR Lighting
272(1)
Image-Based Lighting and Rendering
273(1)
Diffuse Irradiance Maps
273(1)
Specular Convolution
274(1)
Ambient Occlusion
275(1)
Bent Normals
276(1)
OpenGL Limitations
277(1)
Hardware Limitations
278(1)
Image-Based Lighting Example
279(4)
Conclusion
283(1)
References
283(1)
Non-Photorealistic Rendering
284(24)
The Model Format
285(1)
Edge Rendering
285(15)
Cartoon Shading
300(5)
Other Techniques
305(2)
References
307(1)
Summary
308(1)
Special Effects
309(82)
Billboards
310(7)
Radial Symmetry
310(5)
Asymmetrical Objects
315(2)
Introduction to Particle Systems
317(12)
Particles
318(3)
Particle Systems
321(3)
Particle System Managers
324(1)
Implementation
324(4)
Particle System Effects
328(1)
Example: Snowstorm
328(1)
Enhanced Particle Systems
329(17)
Point Sprites
329(4)
Adding Basic Scripting to the Particle System
333(8)
Improving Particle Systems with the GPU
341(4)
References
345(1)
Glow
346(7)
Implementation Details
347(5)
Specular-Component-Based Glow
352(1)
Planar Reflections and Refractions
353(9)
Reflections
354(2)
Stencil-Buffer Reflections
356(5)
Refractions
361(1)
Robust Multilevel Reflections
362(13)
Introduction
363(1)
Multilevel Reflections in Game Engines
363(1)
Available Techniques
364(1)
Rendering Stencil Multilevel Reflections
365(8)
Limiting Maximum Reflection Level
373(1)
Summary and Demo
374(1)
References
375(1)
Shadows
375(14)
Static Shadows
376(1)
Projective Shadows
376(3)
Shadow Volumes
379(4)
Shadow Mapping
383(5)
Other Methods
388(1)
References
389(1)
Summary
389(2)
Rendering Nature
391(42)
Rendering Water
391(14)
What Makes Water Look Like Water?
392(2)
Fresnel's Equations
394(4)
Implementation and Results
398(7)
Plants and Vegetation
405(4)
Creation of a Tree
406(1)
Performance Optimizations
406(1)
Visual Enhancements
407(1)
Summary
408(1)
Procedural Foliage
409(15)
Tree Generation
409(2)
The Algorithm
411(4)
Generating Geometry
415(4)
Leaf Placement
419(1)
Level of Detail
420(2)
Placement of Trees
422(2)
Implementation Notes and Suggestions
424(1)
References
424(1)
Fur Rendering
424(7)
Generating the Textures
425(2)
Creating the Shell
427(1)
Creating the Fins
428(2)
Putting It All Together
430(1)
References
431(1)
Summary
431(2)
Rendering Skies
433(56)
Skyplanes
433(8)
Creating the Geometry
436(2)
Rendering
438(1)
Fading
438(2)
Faking Volumetric Clouds
440(1)
Skyboxes
441(8)
Rendering
442(1)
Problems at Skybox Edges
443(1)
Positioning the Skybox
444(1)
Creating Skybox Textures
445(2)
Multilayered Skyboxes
447(1)
Skybox Animation
447(1)
References
448(1)
Skydomes
449(28)
Generating the Dome
451(3)
Mapping a Sky Image onto the Dome
454(1)
Rendering the Skydome
455(1)
Making Skydome Textures from Cubemaps
456(2)
Using Color Tables for Skydome Simulation
458(3)
Using Sky Maps for Skydome Simulation
461(3)
Physically Based Sky Color Computation
464(10)
Getting the Color at the Horizon
474(1)
Planetary Elements
474(2)
Conclusion
476(1)
References
476(1)
Clouds
477(10)
Noise
477(1)
Using the Fractal
478(3)
Using the 3D Texture
481(1)
Spherical Implicit Equations
482(1)
Implementation with Volume Rendering in OpenGL
482(4)
Improvements
486(1)
References
487(1)
Summary
487(2)
Terrain
489(54)
Heightmaps
490(2)
Terrain Generation
492(7)
Initial Creation
492(1)
Fault Lines
493(2)
Hill Algorithm
495(2)
Smoothing
497(1)
Scaling
498(1)
Adjusting
499(1)
Terrain Rendering
499(35)
Brute Force
500(9)
Frustum Culling
509(4)
Chunked LOD
513(21)
Terrain Texturing
534(7)
Texture Blending
534(1)
Creating a Single Texture
534(2)
Multitexturing
536(1)
Lighting and Shadows
537(4)
Summary
541(1)
References
541(2)
Part III: Elements of a Game
543
3D Models and Skeletal Animation
545(20)
Introduction
545(2)
Types of 3D Models
545(1)
What You Will Learn in This Chapter
546(1)
Basic Model Loading and the OBJ Format
547(2)
Skeletal Animation
549(14)
What Is Skeletal Animation?
550(2)
Quaternion Review
552(4)
Loading MS3D
556(7)
Conclusion
563(1)
References
564(1)
Scene Management
565
Elements of a Game Level
566(2)
Rendering Elements
566(1)
Collision Elements
567(1)
Miscellaneous Elements
567(1)
What Is Scene Management?
568(5)
View Frustum Culling
568(3)
Scene Graphs
571(2)
Portal-and-BSP Scene Management
573(17)
Portal-Based Engines
573(6)
BSP Trees: Where We Are and What We See
579(8)
Visibility Determination Using Occlusion Queries
587(2)
About the Code
589(1)
References
589(1)
Other Scene-Management Techniques
590(14)
Quadtrees
590(1)
Octrees
591(5)
Adaptive Binary Trees
596(8)
Summary
604
References
604
Appendix A Low-Level Shading Languages Reference
1(1)
Instructions
1(5)
Parameter Vectors
6(3)
ARB_vertex_program Attribute Vectors
9(1)
ARB_vertex_program Result Vectors
9(1)
ARB_fragment_program Attribute Vectors
10(1)
ARB_fragment_program Result Vectors
10
Appendix B OpenGL Shading Language Reference
1(606)
Uniform Reference
1(3)
Matrix State
1(1)
Derived Matrix State
1(1)
Normal Scaling
2(1)
Depth Range
2(1)
Clip Planes
2(1)
Point Size
2(1)
Material State
2(1)
Light State
3(1)
Derived Light State
3(1)
Texture Environment and Generation
4(1)
Fog
4(1)
API Reference
4(603)
glAttachShader()
4(1)
glBindAttribLocation()
5(1)
glCompileShader()
6(1)
glCreateProgram()
6(1)
glCreateShader()
6(1)
glDeleteProgram()
7(1)
glDeleteShader()
7(1)
glDetachShader()
8(1)
glEnableVertexAttribArray() / glDisableVertexAttribArray()
8(1)
glGetActiveAttrib()
9(1)
glGetActiveUniform()
10(1)
glGetAttachedShaders()
11(1)
glGetAttribLocation()
11(1)
glGetProgram()
12(1)
glGetProgramInfoLog()
12(1)
glGetShader()
13(1)
glGetShaderInfoLog()
13(1)
glGetShaderSource()
14(1)
glGetUniform()
15(1)
glGetUniformLocation()
15(1)
glGetVertexAttrib()
16(1)
glGetVertexAttribPointer()
17(1)
gllsProgram()
17(1)
gllsShader()
17(1)
glLinkProgram()
18(1)
glShaderSource()
18(1)
glUniform()
19(2)
glUseProgram()
21(1)
glValidateProgram()
21(1)
glVertexAttrib()
22(2)
glVertexAttribPointer()
24(583)
Index 607

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.