List of Examples

Example 1-1

A Vertex Shader Example

6

Example 1-2

A Fragment Shader Example

9

Example 2-1

Hello Triangle Example

21

Example 3-1

Initializing EGL

36

Example 3-2

Specifying EGL Attributes

42

Example 3-3

Querying EGL Surface Configurations

42

Example 3-4

Creating an EGL Window Surface

45

Example 3-5

Creating an EGL Pixel Buffer

48

Example 3-6

Creating an EGL Context

51

Example 3-7

A Complete Routine for Creating an EGL Window

52

Example 3-8

Creating a Window Using the ESutil Library

54

Example 4-1

Loading a Shader

61

Example 4-2

Create, Attach Shaders to, and Link a Program

66

Example 4-3

Querying for Active Uniforms

71

Example 4-4

Querying for Whether a Shader Compiler is Available

74

Example 5-1

Sample Vertex Shader

90

Example 5-2

Vertex and Fragment Shader with Matching Varying Declarations

91

Example 6-1

Array of Structures

105

Example 6-2

Structure of Arrays

106

Example 6-3

Using Constant and Vertex Array Attributes

109

Example 6-4

Creating and Binding Vertex Buffer Objects

116

Example 6-5

Drawing with and without Vertex Buffer Objects

120

Example 6-6

Drawing with a Buffer Object per Attribute

122

Example 8-1

A Simple Vertex Shader

160

Example 8-2

Directional Light

162

Example 8-3

Spot Light

165

Example 8-4

Sphere Map Texture Coordinate Generation

167

Example 8-5

Cube Map Texture Coordinate Generation

167

Example 8-6

Vertex Skinning Shader with No Check to See If Matrix Weight = 0

169

Example 8-7

Vertex Skinning Shader with Checks to See If Matrix Weight = 0

171

Example 8-8

OpenGL ES 1.1 Fixed Function Vertex Pipeline

173

Example 9-1

Generating a Texture Object, Binding It, and Loading Image Data

187

Example 9-2

Loading a 2D Mipmap Chain

189

Example 9-3

Vertex and Fragment Shader for Performing 2D Texturing

196

Example 9-4

Loading a Cubemap Texture

198

Example 9-5

Vertex and Fragment Shader Pair for Cubemap Texturing

200

Example 10-1

Multitexture Fragment Shader

223

Example 10-2

Vertex Shader for Computing Distance to Eye

225

Example 10-3

Fragment Shader for Rendering Linear Fog

226

Example 10-4

Fragment Shader for Alpha Test Using Discard

228

Example 10-5

User Clip Plane Vertex Shader

230

Example 10-6

User Clip Plane Fragment Shader

231

Example 12-1

Render to Texture

271

Example 12-2

Render to Depth Texture

274

Example 13-1

Per-Fragment Lighting Vertex Shader

282

Example 13-2

Per-Fragment Lighting Fragment Shader

283

Example 13-3

Environment Mapping Vertex Shader

287

Example 13-4

Environment Mapping Fragment Shader

288

Example 13-5

Particle System Vertex Shader

291

Example 13-6

Update Function for Particle System Sample

292

Example 13-7

Particle System Fragment Shader

293

Example 13-8

Draw Function for Particle System Sample

294

Example 13-9

Blur Fragment Shader

297

Example 13-10

Projective Texturing Vertex Shader

304

Example 13-11

Projective Texturing Fragment Shader

306

Example 13-12

Generating Gradient Vectors

309

Example 13-13

3D Noise

311

Example 13-14

Noise Distorted Fog Fragment Shader

313

Example 13-15

Checker Vertex Shader

316

Example 13-16

Checker Fragment Shader

317

Example 13-17

Checker Fragment Shader

318

Example 13-18

Antialiased Checker Fragment Shader

319

Example 15-1

Hello Triangle Using OpenKODE

343

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset