Preface |
|
xiii | |
About the Authors |
|
xv | |
CHAPTER 1. INTRODUCTION |
|
1 | |
|
|
2 | |
|
1.1.1 Typographic Conventions |
|
|
3 | |
|
1.2 Graphics on Handheld Devices |
|
|
3 | |
|
|
4 | |
|
|
5 | |
|
|
6 | |
|
|
8 | |
|
1.2.5 Execution Environments |
|
|
9 | |
|
1.3 Mobile Graphics Standards |
|
|
12 | |
|
1.3.1 Fighting the Fragmentation |
|
|
12 | |
|
|
14 | |
|
|
18 | |
|
|
19 | |
|
|
21 | |
PART I ANATOMY OF A GRAPHICS ENGINE |
|
|
|
27 | |
|
|
27 | |
|
|
29 | |
|
|
29 | |
|
2.1.3 Homogeneous Coordinates |
|
|
31 | |
|
|
31 | |
|
|
32 | |
|
2.2.2 Identity and Inverse |
|
|
33 | |
|
2.2.3 Compound Transformations |
|
|
33 | |
|
2.2.4 Transforming Normal Vectors |
|
|
34 | |
|
2.3 Affine Transformations |
|
|
35 | |
|
2.3.1 Types of Affine Transformations |
|
|
35 | |
|
2.3.2 Transformation Around a Pivot |
|
|
39 | |
|
2.3.3 Example: Hierarchical Modeling |
|
|
39 | |
|
2.4 Eye Coordinate System |
|
|
42 | |
|
|
44 | |
|
2.5.1 Near and Far Planes and the Depth Buffer |
|
|
45 | |
|
2.5.2 A General View Frustum |
|
|
47 | |
|
2.5.3 Parallel Projection |
|
|
50 | |
|
2.6 Viewport and 2D Coordinate Systems |
|
|
51 | |
|
CHAPTER 3. LOW-LEVEL RENDERING |
|
|
55 | |
|
|
57 | |
|
3.1.1 Geometric Primitives |
|
|
57 | |
|
|
60 | |
|
|
61 | |
|
|
61 | |
|
|
63 | |
|
3.2.3 Reflection Models and Materials |
|
|
64 | |
|
|
68 | |
|
3.2.5 Full Lighting Equation |
|
|
70 | |
|
|
70 | |
|
|
71 | |
|
3.3.2 Clipping and View-Frustum Culling |
|
|
71 | |
|
|
73 | |
|
|
74 | |
|
3.4.2 Interpolating Gradients |
|
|
82 | |
|
3.4.3 Texture-Based Lighting |
|
|
83 | |
|
|
88 | |
|
|
90 | |
|
3.5 Per-Fragment Operations |
|
|
92 | |
|
|
92 | |
|
|
95 | |
|
3.5.3 Dithering, Logical Operations, and Masking |
|
|
99 | |
|
3.6 Life Cycle of a Frame |
|
|
100 | |
|
3.6.1 Single versus Double Buffering |
|
|
101 | |
|
3.6.2 Complete Graphics System |
|
|
101 | |
|
3.6.3 Synchronization Points |
|
|
102 | |
|
|
105 | |
|
|
105 | |
|
|
106 | |
|
|
111 | |
|
|
113 | |
|
|
113 | |
|
|
114 | |
|
4.2.3 Other Dynamic Deformations |
|
|
116 | |
|
CHAPTER 5. SCENE MANAGEMENT |
|
|
117 | |
|
|
118 | |
|
|
120 | |
|
|
120 | |
|
5.2.2 Spatial Data Structure |
|
|
121 | |
|
|
123 | |
|
|
125 | |
|
|
125 | |
|
5.3 Retained Mode Rendering |
|
|
128 | |
|
5.3.1 Setting Up the Camera and Lights |
|
|
129 | |
|
5.3.2 Resolving Rendering State |
|
|
130 | |
|
5.3.3 Finding Potentially Visible Objects |
|
|
130 | |
|
5.3.4 Sorting and Rendering |
|
|
132 | |
|
CHAPTER 6. PERFORMANCE AND SCALABILITY |
|
|
133 | |
|
|
134 | |
|
|
135 | |
|
6.1.2 Tuning Down the Details |
|
|
136 | |
|
6.2 Performance Optimization |
|
|
136 | |
|
|
137 | |
|
|
139 | |
|
|
140 | |
|
6.2.4 Profiling OpenGL ES Based Applications |
|
|
141 | |
|
|
142 | |
|
6.3 Changing and Querying the State |
|
|
145 | |
|
6.3.1 Optimizing State Changes |
|
|
146 | |
|
|
146 | |
|
|
147 | |
|
|
148 | |
|
6.5 Transformation Pipeline |
|
|
148 | |
|
|
148 | |
|
|
149 | |
|
|
150 | |
|
|
151 | |
|
6.6.1 Precomputed Illumination |
|
|
151 | |
|
|
152 | |
|
|
152 | |
PART II OPENGL ES AND EGL |
|
|
CHAPTER 7. INTRODUCING OPENGL ES |
|
|
157 | |
|
7.1 Khronos Group and OpenGL ES |
|
|
157 | |
|
|
158 | |
|
|
159 | |
|
|
160 | |
|
|
160 | |
|
|
160 | |
|
|
161 | |
|
7.4.1 Profiles and Versions |
|
|
161 | |
|
7.4.2 OpenGL ES 1.0 in a Nutshell |
|
|
161 | |
|
7.4.3 New Features in OpenGL ES 1.1 |
|
|
164 | |
|
7.4.4 Extension Mechanism |
|
|
165 | |
|
7.4.5 OpenGL ES Extension Pack |
|
|
166 | |
|
|
166 | |
|
|
167 | |
|
|
170 | |
|
CHAPTER 8. OPENGL ES TRANSFORMATION AND LIGHTING |
|
|
173 | |
|
|
173 | |
|
|
174 | |
|
8.1.2 Specifying Vertex Data |
|
|
177 | |
|
8.1.3 Drawing the Primitives |
|
|
179 | |
|
8.1.4 Vertex Buffer Objects |
|
|
180 | |
|
8.2 Vertex Transformation Pipeline |
|
|
183 | |
|
|
183 | |
|
8.2.2 Transforming Normals |
|
|
185 | |
|
8.2.3 Texture Coordinate Transformation |
|
|
186 | |
|
|
188 | |
|
8.2.5 Viewport Transformation |
|
|
188 | |
|
|
189 | |
|
|
189 | |
|
8.3.1 Specifying Colors and Materials |
|
|
189 | |
|
|
190 | |
|
|
192 | |
|
|
193 | |
|
|
193 | |
|
CHAPTER 9. OPENGE ES RASTERIZATION AND FRAGMENT PROCESSING |
|
|
|
|
195 | |
|
|
196 | |
|
|
196 | |
|
9.2.2 Specifying Texture Data |
|
|
197 | |
|
|
202 | |
|
|
205 | |
|
9.2.5 Basic Texture Functions |
|
|
205 | |
|
|
206 | |
|
|
207 | |
|
9.2.8 Point Sprite Texturing |
|
|
209 | |
|
9.2.9 Implementation Differences |
|
|
209 | |
|
|
210 | |
|
|
211 | |
|
|
211 | |
|
|
212 | |
|
9.4.3 Other Antialiasing Approaches |
|
|
213 | |
|
|
214 | |
|
|
214 | |
|
|
214 | |
|
|
215 | |
|
|
218 | |
|
9.6 Applying Fragments to the Color Buffer |
|
|
218 | |
|
|
219 | |
|
|
220 | |
|
|
220 | |
|
9.6.4 Masking Frame Buffer Channels |
|
|
220 | |
|
CHAPTER 10. MISCELLANEOUS OPENGL ES FEATURES |
|
|
223 | |
|
10.1 Frame Buffer Operations |
|
|
223 | |
|
10.1.1 Clearing the Buffers |
|
|
223 | |
|
10.1.2 Reading Back the Color Buffer |
|
|
224 | |
|
10.1.3 Flushing the Command Stream |
|
|
225 | |
|
|
225 | |
|
|
226 | |
|
10.2.2 Dynamic State Queries |
|
|
227 | |
|
|
233 | |
|
|
234 | |
|
10.4.1 Querying Extensions |
|
|
234 | |
|
|
234 | |
|
|
235 | |
|
|
238 | |
|
|
238 | |
|
|
241 | |
|
|
242 | |
|
|
244 | |
|
|
248 | |
|
|
252 | |
|
|
253 | |
|
11.6 Rendering into Textures |
|
|
254 | |
|
11.7 Writing High-Performance EGL Code |
|
|
255 | |
|
11.8 Mixing OpenGL ES and 2D Rendering |
|
|
257 | |
|
11.8.1 Method 1: Window Surface is in Control |
|
|
257 | |
|
11.8.2 Method 2: Pbuffer Surfaces and Bitmaps |
|
|
258 | |
|
11.8.3 Method 3: Pixmap Surfaces |
|
|
258 | |
|
11.9 Optimizing Power Usage |
|
|
259 | |
|
11.9.1 Power Management Implementations |
|
|
259 | |
|
11.9.2 Optimizing the Active Mode |
|
|
261 | |
|
11.9.3 Optimizing the Idle Mode |
|
|
262 | |
|
11.9.4 Measuring Power Usage |
|
|
262 | |
|
11.10 Example on EGL Configuration Selection |
|
|
264 | |
PART III M3G |
|
|
CHAPTER 12. INTRODUCING M3G |
|
|
269 | |
|
|
270 | |
|
|
|
12.1.2 Features and Structure |
|
|
272 | |
|
|
276 | |
|
12.2 Design Principles and Conventions |
|
|
277 | |
|
12.2.1 High Abstraction Level |
|
|
278 | |
|
12.2.2 No Events or Callbacks |
|
|
279 | |
|
|
280 | |
|
12.2.4 Consistent Methods |
|
|
281 | |
|
|
282 | |
|
|
283 | |
|
|
284 | |
|
|
284 | |
|
|
285 | |
|
|
285 | |
|
12.3.2 Rotation Interpolation |
|
|
285 | |
|
12.3.3 PNG and JPEG Loading |
|
|
286 | |
|
|
287 | |
|
|
288 | |
|
CHAPTER 13. BASIC M3G CONCEPTS |
|
|
289 | |
|
|
290 | |
|
|
290 | |
|
|
293 | |
|
|
294 | |
|
|
296 | |
|
|
297 | |
|
13.3 Matrices and Transformations |
|
|
300 | |
|
|
300 | |
|
|
303 | |
|
|
306 | |
|
|
306 | |
|
13.4.2 Iterating and Cloning |
|
|
306 | |
|
13.4.3 Tags and Annotations |
|
|
308 | |
|
|
311 | |
|
|
311 | |
|
|
313 | |
|
CHAPTER 14. LOW-LEVEL MODELING IN M3G |
|
|
319 | |
|
|
319 | |
|
|
319 | |
|
|
320 | |
|
14.1.3 IndexBuffer and Rendering Primitives |
|
|
323 | |
|
|
325 | |
|
14.2 Adding Color and Light: Appearance |
|
|
326 | |
|
|
327 | |
|
|
328 | |
|
|
329 | |
|
|
332 | |
|
|
333 | |
|
|
337 | |
|
|
337 | |
|
|
339 | |
|
|
343 | |
|
|
343 | |
|
|
346 | |
|
CHAPTER 15. THE M3G SCENE GRAPH |
|
|
349 | |
|
15.1 Scene Graph Basics: Node, Group, and World |
|
|
349 | |
|
|
351 | |
|
15.3 Transforming Objects |
|
|
354 | |
|
15.3.1 Camera, Light, and Viewing Transformations |
|
|
355 | |
|
|
356 | |
|
15.4 Layering and Multi-Pass Effects |
|
|
360 | |
|
|
362 | |
|
15.6 Optimizing Performance |
|
|
364 | |
|
15.6.1 Visibility Optimization |
|
|
365 | |
|
|
365 | |
|
CHAPTER 16. ANIMATION IN M3G |
|
|
367 | |
|
16.1 Keyframe Animation: KeyframeSequence |
|
|
367 | |
|
16.2 Animation Targets: AnimationTrack |
|
|
372 | |
|
16.3 Timing and Speed: AnimationController |
|
|
374 | |
|
|
377 | |
|
|
378 | |
|
|
378 | |
|
16.5.2 Animation Blending |
|
|
385 | |
|
16.5.3 Creating Discontinuities |
|
|
387 | |
|
|
388 | |
PART IV APPENDIX |
|
|
A FIXED-POINT MATHEMATICS |
|
|
393 | |
|
A.1 Fixed-Point Methods in C |
|
|
395 | |
|
|
395 | |
|
|
397 | |
|
A.1.3 Trigonometric Operations |
|
|
399 | |
|
A.2 Fixed-Point Methods in Assembly Language |
|
|
400 | |
|
A.3 Fixed-Point Methods in Java |
|
|
405 | |
|
B JAVA PERFORMANCE TUNING |
|
|
407 | |
|
|
408 | |
|
B.2 Bytecode Optimization |
|
|
409 | |
|
|
410 | |
|
|
411 | |
|
|
413 | |
|
|
415 | |
Bibliography |
|
419 | |
Index |
|
425 | |