Index

. (dot), vector access operator, 101102

#elif directive, 116

#else directive, 116

#error directive, 116

#extension directive, 116

#if directive, 116

#pragma directive

definition, 116

enabling global invariance, 123

[ ] (square brackets), array subscript operator, 101102

2D texture arrays

loading, 260262

new features, 11

overview, 230

2D textures

attached to framebuffer objects, 338339

base formats, 227

overview, 226227

in shaders, 255257

3D textures

attached to framebuffer objects, 339340

loading, 260262

new features, 12

overview, 229

3D textures, noise

dust effects, 403404

water wave simulation, 404

wispy fog, 402404

A

abs function, 467

acos function, 465

acosh function, 466

Advanced RenderMan: Creating CGI for Motion Pictures, 407

Aliasing artifacts. See Anti-aliasing; Mipmapping.

all function, 473

Alpha test, 291293

Android 4.3 (API 18), 451

Android NDK, 451

Android SDK, 451

Angles, built-in functions, 465466

Animation, 2D images. See 2D texture arrays.

Anti-aliasing

multi-sampled, 314316

procedural textures, 407410

any function, 473

Apache Ant, 451

ARM Mali OpenGL ES Emulator, 448

Array buffer objects, 140141

Arrays, 104

Arrays of structures, 128. See also Structures.

asin function, 465

asinh function, 466

Asynchronous objects, querying, 442443

atan function, 465

atanh function, 466

Attributes. See also specific attributes.

active, counting, 77

active, querying, 93

getting, 9293

largest name, getting, 77

setting, 9293

B

Back buffers, 41, 298

Backward compatibility, 1718

Bias matrix, 392393

Binaries. See Program binaries.

Binding

program objects, example, 39

renderbuffer objects, 330331

texture objects, 231

vertex array objects, 151

vertex attributes, 137140

vertex buffer objects, 141

Blend equations, new features, 17

Blending

colors, 311314

per-fragment operations, 10

Blur effects, 387390

Boolean occlusion queries, new features, 15

Buffer object to buffer object copies, new features, 16

Buffer objects

copying, 159160

deleting, 150

drawing with and without, 145150

initializing, 145

updating, 145

Buffer objects, mapping

changing screen resolution, 157

data storage pointer, getting, 155156

flushing mapped buffers, 158159

overview, 154155

unmapping, 155156

Buffer objects, new features. See also Uniform buffer objects; Vertex buffer objects.

buffer object to buffer object copies, 16

buffer subrange mapping, 16

pixel buffer objects, 16

sampler objects, 16

sync objects, 16

uniform buffer objects, 16

vertex array objects, 16

Buffer subrange mapping, new features, 16

Buffer write masks, 301303

Buffers, fragments. See also Pbuffers (pixel buffers).

back, 298

buffer write masks, 301303

clearing, 299301

depth of, 298

front, 298

making writable, 301303

requesting, 299

size of, 298

swapping, 298299

types of, 298

Built-in functions. See also Functions.

abs function, 467

acos, 465

acosh, 466

all, 473

angles, 465466

any, 473

asin, 465

asinh, 466

atan, 465

atanh, 466

ceil, 468

clamp, 469

cos, 465

cosh, 466

cross, 473

degrees, 465

description, 107

determinant, 473

dFdx, 484

dFdy, 484

distance, 473

dot, 473

equal, 473

exp, 466

exp2, 466

exponential, 466467

faceforward, 473

floatBitsToInt, 470

floatBitsToUInt, 470

floating-point pack and unpack, 471472

floor, 467

fract, 468

fragment processing, 483484

fwidth, 484

geometric, 472473

greaterThan, 475

greaterThanEqual, 475

intBitsToFloat, 470

inverse, 474

inversesqrt, 467

isinf, 470

isnan, 470

length, 473

lessThan, 475

lessThanEqual, 475

log, 466

log2, 467

matrix, 474

matrixCompMult, 474

max, 468

min, 468

mix, 469

mod, 468

new features, 15

normalize, 473

not, 475

notEqual, 475

outerProduct, 474

packHalf2x16, 472

packSnorm2x16, 471

pow, 466

radians, 465

reflect, 473

refract, 473

round, 468

roundEven, 468

sign, 467

sin, 465

sinh, 466

smoothstep, 470

sqrt, 467

step, 470

tan, 465

tanh, 466

texture built-in, 478

texture lookup, 476482

textureGrad, 481

textureGradOffset, 481

textureLod, 479

textureOffset, 480

textureProj built-in, 479

textureProjGrad, 482

textureProjGradOffset, 482

textureProjLod, 480

textureProjLodOffset, 480

textureSize, 478

transpose, 474

trigonometry, 465466

trunc, 467

uintBitsToFloat, 470

unpackHalf2x16, 472

unpackSnorm2x16, 471

unpackUnorm2x16, 471472

vector relational, 475

C

ceil function, 468

centroid keyword, 115

Centroid sampling, 14, 316

Checkerboard example, 405407

clamp function, 469

Client space, 126

Clip panes, user, 293295

Clipping

description, 176177

lines, 177

point sprites, 177

triangles, 177

Color

blending, 311314

color depth, simulating, 314

depth, simulating, 314

dithering, 314

fragments, 311314

specifying for multiple render targets, 321322

Color buffers

clearing, example, 3940

fragment operations, 298299, 302. See also Fragments, buffers.

column_major qualifier, 110

Combining texture maps, 286287

Command syntax, 2021

Compiling shaders, example, 3638

Compressing textures, 262265

Compression formats, textures, 264265

Conditional statements. See Control flow statements.

Conditional tests, preprocessor directives, 115117

const declarations, examples, 102103

Constant store, 109

Constants, description, 102103

Constructors. See Variable constructors.

Control flow statements, 107108

Coordinate systems

clipping, 176177

guard band region, 177

overview, 175

Copying

buffer objects, 159160

pixels in framebuffer objects, 342344

textures from the color buffer, 269273

cos function, 465

cosh function, 466

Creating

EGL windows, 5356, 6465

EGLContexts, 6062

fragment shaders, example, 3536

pbuffers, 5660

program objects, example, 3839

renderbuffer objects, 329330

rendering context, 6062

shaders, example, 3536

sync objects, 358359

texture objects, 230

vertex array objects, 144, 151

vertex buffer objects, 141

vertex shaders, example, 3536

windows, example, 3435

cross function, 473

Cubemaps

example, 205206

seamless filtering, new features, 12, 241

texturing, example, 258260

Culling, 7, 180181

Cygwin, 451

D

Data types

EGL, 2021

matrix, 99100

scalar, 99100

type conversion, 100

vector, 99100

Deferred shading, multiple render targets, 320321

Degenerate triangles, 172

degrees function, 465

Deleting

buffer objects, 150

framebuffer objects, 346347

program objects, 75

renderbuffer objects, 346347

shaders, 70

sync objects, 358359

texture objects, 230231

vertex array objects, 154

Deletion status, querying, 77

Depth buffer test, 311

Depth buffers

attached to framebuffer objects, 337338

sharing, 329

Depth buffers, fragment operations. See also Fragments, buffers.

buffer write masks, 302303

description, 298299

Depth-of-field. See Rendering, to textures.

Depth test, per-fragment operations, 10

Depth texture compare, 245246

Depth textures, 12, 254255

determinant function, 473

dFdx function, 484

dFdy function, 484

Directional light, example, 199202

Directives. See Preprocessor directives.

disable behavior, 117

Displacement mapping, vertex shaders, 214215

distance function, 473

Dithering, 10, 314

Dot (.), vector access operator, 101102

dot function, 473

Double buffering, example, 41

Drawing fragments, example, 3536

Drawing primitives

example, 4041

geometry instancing, 169172

multiple disconnected primitives, 168169

multiple primitives, different attributes, 169172

overview, 165168

performance tips, 172174

primitive restart, 168169

provoking vertex, 168169

Drawing surface, creating, 325327. See also FBOs (framebuffer objects).

Dust effects, 403404

Dynamic reflections. See Rendering, to textures.

E

EGL

command syntax, 2021

data types, 2021

description, 19

display server, connecting to, 4445

include files, 20

initializing, 44, 46

libraries, 20

programming with OpenGL ES 3.0, 20

rendering context, creating, 19

rendering surfaces, creating, 19

EGL error codes

EGL_BAD_ALLOC, 55, 58

EGL_BAD_ATTRIBUTE, 48, 51, 58

EGL_BAD_CONFIG, 55, 58, 61

EGL_BAD_DISPLAY, 46

EGL_BAD_MATCH, 55, 58

EGL_BAD_NATIVE_WINDOW, 55

EGL_BAD_PARAMETER, 47, 58, 67

EGL windows, creating

description, 5356

with the esUtil library, 6566

eglChooseConfig function, 5153

EGLConfig data type

choosing surface configurations, 5153

creating pbuffers, 5660

determining available surface configurations, 4647

EGLConfig data type, attributes

querying, 4850

specifying, 5152

summary of, 4950

EGL_CONTEXT_CLIENT_VERSION attribute, 61

EGLContexts

associating with an EGLSurface, 6263

creating, 6062

making current, 6263

EGL_CORE_NATIVE_ENGINE, 67

eglCreateContext function, 6062

eglCreatePbufferSurface command, 5660

eglCreateWindowSurface function, 5356

EGLDisplay data type, 4445

eglGetConfigs function, 47

eglGetDisplay function, 4445

eglGetError function, 45

EGL_HEIGHT attribute, 57

EGL_LARGEST_PBUFFER attribute, 57

eglMakeCurrent function, 6263

EGL_MIPMAP_TEXTURE attribute, 57

EGL_NO_CONTEXT error, 58

EGL_NOT_INITIALIZED error, 4647

EGLSurface, 6263

eglSwapBuffers function, 41

EGL_TEXTURE_FORMAT attribute, 57

EGL_TEXTURE_TARGET attribute, 57

eglWaitClient function, 6667

EGL_WIDTH attribute, 57

Element buffer objects, 140141

Emulating OpenGL ES 3.0

ARM Mali OpenGL ES Emulator, 448

iOS 7, 453455

OpenGL ES 3.0 Emulator, 447449

PowerVR Insider SDK v 3.2+, 448

PowerVR OpenGL ES 3.0 Emulator, 449450

Qualcomm Adreno SDK v3.4+, 447

Ubuntu Linux, 449450

Windows, 447449

enable behavior, 116

Entity names, querying, 429435

Environment mapping

definition, 228, 370

example, 370

fragment shader, 372373

vertex shader, 370372

equal function, 473

Error checking, querying for error codes, 45

Error codes. See also specific codes.

querying for, 45

summary of, 23

Error handling, 2223

ES Framework API

core functions, 485489

esCreateWindow function, 34, 485486

esFrustrum function, 198, 490

esGenCube function, 489

esGenSphere function, 488

esGenSquareGrid function, 489

esLoadProgram function, 487488

esLoadShader function, 487

esLoadTGA function, 488

esLogMessage function, 489

esMatrixLoadIdentity function, 493

esMatrixMultiply function, 493

esOrtho function, 491

esPerspective function, 198199, 491

esRegisterDrawFunc function, 486

esRegisterKeyFunc function, 487

esRegisterShutdownFunc function, 487

esRegisterUpdateFunc function, 486

esRotate function, 492493

esScale function, 492

esTranslate function, 492

transformation functions, 490494

esCreateWindow function, 34, 485486

esFrustrum function, 198, 490

esGenCube function, 489

esGenSphere function, 488

esGenSquareGrid function, 489

esLoadProgram function, 487488

esLoadShader function, 487

esLoadTGA function, 488

esLogMessage function, 489

esMain function, 34

esMatrixLoadIdentity function, 493

esMatrixMultiply function, 493

esOrtho function, 491

esPerspective function, 198199, 491

esRegisterDrawFunc function, 486

esRegisterKeyFunc function, 487

esRegisterShutdownFunc function, 487

esRegisterUpdateFunc function, 486

esRotate function, 492493

esScale function, 492

esTranslate function, 492

esUtil library, creating EGL windows, 6566

ETC/EAC texture compression, 12, 264265

Example code. See also specific examples.

creating. See Hello Triangle.

downloading, 2829

exp function, 466

exp2 function, 466

Exponential built-in functions, 466467

Extension behaviors, 116117

Extensions, 116117

F

faceforward function, 473

FBOs (framebuffer objects). See also Renderbuffer objects.

attachment points, 336337

binding, 335336

blits, 342344

checking for completeness, 341342

copying pixels, 342344

creating, 329330

definition, 327

deleting, 346347

vs. EGL surfaces, 329

examples, 348354

invalidation, 344346

new features, 17

performance tips, 354

purpose of, 325327

querying, 445446

reading pixels, 347

vs. renderbuffer objects, 328

resolving multisample renderbuffers to textures, 342344

state values, 336

TBR GPUs, 345

FBOs (framebuffer objects), attachments

2D textures, 338339

3D textures, 339340

depth buffers, 337338

renderbuffer objects, 337338, 347

Fences, 358361

Filtering textures. See Texture filtering.

Flat/smooth interpolators, 14, 114

floatBitsToInt function, 470

floatBitsToUInt function, 470

Floating-point

numbers. See GL_HALF_FLOAT data type.

pack and unpack, built-in functions, 471472

texture formats, 249250

textures, new features, 12

floor function, 467

Fog effects. See also Particle systems.

linear fog, creating with a fragment shader, 288291

wispy fog, creating with noise, 402404

fract function, 468

Fragment depth, new features, 15

Fragment processing, built-in functions, 483484

Fragment shaders

2D texturing, 255257

built-in constants, 284285

built-in special variables, 283284

creating, example, 3536

examples, 9, 113114

fragment depth, overriding, 284

front-facing fragments, identifying, 284

input variables, 8

inputs, 8

inputs/outputs, 111114

maximum uniform blocks, querying, 91

MRTs (multiple render targets), minimum/maximum number of, 285

offsets, minimum/maximum, 285

overview, 89, 282285

precision qualifiers, 285

samplers, 8

shader inputs, minimum/maximum number of, 284

shader program, 8

Shading Language version, specifying, 9

texture coordinates for point sprites, 284

texture image units, minimum/maximum number of, 285

uniforms, 8

vec4 uniform entries, minimum/maximum number of, 285

window coordinates of current fragment, 283284

Fragment shaders, fixed-function techniques

alpha test, 291293

combining texture maps, 286287

fog effects, 288291

multitexturing, 286287

pipeline description, 280282

transparent fragments, 291293

user clip panes, 293295

Fragments

blending pixel colors, 311314

centroid sampling, 316

color depth, simulating, 314

depth, overriding, 284

dithering, 314

front-facing, identifying, 284

MRTs (multiple render targets), 320324

multi-sampled anti-aliasing, 314316

pixel pack buffer objects, 320

pixels, reading and writing, 316320

rendered images, saving, 316320

sample coverage masks, 315

transparent, 291293

window coordinates of, 283284

Fragments, buffers

back, 298

buffer write masks, 301303

clearing, 299301

depth of, 298

double buffering, example, 41

front, 298

making writable, 301303

requesting, 299

size of, 298

swapping, 298299

types of, 298. See also specific types.

Fragments, tests

depth buffer test, 311

overview, 303304

scissor test, 304305

stencil buffer test, 305311

test enable tokens, 304

Framebuffer invalidation hints, 17, 344345

Framebuffer objects (FBOs). See FBOs (framebuffer objects).

Front buffers, 298

Frustrum, 7

Full integer support, new features, 14

Functions. See also Built-in functions; ES Framework API; specific functions.

description, 106

passing parameters to, 106

recursion, 106

fwidth function, 484

G

Gamma-correct rendering, new features, 11, 254. See also sRGB textures.

Geometric built-in functions, 472473

Geometry, new features, 15. See also Primitives.

Geometry instancing, 169172

GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, 77

GL_ACTIVE_ATTRIBUTES, 77, 93

glActiveTexture function, 256

GL_ACTIVE_UNIFORM_ BLOCK_MAX_LENGTH, 77

GL_ACTIVE_UNIFORM_BLOCKS, 77

GL_ACTIVE_UNIFORM_MAX_LENGTH, 77

GL_ACTIVE_UNIFORMS, 77

GL_ARRAY_BUFFER token, 140141

GL_ATTACHED_SHADERS, 77

glAttachShader function, 75

glBeginQuery command, 184

glBeginTransformFeedback command, 213

glBindAttribLocation command, 139

glBindBuffer command, 142143, 212

glBindBufferBase function, 91, 212

glBindBufferRange function, 91, 212

glBindFramebuffer, 335336

glBindRenderbuffer function, 330331

glBindSamplers function, 274275

glBindTextures function, 231

glBindVertexArray function, 151

GL_BLEND token, 304

glBlendColor function, 313

glBlendEquation function, 313314

glBlendEquationSeparate function, 313314

glBlendFunc function, 312313

glBlendFuncSeparate function, 312313

glBlitFramebuffer command, 343344

glBufferData command, 144

GL_BUFFER_SIZE, 143

glBufferSubData command, 145

GL_BUFFER_USAGE, 143

glCheckFramebufferStatus command, 342

GL_CLAMP_TO_EDGE mode, 243244

glClear function, 40

glClear* functions, 299300

glClientWaitSync function, 359360

glColorMask function, 302

glCompileShader function, 37, 7172

glCompresedTexImage* functions, 277278

glCompresedTexSubImage* functions, 277278

glCompressedTexImage2D function, 263264

glCompressedTexImage3D function, 263264

glCompressedTexSubImage2D function, 267

GL_COMPRESSED_TEXTURE_FORMATS, 265

glCopyBufferSubData function, 159160

glCopyTexImage2D function, 270272

glCopyTexSubImage2D function, 270272

glCopyTexSubImage3D function, 270272

glCreateProgram function, 7475

glCreateShader function, 3637, 7071

glCullFace command, 181

GL_CULL_FACE state, 181

GL_DECR operation, 306

GL_DECR_WRAP operation, 306307

glDeleteBuffers command, 150

glDeleteFramebuffers command, 346347

glDeleteProgram function, 75

glDeleteQueries command, 184

glDeleteRenderbuffers command, 346347

glDeleteSamplers function, 273274

glDeleteShader function, 7071

GL_DELETE_STATUS, 77

glDeleteSync function, 359

glDeleteTextures function, 230231

glDeleteVertexArrays command, 154

glDepthFunc function, 311

glDepthMask function, 302

gl_DepthRange uniform type, 190

glDepthRangef command, 179

gl_DepthRangeParameters uniform type, 190

GL_DEPTH_TEST token, 304, 311

glDetachShader function, 75

glDisable command, 2324

glDisable function, 437438

glDisableVertexAttribArray command, 132135

GL_DITHER token, 304

glDrawArrays function, 4041, 165168, 341

glDrawArraysInstanced command, 165168, 170172

glDrawBuffers function, 321322

glDrawElements function, 165168, 172174, 341

glDrawElementsInstanced command, 165168, 170172, 172174

GL_DYNAMIC_COPY, 143

GL_DYNAMIC_DRAW, 143

GL_DYNAMIC_READ, 143

GL_ELEMENT_ARRAY_BUFFER token, 140141

glEnable function, 2324, 437438

glEnableVertexAttribArray command, 132135

glEndQuery command, 184

glEndTransformFeedback command, 213

glFenceSync function, 358

glFinish command, 358

glFlush command, 358

glFlushMappedBufferRange, 158159

gl_FragCoord variable, 283284

gl_FragDepth variable, 284

glFramebufferRenderbuffer command, 337338

glFramebufferTexture2D command, 338339

glFramebufferTextureLayer command, 339341

glFrontFace command, 180

gl_FrontFacing variable, 190, 284

glFrustrum function, see esFrustrum function

glGenBuffers command, 142143

glGenerateMipmap function, 242

glGenFramebuffers function, 330

glGenQueries command, 184

glGenRenderbuffers function, 329330

glGenSamplers function, 273

glGenTextures function, 230

glGenVertexArrays function, 151

glGetActiveAttrib command, 136137

glGetActiveAttrib function, 93

glGetActiveUniform function, 8182

glGetActiveUniform* functions, 8182

glGetActiveUniformBlockiv function, 8990

glGetActiveUniformBlockName function, 8990

glGetActiveUniformsiv function, 82, 8788

glGetAttachedShaders function, 438

glGetAttribLocation command, 140

glGetBooleanv function, 423

glGetBufferParameter* functions, 444

glGetBufferPointerv function, 444446

glGetError command, 2223

glGetFloatv function, 423

glGetFramebuffer AttachmentParameteriv function, 445446

glGetInteger* functions, 423

glGetInteger64v function, 92

glGetIntegerv command, 91, 214, 265

glGetProgramBinary function, 94

glGetProgramiv function

checking link status, 76

largest uniform name, getting, 81

number of active vertex attributes, querying, 137140

program compatibility, checking, 95

glGetQueryiv function, 442443

glGetQueryObjectuiv function, 185, 213, 443

glGetRenderbufferParameteriv function, 445446

glGetSamplerParameter* functions, 442

glGetShaderInfoLog function, 7273

glGetShaderiv function, 72

glGetShaderPrecisionFormat function, 439440

glGetShaderSource function, 439

glGetString* functions, 421422

glGetSynciv function, 443

glGetTexParameter* functions, 441442

glGetUniform* functions, 439

glGetUniformBlockIndex function, 89

glGetUniformLocation function, 83

glGetVertexAttrib* functions, 440441

GL_HALF_FLOAT data type

16-bit floating-point numbers, 458459

converting float to half-float, 459461

overview, 457458

glHint function, 435436

GL_INCR operation, 306

GL_INCR_WRAP operation, 306307

GL_INFO_LOG_LENGTH, 77

gl_InstanceID variable, 171172, 189

GL_INTERLEAVED_ATTRIBS, 77

glInvalidateFramebuffer command, 345346

glInvalidateSubFramebuffer command, 345346

GL_INVALID_ENUM code, 23

GL_INVALID_OPERATION code, 23

GL_INVALID_VALUE code, 23

GL_INVERT operation, 307

glIs* functions, 436

glIsEnabled function, 24, 437

GL_KEEP operation, 307

GL_LINE_LOOP, 163

GL_LINES, 163

GL_LINES mode, 213

GL_LINE_STRIP, 163

glLineWidth API call, 164

glLinkProgram command, 212

glLinkProgram function, 7576

GL_LINK_STATUS, 95

glMapBufferRange command, 155157

gl_MaxCombinedTextureImageUnits constant, 190

GL_MAX_COMBINED_UNIFORM_BLOCKS, 91

gl_MaxDrawBuffers constant, 285

gl_MaxFragmentInputVectors constant, 284

GL_MAX_FRAGMENT_UNIFORM_BLOCKS, 91

GL_MAX_FRAGMENT_UNIFORM_VECTORS, 109

gl_MaxFragmentUniformVectors constant, 285

gl_MaxFragmentUniformVectors variable, 109

gl_MaxProgramTexelOffset constant, 285

gl_MaxTextureImageUnits constant, 285

GL_MAX_UNIFORM_BLOCK_SIZE, 92

gl_MaxVertexAttribs constant, 190

gl_MaxVertexAttribs variable, 112

GL_MAX_VERTEX_ATTRIBS variable, 112

GL_MAX_VERTEX_OUTPUT_COMPONENTS variable, 113

gl_MaxVertexOutputVectors constant, 190

gl_MaxVertexOutputVectors variable, 113

gl_MaxVertexTextureImageUnits constant, 190

GL_MAX_VERTEX_TEXTURE_UNITS, 213

GL_MAX_VERTEX_UNIFORM_BLOCKS, 91

GL_MAX_VERTEX_UNIFORM_VECTORS, 109

gl_MaxVertexUniformVectors constant, 190, 193196

gl_MaxVertexUniformVectors variable, 109

gl_MinProgramTexelOffset constant, 285

GL_MIRRORED_REPEAT mode, 243244

GL_NO_ERROR code, 23

GL_OUT_OF_MEMORY code, 23

glPixelStorei function, 235

GL_PIXEL_UNPACK_BUFFER, 277278

gl_PointCoord variable, 164165, 284

GL_POINTS mode, 164165, 213

gl_PointSize variable, 164, 190

glPolygonOffset command, 182183

gl_Position variable, 190

glProgramBinary function, 94

GL_PROGRAM_BINARY_RETRIEVABLE_HINT, 77

GL_RASTERIZER_DISCARD, 214

glReadBuffer function, 269270

glReadPixels function, 316320, 346347

GL_REFLECTION_MAP mode, 206

glReleaseShaderCompiler function, 93

glRenderbufferStorage function, 331332

glRenderbufferStorageMultisample function, 331332

GL_REPEAT mode, 243244

GL_REPLACE operation, 306

GL_SAMPLE_ALPHA_TO_COVERAGE token, 304

glSampleCoverage function, 315316

GL_SAMPLE_COVERAGE token, 304

glScissor test, 304305

GL_SEPARATE_ATTRIBS, 77

glShaderSource function, 37, 71

GL_SPHERE_MAP mode, 206

GL_STATIC_COPY, 143

GL_STATIC_DRAW, 143

GL_STATIC_READ, 143

glStencilFunc function, 305311

glStencilFuncSeparate function, 305306

glStencilMask function, 302303

glStencilMaskSeparate function, 303

glStencilOp function, 306311

glStencilOpSeparate function, 306307

GL_STENCIL_TEST token, 304

GL_STREAM_COPY, 144

GL_STREAM_DRAW, 144

GL_STREAM_READ, 144

glTexImage* functions, 277278

glTexImage2D function, 231234

glTexImage3D function, 260262

glTexParameter* commands

API overhead, 273

setting minification/magnification filtering modes, 236, 239240

texture coordinate wrapping, 243

texture detail level, setting, 245

glTexStorage2D function, 276277

glTexStorage3D function, 276277

glTexSubImage* functions, 277278

glTexSubImage2D function, 266267

glTexSubImage3D function, 267269

GL_TEXTURE_BASE_LEVEL parameter, 245

GL_TEXTURE_COMPARE_FUNC parameter, 245246

GL_TEXTURE_COMPARE_MODE parameter, 245246

GL_TEXTURE_MAX_LOD parameter, 245

GL_TEXTURE_MIN_LOD parameter, 245

GL_TEXTURE_SWIZZLE_A parameter, 244245

GL_TEXTURE_SWIZZLE_B parameter, 244245

GL_TEXTURE_SWIZZLE_G parameter, 244245

GL_TEXTURE_SWIZZLE_R parameter, 244245

GL_TRANSFORM_FEEDBACK_VARYINGS, 77

GL_TRANSFORM_FEEDBACK_BUFFER_MODE, 77

GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, 213

GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, 77

glTransformFeedbackVaryings command, 212

GL_TRIANGLE_FAN, 162163

GL_TRIANGLES, 162

GL_TRIANGLES mode, 213

GL_TRIANGLE_STRIP, 162

GL_UNIFORM_BLOCK_ACTIVE_ NUMBER_INDICES, 90

GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, 90

GL_UNIFORM_BLOCK_BINDING, 90

glUniformBlockBinding function, 9091

GL_UNIFORM_BLOCK_DATA_SIZE, 90

GL_UNIFORM_BLOCK_NAME_LENGTH, 90

GL_UNIFORM_BLOCK_REFERENCED_ BY_VERTEX_SHADER, 90

GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, 90

glUnmapBuffer command, 156157

gluPerspective function, see esPerspective function

glUseProgram function, 39, 78

glValidateProgram function, 78

GL_VALIDATE_STATUS, 77

glVertexAttrib* commands, 126

glVertexAttribDivisor command, 170172

glVertexAttribPointer function, 40, 131132

gl_VertexID variable, 189

glViewport command, 39, 178179

GLvoid data type, 21

glWaitSync function, 360

GL_ZERO operation, 306

greaterThan function, 475

greaterThanEqual function, 475

Guard band region, 177

H

Hello Triangle

back buffer, displaying, 41

code framework, 28

color buffer, clearing, 3940

double buffering, 41

drawing fragments, 3536

geometry, loading, 4041

OpenGL ES 3.0 framework, 3435

primitives, drawing, 4041

program objects, 3839

source code, 2933

transforming vertices, 3536

viewport, setting, 3940

windows, creating, 3435

Hello Triangle, shaders

compiling and loading, 3638

creating, 3536

fragment, creating, 3536

linking, 3839

vertex, creating, 3536

highp keyword, 120, 192193

Hints, 77, 435436

I

if-then-else tests. See Control flow statements.

Images

dimensions, specifying, 331

format, specifying, 331

Images, postprocessing

blur effect, 387390

light bloom, 389390

render-to-texture setup, 387

Immutable textures, 13, 276277

in qualifier, 106

Include files, EGL, 20

info logs, 7778

Initializing

arrays, 104

buffer objects, 145

EGL, 44, 46

scalar data types, 100

structures, 103

vector data types, 100

vertex array objects, 144

inout qualifier, 106

Input variables, fragment shader, 8

Instance ID, new features, 15

Instanced rendering, new features, 15

intBitsToFloat function, 470

Integer texture formats, 250252

Integer textures, new features, 12

Interpolation, 114115

Interpolation qualifiers

centroid sampling, 115

default behavior, 114

flat shading, 114

smooth shading, 114

Interpolators

definition, 113

packing, 117119

Invariance, 121123

invariant keyword, 121123

inverse function, 474

inversesqrt function, 467

iOS 7, 453455

isinf function, 470

isnan function, 470

J

JDK (Java SE Development Kit) 7, 451

K

Keywords

centroid, 115

highp, 120, 192193

invariant, 121123

lowp, 120, 192193

mediump, 120, 192193

L

Latitude-longitude maps, example, 205206

Layout qualifiers, 14, 109110

length function, 473

Lens flare effects, 183185

lessThan function, 475

lessThanEqual function, 475

Libraries, EGL, 20

Light bloom, 389390

Light projection matrix, 392393

Light view matrix, 392393

Lighting

equations, 369370

example, 199205

Lighting, per fragment

lighting equations, 369370

lighting shaders, 366369

with a normal map, 364365

overview, 363364

Lighting shaders, 366369

Lines

clipping, 177

description, 163164

width, specifying, 164

Linking shaders, example, 3839

Loading

2D texture arrays, 260262

3D textures, 260262

geometry, example, 4041

shaders, 3638, 7374

shaders, example, 3638

texture objects, 231234

textures, 230236

uniforms, 8385

LoadShader function, 3637

log function, 466

log2 function, 467

Loops. See Control flow statements.

lowp keyword, 120, 192193

M

Macros, defining, 115117

Magnification filtering mode, 236, 238241

main function, vertex shader, 67

Mandatory online compiler, new features, 14

Mapping, texture formats to colors, 257

Mapping buffer objects

changing screen resolution, 157

data storage pointer, getting, 155156

flushing mapped buffers, 158159

overview, 154155

unmapping, 155156

Matrices

non-square, new features, 14

projective texturing, 392393

Matrix built-in functions, 474

Matrix components, 101102

Matrix construction, 101

Matrix data types, 99100

Matrix transformations, example, 196199

matrixCompMult function, 474

max function, 468

mediump keyword, 120, 192193

Meshes, connecting, 172

min function, 468

Min/max functions, new features, 17

Minification filtering mode, 236, 238241

Mipmap chains, 237238

Mipmapping

automatic generation, 242

detail levels, specifying, 245

mipmap chains, 237238

overview, 237241

mix function, 469

mod function, 468

Model matrix, example, 197198

Motion blur effects. See Rendering, to textures.

MRTs (multiple render targets)

deferred shading, 320321

in fragment shaders, 285

in fragments, 320324

new features, 17

overview, 320

setting up, 322324

specifying color attachments, 321322

Multi-sampled anti-aliasing, 314316

Multisample renderbuffers, 17, 333

Multitexturing, 286287

N

Naming conventions, 102

Nearest sampling, 237

New features, buffer objects

buffer object to buffer object copies, 16

buffer subrange mapping, 16

pixel buffer objects, 16

sampler objects, 16

sync objects, 16

uniform buffer objects, 16

vertex array objects, 16

New features, framebuffer

blend equations, 17

framebuffer invalidation hints, 17

min/max functions, 17

MRTs (multiple render targets), 17

multisample renderbuffers, 17

off-screen rendering, 17

New features, geometry

Boolean occlusion queries, 15

instanced rendering, 15

new vertex formats, 15

primitive restart, 15

transform feedback, 15

New features, shaders

built-in functions, 15

centroid sampling, 14

flat/smooth interpolators, 14

fragment depth, 15

full integer support, 14

instance ID, 15

layout qualifiers, 14

mandatory online compiler, 14

non-square matrices, 14

program binaries, 1314

relaxed restrictions, 15

uniform blocks, 14

vertex ID, 15

New features, texturing

2D texture arrays, 11

3D textures, 12

depth textures, 12

ETC/EAC texture compression, 12

floating-point textures, 12

gamma-correct rendering, 11

immutable textures, 13

increased minimum sizes, 13

integer textures, 12

NPOT (non-power-of-2) textures, 13

seamless cubemap filtering, 12, 241

shadow comparisons, 12

sRGB textures and framebuffers, 11

texture LOD (level of detail) features, 13

texture swizzles, 13

texturing, 1113

vendor-specific compressed texture formats, 12

New features, vendor-specific compressed texture formats, 12

New vertex formats, new features, 15

Noise, 3D texture

dust effects, 403404

example, 397

generating, 397402

water wave simulation, 404

wispy fog, 402404

noise3D function, 401

Non-square matrices, new features, 14

normalize function, 473

Normalized flag, 131132

Normalized texture formats, 247248

not function, 475

notEqual function, 475

NPOT (non-power-of-2) textures, new features, 13

O

Occlusion queries, 183185

Off-screen rendering, new features, 17

Offsetting polygons, 181183

OpenGL ES 1.0, specifications, 2

OpenGL ES 1.1

fixed-function vertex pipeline, 215223

specifications, 2

OpenGL ES 2.0, specifications, 23

OpenGL ES 3.0

API specifications, 34

command syntax, 2122

data types, 2122

emulating. See Emulating OpenGL ES 3.0.

error handling, 2223

implementations, querying, 421422

new features. See New features.

platforms. See Emulating OpenGL ES 3.0.

specifications, 23

OpenGL ES 3.0, graphics pipeline. See also specific components.

diagram, 4

fragment shader, 89

per-fragment operations, 911

primitive assembly, 7

rasterization, 7

vertex shader, 47

OpenGL ES 3.0 Emulator, 447449. See also Emulating OpenGL ES 3.0.

OpenGL ES Shading Language 3.0, specifications, 4

Operators, 104105

out qualifier, 106

outerProduct function, 474

Overlapping polygons, 181183

P

packed qualifier, 110

packHalf2x16 function, 472

Packing

interpolators, 117119

uniforms, 117119

packSnorm2x16 function, 471

Particle emissions, 381385

Particle systems

fragment shader, 377379

particle emissions, 381385

point sprites, 374

rendering algorithm, 381

rendering particles, 385386

setup, 374375

transform feedback, 380, 381385

vertex shader, 375377

Pbuffers (pixel buffers)

attributes, 57

creating, 5660

description, 56

errors, 58

PCF (percentage closest filtering), 245246, 414

Per fragment lighting

lighting equations, 369370

lighting shaders, 366369

with a normal map, 364365

overview, 363364

Per-fragment operations

blending, 10

depth test, 10

dithering, 10

overview, 911

scissor test, 10

stencil test, 10

Performance

drawing primitives, 172174

FBOs (framebuffer objects), 354

hints, 435436

primitives, drawing, 172174

vertex attributes, storing, 131135

Perspective division, 178

Pixel buffer objects

new features, 16

pixel pack buffer objects, 320

pixel unpack buffer objects, 277278

Pixel buffers (pbuffers)

attributes, 57

creating, 5660

description, 56

errors, 59

Pixel pack buffer objects, 320

Pixel unpack buffer objects, 277278

Pixels

copying in framebuffer objects, 342344

in fragments, reading and writing, 316320

reading in framebuffer objects, 347

storage options, 236

texels (texture pixels), 226227

Point light, example, 202

Point sampling, 237

Point sprites

clipping, 177

description, 164165

position, 164

radius, 164

texture coordinates for, 284

Point sprites in particle systems, 374

Polygons

joins, smoothing (example), 207211

offsetting, 181183

overlapping, 181183

Position, point sprites, 164

Postprocessing effects. See Rendering, to textures.

pow function, 466

PowerVR Insider SDK v 3.2+, 448

PowerVR OpenGL ES 3.0 Emulator, 449450

Precision qualifiers

default precision, 120

variables, 119120

vertex shaders, 119120, 192193

Preprocessor directives. See also specific directives.

conditional tests, 115117

description, 115117

Primitive assembly

culling primitives, 7

overview, 174175

perspective division, 178

view frustrum, 7

viewport transformation, 178179

Primitive assembly, coordinate systems

clipping, 176177

guard band region, 177

overview, 175

Primitive restart, 15, 168169

Primitives. See also Geometry, new features.

definition, 7, 161

drawing, 7. See also Rasterization.

types of, 162165. See also specific primitives.

Primitives, drawing

example, 4041

geometry instancing, 169172

multiple disconnected primitives, 168169

multiple primitives, different attributes, 169172

overview, 165168

performance tips, 172174

primitive restart, 168169

provoking vertex, 168169

Procedural textures

anti-aliasing, 407410

checkerboard example, 405407

example, 405407

pros and cons, 404

Program binaries

compatibility check, 95

definition, 94

format, 95

getting, 94

new features, 1314

saving, 94

Program objects. See also Shader objects; Shaders.

attached shaders, counting, 77

attaching shaders, 75, 79

creating, 7479

definition, 6970

deleting, 75

deletion status, querying, 77

detaching shaders, 75

linking, 7479

making active, 78

validating, 78

Projection matrix, example, 198199

Projective texturing

basic techniques, 391392

bias matrix, 392393

definition, 391

light projection matrix, 392393

light view matrix, 392393

matrices, 392393

overview, 390391

spotlight shaders, 394397

Provoking vertex, 168169

Q

Qualcomm Adreno SDK v3.4+, 447

Qualifiers

column_major, 110

in, 106

inout, 106

out, 106

packed, 110

row_major, 110

shared, 110

std140, 110

Queries. See State queries.

R

radians function, 465

Radius, point sprites, 164

Rasterization

culling, 180181

enabling/disabling, 214

pipeline, 179

polygon offset, 181183

Recursion, in functions, 106

reflect function, 473

Reflective surfaces, 205206. See also Environment mapping; Projective texturing; Rendering, to textures.

refract function, 473

Renderbuffer objects. See also FBOs (framebuffer objects).

attached to framebuffer objects, 337338, 347

binding, 330331

creating, 329330

default values, 331

definition, 327

deleting, 346347

vs. FBOs (framebuffer objects), 328

formats, 333335

image dimensions, specifying, 331

image format, specifying, 331

multisample, 333

state values, 331

vs. textures, 328

Renderbuffers

multisample, new features, 17

querying, 445446

Rendering

from eye position with depth texture, 418420

gamma-correct, new features, 11

instanced, new features, 15

from light position into depth texture, 415418

off-screen area. See Pbuffers (pixel buffers).

on-screen area. See Windows.

particles, 381, 385386

rendered images, saving, 316320

shadows with depth texture, 414420

synchronizing, 6667

terrain with vertex texture fetch, 410414

Rendering, to off-screen surfaces. See also FBOs (framebuffer objects); Renderbuffer objects.

basic techniques, 326327

new features, 17

Rendering, to textures. See also FBOs (framebuffer objects).

basic techniques, 326327

examples, 348354

uses for, 326

while using the texture object in a fragment shader, 341

Rendering context, creating, 19, 6062, 325327. See also EGL; FBOs (framebuffer objects).

Rendering surfaces, creating with EGL, 19. See also EGL.

require behavior, 116

round function, 468

roundEven function, 468

row_major qualifier, 110

S

Sample coverage masks, 315

Sampler objects, 16, 273275

Samplers

definition, 256

fragment shader, 8

querying, 442

vertex shader, 4

Scalar data types

description, 99100

initializing, 100

type conversion, 100

Scissor test, 10, 304305

Screen resolution, effect on mapped buffer objects, 157

Seamless cubemap filtering, new features, 12, 241

Shader compiler, 93

Shader objects, 6970. See also Program objects; Shaders.

Shaders. See also Fragment shaders; Vertex shaders.

2D textures, 255257

attached to programs, querying, 438440

compiling, 7074

creating, 7074

deleting, 70

info log, retrieving, 7273

linking, 70

loading, 7374

source, providing, 71

texturing, 255257

version specification, declaring, 98

Shaders, new features

built-in functions, 15

centroid sampling, 14

flat/smooth interpolators, 14

fragment depth, 15

full integer support, 14

instance ID, 15

layout qualifiers, 14

mandatory online compiler, 14

non-square matrices, 14

program binaries, 1314

relaxed restrictions, 15

uniform blocks, 14

vertex ID, 15

Shading Language version, specifying in fragment shaders, 9

Shadow comparisons, new features, 12

Shadow mapping, 245246. See also Projective texturing; Rendering, to textures.

Shadows, rendering, 414420

Shared exponent texture formats, 252253

shared qualifier, 110

Shimmering. See Z fighting.

Shiny surfaces, example, 205206

sign function, 467

Signaling sync objects, 359360

sin function, 465

sinh function, 466

Smoke effects. See Particle systems.

Smooth shading, 114

smoothstep function, 470

Specifications, OpenGL ES

1.0, 2

1.1, 2

2.0, 23

3.0, 23

3.0 API, 34

Shading Language 3.0, 4

Sphere maps, example, 205206

Spotlight, example, 202205

Spotlight shaders, 394397

sqrt function, 467

Square brackets ([ ]), array subscript operator, 101102

sRGB textures, 11, 254. See also Gamma-correct rendering.

Stairstep effects. See Anti-aliasing; Mipmapping.

State management

checking current state, 24

enabling/disabling state, 2324

overview, 2324

querying state values, 24

State queries

application-modifiable queries, 429435

asynchronous objects, 442443

entity names, 429435

framebuffer, 445446

implementation-dependent limits, 423428

nonprogrammable operations control, 436438

OpenGL ES 3.0 implementation string queries, 421422

renderbuffer, 445446

samplers, 442

shaders attached to programs, 438440

sync objects, 443

texture state, 441442

vertex attributes, 440441

vertex buffers, 444

std140 qualifier, 8889, 110

Stencil buffer test, 305311

Stencil buffers

buffer write masks, 303

fragment operations, 298299, 303. See also Fragments, buffers.

sharing, 329

Stencil test, per-fragment operations, 10

step function, 470

Structures, 103. See also Arrays of structures.

Structures of arrays, 128. See also Arrays.

Surface configurations

available, determining, 4647

choosing with EGL, 5153

Swapping, buffers, 298299

Swizzles. See Texture swizzles.

Sync objects

creating, 358359

deleting, 358359

example, 360361

fences, 358361

new features, 16

overview, 357358

querying, 443

signaling, 359360

waiting for, 359360

Synchronizing rendering, 6667

T

tan function, 465

tanh function, 466

Terrain surfaces, 214215, 410414

Test enable tokens, 304

Tests, fragments

depth buffer test, 311

overview, 303304

scissor test, 304305

stencil buffer test, 305311

test enable tokens, 304

Texels (texture pixels), 226227

texture built-in function, 257, 260, 478

Texture coordinates

generating, example, 205206

wrapping, 243244

Texture filtering

magnification, 236, 238241

minification, 236, 238241

nearest sampling, 237

overview, 237241

point sampling, 237

seamless cubemap filtering, 241

Texture filtering, mipmapping

automatic generation, 242

detail levels, specifying, 245

mipmap chains, 237238

overview, 237241

Texture formats

depth textures, 254255

floating-point, 249250

integer, 250252

mapping to colors, 257

normalized, 247248

overview, 246247

shared exponent, 252253

sRGB, 254

unsized, 247

Texture image units, in fragment shaders, 285

Texture LOD (level of detail) features, new features, 13

Texture lookup built-in functions, 476482

Texture maps, combining, 286287

Texture objects

overview, 230236

pixel storage options, 236

Texture pixels (texels), 226227

Texture state, querying, 441442

Texture swizzles

accessing vector components, 101

new features, 13

overview, 244245

Texture units, specifying min/max number, 190

textureGrad function, 481

textureGradOffset function, 481

textureLod function, 479

textureOffset function, 480

textureProj built-in function, 391, 479

textureProjGrad function, 482

textureProjGradOffset function, 482

textureProjLod function, 480

textureProjLodOffset function, 480

Textures

color components, mapping. See Texture swizzles.

combining texture maps, 286287

compressing, 262265

compression formats, 264265

copying from the color buffer, 269273

immutable, 276277

multitexturing, 286287

vs. renderbuffer objects, 328

subimage selection, 266269

textureSize function, 478

Texturing

depth texture compare, 245246

fetching from a texture map, 256

loading textures, 230236

PCF (percentage closest filtering), 245246

pixel unpack buffer objects, 277278

sampler objects, 273275

samplers, 256

in shaders, 255257

texels (texture pixels), 226227

volume textures. See 3D textures.

Texturing, 2D texture arrays

loading, 260262

overview, 230

Texturing, 2D textures

attached to framebuffer objects, 338339

base formats, 227

overview, 226227

in shaders, 255257

Texturing, 3D textures

attached to framebuffer objects, 339340

loading, 260262

overview, 229

Texturing, cubemap textures

environment mapping, 228229

overview, 228229

Texturing, new features

2D texture arrays, 11

3D textures, 12

depth textures, 12

ETC/EAC texture compression, 12

floating-point textures, 12

gamma-correct rendering, 11

immutable textures, 13

increased minimum sizes, 13

integer textures, 12

NPOT (non-power-of-2) textures, 13

seamless cubemap filtering, 12, 241

shadow comparisons, 12

sRGB textures and framebuffers, 11

texture LOD (level of detail) features, 13

texture swizzles, 13

texturing, 1113

vendor-specific compressed texture formats, 12

Texturing, texture objects

binding, 231

creating, 230

deleting, 230231

loading, 231234

minification/magnification filtering modes, setting, 236

overview, 230236

pixel storage options, 236

3D textures

attached to framebuffer objects, 339340

loading, 260262

new features, 12

overview, 229

3D textures, noise

dust effects, 403404

water wave simulation, 404

wispy fog, 402404

Transform feedback

example, 211214

new features, 15

in particle systems, 380385

vertex shader, 5

Transformation functions, 490494

Transforming vertices, example, 3536

Transparent fragments, 291293

transpose function, 474

Triangle fans, drawing, 162163

Triangle strips

connecting, 172174

drawing, 162163

generating degenerate triangles, 15

primitive restart, 15

winding order, 174

Triangles

clipping, 177

culling, 180181

degenerate, 15, 172

description, 162163

drawing, 162163

Trigonometry built-in functions, 465466

trunc function, 467

2D texture arrays

loading, 260262

new features, 11

overview, 230

2D textures

attached to framebuffer objects, 338339

base formats, 227

noise, 402

overview, 226227

in shaders, 255257

Type conversion, 100

U

Ubuntu Linux, emulating OpenGL ES 3.0, 449450

uintBitsToFloat function, 470

Uniform block indexes, associating with binding points, 90

Uniform blocks

active uniforms, counting, 90

description, 109111

examples, 109110

last buffer binding point, getting, 90

layout qualifiers, 109110

maximum for all shaders, querying, 91

maximum per shader, querying, 91

minimum supported number, 91

minimum total buffer object size, 90

name length, getting, 90

new features, 14

references to, querying, 90

Uniform buffer objects. See also Buffer objects.

available storage, querying, 92

binding, 91

new features, 16

overview, 8792

programming limitations, 91

Uniform names

largest, counting characters, 81

largest, getting, 77, 81

maximum length, querying, 77

Uniform variables. See Uniforms.

Uniforms

active, counting, 77

active, querying, 77, 8687

constant store, 109

description, 80, 108109

first category, 80

fragment shader, 8

getting, 8187

indexes, getting, 89

loading, 8385

maximum number in vertex shaders, 193196

maximum number of, determining, 109

named uniform blocks, 80, 88

packing, 117119

properties, getting, 8187

setting, 8187

sharing, 8792

std140 block layout, 88

vertex shader, 4

Unmapping mapped buffer objects, 155156

unpackHalf2x16 function, 472

unpackSnorm2x16 function, 471

unpackUnorm2x16 function, 471472

Unsized texture formats, 247

Updating, buffer objects, 145

User clip panes, 293295

V

Validating programs, description, 78

Validation status, querying, 77

Variable constructors, 100101

Variables, 119120. See also specific variables.

Varying variables. See Vertex shaders, output variables.

vec4 uniform entries, in fragment shaders, 285

Vector components

accessing, 101102

naming conventions, 102

Vector data types

description, 99100

initializing, 100

type conversion, 100

Vector relational built-in functions, 475

Vertex array objects

binding, 151

creating, 144, 151

deleting, 154

drawing with, 152154

initializing, 144

new features, 16

overview, 150151

Vertex attribute variables, declaring in vertex shaders, 135137

Vertex attributes

active, listing, 136137

enabling/disabling, 132135

minimum number required, 126

querying, 126, 440441

Vertex attributes, binding

to attribute variables, 137140

to locations, 139140

querying results of, 140

Vertex attributes, specifying

client vertex arrays, 126135

constant vertex attributes, 126

description, 126

Vertex attributes, storing. See also Arrays of structures; Structures of arrays.

constant vertex attributes, 132135

data conversions, 132

normalized flag, 131132

performance tips, 131135

selecting a data format, 131

vertex arrays, 132135

Vertex buffer objects. See also Buffer objects.

array buffer objects, 140141

binding, 141

creating, 141

element buffer objects, 140141

making current, 141

overview, 140141

state, 143144

types of, 140141

Vertex buffers, querying, 444

Vertex ID, new features, 15

Vertex shaders

2D texturing, 255257

displacement mapping, 214215

inputs/outputs, 111114, 188189. See also specific inputs/outputs.

interpolation, 114115

interpolators, 113

maximum uniform blocks, querying, 91

min/max limits, 190192, 193196

output variables, 5

precision qualifiers, 119120, 192193

Shading Language version, specifying, 6

uniforms, maximum number of, 193196

vertex normal, computing, 412413

vertex textures, 214215

water surfaces, 214215

Vertex shaders, built-ins

constants, 190192

special variables, 189190

uniform state, 190

Vertex shaders, examples

creating vertex shaders, 3536

cube maps, 205206

directional light, 199202

generating texture coordinates, 205206

height value, fetching, 412413

latitude-longitude maps, 205206

lighting, 199205

matrix transformations, 196199

model matrix, 197198

OpenGL ES 1.1 fixed-function vertex pipeline, 215223

point light, 202

polygon joins, smoothing, 207211

projection matrix, 198199

reflective surfaces, 205206

shiny surfaces, 205206

sphere maps, 205206

spotlight, 202205

terrain surfaces, 214215

transform feedback, 211214

vertex skinning, 207211

view matrix, 197198

Vertex shaders, overview

entry point, 67

example, 6

inputs/outputs, 45

main function, 67

samplers, 4

shader program, 4

transform feedback, 5

uniforms, 4

vertex shader output variables, 5

Vertex skinning, example, 207211

Vertex textures, 214215

Vertices, transforming (example), 3536

View frustrum, 7

View matrix, example, 197198

Viewport, setting (example), 3940

Viewport transformation, 178179

Visual artifacts. See Mipmapping; Z-fighting artifacts.

W

Waiting for sync objects, 359360

warn behavior, 117

Water surfaces, vertex shaders, 214215

Water wave simulation, 404

Winding order, triangle strips, 174

Windowing systems, communicating with, 4445

Windows, 3435. See also EGL windows.

Windows, emulating OpenGL ES 3.0, 447449

Wrapping, texture coordinates, 243244

Z

Z-fighting artifacts

avoiding, 121123

polygon offset, 181183

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

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