0

android® with opengl® es 2 0

game and graphics programming for ios and android with opengl es 2.0

game and graphics programming for ios and android with opengl es 2.0

Kỹ thuật lập trình

... Blending Summary INDEX 24 1 24 2 24 3 24 6 24 9 25 0 25 3 25 4 25 5 25 7 25 9 26 0 26 1 26 1 26 4 26 6 26 7 26 7 26 9 27 1 27 3 xv ftoc.indd xv 12/ 30/ 11 8 :28 :33 AM flast.indd xvi 12/ 31/11 9: 40 :22 AM INTRODUCTION WELCOME ... Camera with Collision Detection 3D Camera Tracking 98 98 100 100 105 105 107 108 1 10 1 10 113 114 116 117 1 20 1 20 122 127 129 1 30 1 32 133 134 135 136 1 40 143 xiii ftoc.indd xiii 12/ 30/ 11 8 :28 :33 ... the Shader Program Dynamic Summary 21 7 21 8 22 1 22 2 22 3 22 4 22 5 22 7 22 9 23 1 23 3 23 4 CHAPTER 11: ADVANCED FX 23 7 Render to Texture Post-Processing Effects 23 8 23 8 First Rendering Pass Second Pass...
  • 316
  • 1,006
  • 2
Game and Graphics Programming for iOS and Android with OpenGL ES 2.0 docx

Game and Graphics Programming for iOS and Android with OpenGL ES 2.0 docx

Kỹ thuật lập trình

... Making the Shader Program Dynamic Summary 21 8 22 1 22 2 22 3 22 4 22 5 22 7 22 9 23 1 23 3 23 4 CHAPTER 11: ADVANCED FX 23 7 Render to Texture Post-Processing Effects 23 8 23 8 First Rendering Pass Second Pass ... COLOR[ 16 ] = { 1.0f /* R */, 0. 0f /* G */, 0. 0f /* B */, 1.0f /* A */, /* Red */ 0. 0f, 1.0f, 0. 0f, 1.0f, /* Green */ 0. 0f, 0. 0f, 1.0f, 1.0f, /* Blue */ 1.0f, 1.0f, 0. 0f, 1.0f /* Yellow */ }; ... 1 90 191 195 198 20 0 20 5 CHAPTER 10: ADVANCED LIGHTING Types of Lamps Let There Be Light 20 7 20 8 20 8 Directional Lamp Shader Struct as Uniforms 21 1 21 4 xiv www.it-ebooks.info ftoc.indd xiv 12/ 30/ 11...
  • 316
  • 1,134
  • 0
opengl es 2 for android

opengl es 2 for android

Kỹ thuật lập trình

... order: 00 100 111 00 0 100 00 On a small-endian architecture, they’ll be stored in this order: 00 0 100 00 001 001 11 Let’s take a look at that again, using hex this time The decimal number 100 00 is 27 10 in ... Projections 29 7 29 7 300 A2 Debugging A2.1 Debugging with glGetError A2 .2 Using Tracer for OpenGL ES A2.3 Pitfalls to Watch Out For 25 5 26 4 27 2 27 2 305 305 306 308 Bibliography ... Scene 21 7 21 8 21 9 22 1 22 4 22 7 22 8 Part II — Building a 3D World www.it-ebooks.info Contents 11.7 A Review 11.8 Exercises •x 23 2 23 2 12 Adding Terrain 12. 1 Creating a Height Map 12. 2...
  • 330
  • 1,054
  • 1
Mobile 3D Graphics with OpenGL ES and M3G

Mobile 3D Graphics with OpenGL ES and M3G

Tài liệu khác

... 21 3 21 3 21 3 21 4 21 5 21 7 21 8 21 9 21 9 22 0 22 1 22 1 22 2 22 3 22 4 22 5 22 9 25 9 25 9 26 0 26 0 26 2 B Corollaries 26 3 Version ... 26 6 26 6 26 7 26 7 26 7 26 7 26 8 26 8 26 8 26 8 26 9 27 1 27 1 27 1 27 2 27 2 27 2 27 2 27 3 27 3 27 3 27 3 27 4 27 4 27 5 27 5 27 5 27 5 E Version 1 .2. 1 27 9 F Version 1.3 F.1 Compressed Textures ... 21 8 22 7 22 8 23 0 23 1 23 2 23 3 23 4 23 5 23 6 23 7 23 8 23 9 24 0 xi LIST OF TABLES 6.15 6.16 6.17 6.18 6.19 6 . 20 6 .21 6 .22 6 .23 6 .24 6 .25 6 .26 6 .27 6 .28 6 .29 6. 30 6.31 6. 32 Textures (state per...
  • 333
  • 520
  • 2
OpenGL®ES 2.0 Programming Guide potx

OpenGL®ES 2.0 Programming Guide potx

Kỹ thuật lập trình

... 22 2 Multitexturing 22 2 Fog 22 4 Alpha Test (Using Discard) 22 7 User Clip Planes 22 9 11 Fragment Operations 23 3 Buffers 23 4 Requesting ... II Shreiner, Dave III Title T385.M863 20 09 00 6.6'6—dc 22 200 801 6669 Copyright © 20 09 by Pearson Education, Inc All rights reserved Printed in the United States of America This publication is protected ... GL_MIRRORED_REPEAT Modes 195 Figure 10- 1 OpenGL ES 2. 0 Programmable Pipeline 21 6 Figure 10 -2 OpenGL ES 2. 0 Fragment Shader 21 9 Figure 10- 3 Multitextured Quad 22 3 Figure 10- 4 Linear...
  • 457
  • 4,422
  • 2
morgan kaufmann mobile 3d graphics with opengl es and m3g - morgan kaufmann

morgan kaufmann mobile 3d graphics with opengl es and m3g - morgan kaufmann

Tin học

... State Queries 10. 3 Hints 21 1 21 1 21 2 21 3 21 4 21 4 21 4 21 5 21 8 21 8 21 9 22 0 22 0 22 0 22 3 22 3 22 3 22 4 22 5 22 5 22 6 22 7 23 3 10. 4 Extensions 23 4 10. 4.1 10. 4 .2 10. 4.3 10. 4.4 10. 4.5 23 4 23 4 23 5 23 8 23 8 Querying ... Changes 26 9 27 0 27 0 27 2 27 6 27 7 27 8 27 9 28 0 28 1 28 2 28 3 28 4 28 4 28 5 28 5 28 5 28 6 28 7 28 8 CONTENTS xi CHAPTER 13 BASIC M3G CONCEPTS 28 9 13.1 Graphics3D 29 0 13.1.1 13.1 .2 13.1.3 13.1.4 29 0 29 3 29 4 29 6 ... Values Enumerations Error Handling 12. 3 M3G 1.1 12. 3.1 12. 3 .2 12. 3.3 12. 3.4 12. 3.5 25 9 26 1 26 2 26 2 26 4 M3G CHAPTER 12 INTRODUCING M3G 12. 2.1 12. 2 .2 12. 2.3 12. 2.4 12. 2.5 12. 2.6 12. 2.7 12. 2.8 25 9...
  • 446
  • 352
  • 0
3D Graphics with OpenGL ES and M3G- P1 pps

3D Graphics with OpenGL ES and M3G- P1 pps

Thiết kế - Đồ họa - Flash

... State Queries 10. 3 Hints 21 1 21 1 21 2 21 3 21 4 21 4 21 4 21 5 21 8 21 8 21 9 22 0 22 0 22 0 22 3 22 3 22 3 22 4 22 5 22 5 22 6 22 7 23 3 10. 4 Extensions 23 4 10. 4.1 10. 4 .2 10. 4.3 10. 4.4 10. 4.5 23 4 23 4 23 5 23 8 23 8 Querying ... 4.1.1 4.1 .2 Interpolation Quaternions 57 60 61 61 63 64 68 70 70 71 71 73 74 82 83 88 90 92 92 95 99 100 101 101 1 02 105 105 106 111 CONTENTS 4 .2 vii Deforming Meshes 4 .2. 1 4 .2. 2 4 .2. 3 Morphing ... ALGEBRA FOR 3D GRAPHICS 27 2. 1 27 Coordinate Systems 2. 1.1 2. 1 .2 2.1.3 2. 2 Vectors and Points Vector Products Homogeneous Coordinates 29 29 31 Matrices 2. 2.1 2. 2 .2 2 .2. 3 2. 2.4 31 Matrix Products...
  • 10
  • 307
  • 0
3D Graphics with OpenGL ES and M3G- P2 pps

3D Graphics with OpenGL ES and M3G- P2 pps

Thiết kế - Đồ họa - Flash

... CONCEPTS 28 9 13.1 Graphics3D 29 0 13.1.1 13.1 .2 13.1.3 13.1.4 29 0 29 3 29 4 29 6 Render Targets Viewport Rendering Static Properties 13 .2 Image2D 29 7 13.3 Matrices and Transformations 300 13.3.1 ... Texture2D Fog CompositingMode 14.3 Lights and Camera 319 319 319 3 20 323 325 326 327 328 329 3 32 333 337 14.3.1 Camera 14.3 .2 Light 337 339 14.4 2D Primitives 343 14.4.1 Background 14.4 .2 Sprite3D ... Building meshes 14.1.1 14.1 .2 14.1.3 14.1.4 VertexArray VertexBuffer IndexBuffer and Rendering Primitives Example 14 .2 Adding Color and Light: Appearance 14 .2. 1 14 .2. 2 14 .2. 3 14 .2. 4 14 .2. 5 PolygonMode...
  • 10
  • 354
  • 0
3D Graphics with OpenGL ES and M3G- P3 pps

3D Graphics with OpenGL ES and M3G- P3 pps

Thiết kế - Đồ họa - Flash

... per side, with 16 or 18 bits of color depth, yielding 65K or 26 2K unique colors High-end devices pack screens from QVGA ( 3 20 × 24 0 pixels) upward with good contrast, rapid refresh rates, and brew.qualcomm.com/brew/en/ ... in 20 02 (see Figure 1.1) Unlike the Japanese phones, it still had a monochrome screen with a mere 96 by 65 pixels of resolution—but it did incorporate all the essential 3D rendering features; ... of all phones sold worldwide in 20 06 fall into this category, roughly half of them being S 60 and the other half BREW/WIPI phones Native applications In basic phones and feature phones, the only...
  • 10
  • 467
  • 0
3D Graphics with OpenGL ES and M3G- P4 doc

3D Graphics with OpenGL ES and M3G- P4 doc

Thiết kế - Đồ họa - Flash

... completed by the end of 20 07 Based on historical evidence, the first devices can then be expected in late 20 08 10 www.jcp.org/en/jsr/detail?id =22 6 11 www.jcp.org/en/jsr/detail?id =28 7 ... display resolutions increase Scalable 2D vector graphics can address both of these www.jcp.org/en/jsr/detail?id =23 9 INTRODUCTION 22 problems If the content is represented as shapes such as curves and ... smart phones, modern games consoles, and beyond All OpenGL ES 2. x devices are expected to ship with ES 1.1 drivers Details of the 2. x standard are beyond the scope of this book GLSL ES is closely...
  • 10
  • 374
  • 0
3D Graphics with OpenGL ES and M3G- P5 pptx

3D Graphics with OpenGL ES and M3G- P5 pptx

Thiết kế - Đồ họa - Flash

... producing the second component, and so on: ⎡ [ m 00 ⎢ ⎢[ m v = Mv = ⎢ 10 ⎣[ m 20 [ m 30 m01 m11 m21 m31 m 02 m 12 m 22 m 32 ⎤ m03 ] · v ⎥ m13 ] · v⎥ ⎥ m23 ] · v⎦ (2. 9) m33 ] · v Note that for this to work, ... stands for the m01 m11 m21 m31 m 02 m 12 m 22 m 32 m03 m13 m23 m33 ⎤ ⎥ ⎥ ⎥, ⎦ (2. 7) while a column vector v has components vi : ⎡ ⎤ v0 ⎢ ⎥ v1 ⎥ ⎢ v = ⎢ ⎥ = [ v0 v1 v2 v3 ]T ⎣v2 ⎦ (2. 8) v3 The transpose ... = Mv = v0 ⎢ 10 ⎥ + v1 ⎢ 11 ⎥ + v2 ⎢ 12 ⎥ + v3 ⎢ 13 ⎥ ⎣m 20 ⎦ ⎣m21 ⎦ ⎣m 22 ⎦ ⎣m23 ⎦ m 30 m31 m 32 (2. 10) m33 The product of two matrices, on the other hand, produces another matrix, which can be...
  • 10
  • 256
  • 0
3D Graphics with OpenGL ES and M3G- P6 pot

3D Graphics with OpenGL ES and M3G- P6 pot

Thiết kế - Đồ họa - Flash

... following rotation matrix: ⎡ w + x2 − y2 − z2 ⎢ ⎢ 2xy + 2wz R(ˆ = ⎢ q) ⎣ 2xz − 2wy 2xy − 2wz w2 − x2 + y2 − z2 2yz + 2wx 2xz + 2wy 2yz − 2wx − x2 − y2 + z2 w ⎤ ⎥ 00 (2. 22) Note, however, that quaternions ... is the matrix ⎤ ⎡ h 0 ⎥ ⎢ 0 0⎥ (2. 26) H01 (h) = ⎢ ⎥, 0 0⎦ 0 where the term in the first row and second column is set to h = to create the shear in the last image of Figure 2. 5 In this case, the ... the size and potentially also shape The scaling matrix is ⎤ ⎡ sx 0 ⎥ ⎢ ⎢ sy 0 (2. 24) S(sx , sy , sz ) = ⎢ ⎥, ⎣ 0 sz 0 0 which scales the x component of a vector by sx , the y component by sy ,...
  • 10
  • 364
  • 0
3D Graphics with OpenGL ES and M3G- P7 ppsx

3D Graphics with OpenGL ES and M3G- P7 ppsx

Thiết kế - Đồ họa - Flash

... by w causes a nonlinearity in how the z or depth values are transformed, as illustrated in Figure 2. 10 21 22 23 24 25 26 27 28 29 21 0 21 F i g u r e 2. 10: Nonlinear transformation of z with near ... 2n 0 ⎥⎢ ⎥ ⎢r − l 0 ⎥⎢ 2n f+n 2fn ⎥ ⎢ ⎥⎢ t−b − − ⎥⎢ f−n f − n⎦ ⎣ 0 −1 0 ⎤ r+l 0 ⎥ r−l ⎥ ⎥ t+b 2n ⎥ ⎥ ⎥ t−b t−b ⎥ f+n 2fn ⎥ ⎥ − − f−n f − n⎦ −1 ⎤⎡ 0 ⎢1 ⎥⎢ ⎥⎢ 0 0 ⎥⎢ ⎥⎢ 0 00 r+l 2n t+b 2n ... 2n ⎤ 0 ⎥ ⎥ ⎥ 0 (2. 35) ⎥ ⎥ 0 (2. 36) Its inverse is ⎡ P −1 r−l ⎢ ⎢ 2n ⎢ ⎢ ⎢ =⎢ ⎢ ⎢ ⎢ ⎣ 0 t−b 2n 0 0 f−n − 2fn ⎤ r+l ⎥ 2n ⎥ ⎥ t + b⎥ ⎥ 2n ⎥ ⎥ −1 ⎥ f + n⎥ ⎦ 2fn (2. 37) However, in most cases you...
  • 10
  • 350
  • 0
3D Graphics with OpenGL ES and M3G- P8 doc

3D Graphics with OpenGL ES and M3G- P8 doc

Thiết kế - Đồ họa - Flash

... white light, (1 .0, 0. 0, 0. 0) provides bright red, and (0. 0, 0. 0, 0. 3) corresponds to dark blue Larger values are simply clamped to 1 .0, so (11 .0, 22 .0, 0. 5) will become (1 .0, 1 .0, 0. 5) at the time ... boundaries, there are usually 0. 5–1 .0 vertices 2 1 GL_LINES GL_TRIANGLES 5 GL_LINE_LOOP GL_TRIANGLE_STRIP GL_LINE_STRIP GL_POINTS 3 GL_TRIANGLE_FAN F i g u r e 3.3: The geometric primitives in ... cars, and trees that are close enough are drawn using geometric primitives 2D games are often designed and implemented using sprites, small raster images that are directly placed on the 2D window...
  • 10
  • 396
  • 0
3D Graphics with OpenGL ES and M3G- P9 pptx

3D Graphics with OpenGL ES and M3G- P9 pptx

Thiết kế - Đồ họa - Flash

... can be approximated by (0, 0, 1) Finally, the cosine term is raised to a shininess power nspec A large nspec , e.g., 128 , attenuates the reflectance very quickly, and produces a small and sharp ... model fluorescent and phosphorescent materials 3 .2. 4 LIGHTS OpenGL defines several simple light sources: the global ambient light, point lights, directional lights, and spot lights These lights ... image in one go However, if clipping the primitives introduces new vertices at image boundaries, and unless the colors and possibly other properties are interpolated using exactly the same algorithm...
  • 10
  • 365
  • 0
3D Graphics with OpenGL ES and M3G- P10 docx

3D Graphics with OpenGL ES and M3G- P10 docx

Thiết kế - Đồ họa - Flash

... the area of the texture map that corresponds to (0, 1) (0, 1) (1, 1) (0, 0) (a) (1, 1) (1, 0) (0, 0) (1, 0) (b) (0, 1) (0, 0) (1, 1) (1, 0) (c) F i g u r e 3. 12: (a) The (s, t) coordinate system ... coordinates (0. 0, 0. 0) and the top right image corner has coordinates (1 .0, 1 .0) During rasterization, the texture coordinates are interpolated If the values of q are different on different vertices, ... texture coordinates of the unit 3.4 .2 INTERPOLATING GRADIENTS The simplest way to spread the values at vertices across triangles is to choose the values at one of the vertices and assign the...
  • 10
  • 448
  • 0
3D Graphics with OpenGL ES and M3G- P11 potx

3D Graphics with OpenGL ES and M3G- P11 potx

Thiết kế - Đồ họa - Flash

... produces a better-looking blend of the fog color 1 .0 0.8 0. 6 0. 4 EXP 0 .2 EXP2 LINEAR 0. 0 20 40 60 80 100 F i g u r e 3 . 20 : Fog functions In this example, LINEAR fog starts from 20 and ends at 70, ... at near distances, or with small density values, as shown in Figure 3 . 20 , the functions have different shapes Whereas EXP begins to attenuate much more sharply, EXP2 first attenuates more gradually, ... real fog, but gives less control as the attenuation in the beginning is always so severe EXP2 can sometimes give the esthetically most pleasing results LOW-LEVEL RENDERING 90 Performance tip:...
  • 10
  • 358
  • 0
3D Graphics with OpenGL ES and M3G- P12 pps

3D Graphics with OpenGL ES and M3G- P12 pps

Thiết kế - Đồ họa - Flash

... bits where values range from to 25 5, but can only store bits with a range from to 15 Now all values between 64 and 80 (01 000 00 and 01 0 100 0 in binary) map to either or (01 00 or 01 01) If you simply ... LIFE CYCLE OF A FRAME SECTION 3.6 103 CPU N N11 N 12 N13 T&L N21 N N11 N 12 N13 Rasterizer N 22 N21 N N11 N 12 N13 Flip N23 N 22 N21 N N 12 N 12 N13 F i g u r e 3 .26 : Parallelism of asynchronous multibuffered ... perhaps 100 00 : However, in scenes that not have very bright lights, bits, or 25 6 levels, are sufficient to produce color transitions that appear continuous and seamless Since bits also matches pretty...
  • 10
  • 236
  • 0
3D Graphics with OpenGL ES and M3G- P13 pot

3D Graphics with OpenGL ES and M3G- P13 pot

Thiết kế - Đồ họa - Flash

... coefficients specific to a Hermite curve: ⎤ 2 1 ⎥ ⎢ ⎢ −3 2 −1 ⎥ M=⎢ ⎥ ⎣ 00 ⎡ (4.8) As we have mentioned, there are numerous other classes of curves and splines used in computer graphics One type ... of describing predefined motions in computer graphics The term originates from cartoons, where the senior animator would first draw the most important “key” frames describing the main poses within ... keyframes For further reading on other kinds of curves, again, refer to more comprehensive computer graphics textbooks [FvFH 90, AMH 02 , WW 92] 4.1 .2 QUATERNIONS Interpolating positions and most other...
  • 10
  • 287
  • 0
3D Graphics with OpenGL ES and M3G- P14 pptx

3D Graphics with OpenGL ES and M3G- P14 pptx

Thiết kế - Đồ họa - Flash

... indices define a new triangle For example, triangle T2 is formed by the vertices 2, 4, and SCENE MANAGEMENT 1 20 Appearance Material Fog Compositing Mode Polygon Mode Texture2D Image2D Texture2D ... s r t g b s r t g b s t T3 T2 T1 indices T1 triangles T2 3 T3 T4 F i g u r e 5 .2: Triangle meshes are formed by indexing a set of vertex arrays Here the triangles are organized into a triangle ... the mesh; see Section 3.4.1 for details IndexBuffers define the surface of the mesh by connecting vertices into triangles, as shown in Figure 5 .2 OpenGL ES defines three ways to form triangles from...
  • 10
  • 367
  • 0

Xem thêm