Book Image

OpenGL Development Cookbook

By : Muhammad Mobeen Movania
Book Image

OpenGL Development Cookbook

By: Muhammad Mobeen Movania

Overview of this book

OpenGL is the leading cross-language, multi-platform API used by masses of modern games and applications in a vast array of different sectors. Developing graphics with OpenGL lets you harness the increasing power of GPUs and really take your visuals to the next level. OpenGL Development Cookbook is your guide to graphical programming techniques to implement 3D mesh formats and skeletal animation to learn and understand OpenGL. OpenGL Development Cookbook introduces you to the modern OpenGL. Beginning with vertex-based deformations, common mesh formats, and skeletal animation with GPU skinning, and going on to demonstrate different shader stages in the graphics pipeline. OpenGL Development Cookbook focuses on providing you with practical examples on complex topics, such as variance shadow mapping, GPU-based paths, and ray tracing. By the end you will be familiar with the latest advanced GPU-based volume rendering techniques.
Table of Contents (15 chapters)
OpenGL Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Index

A

  • area filtering
    • implementing, on image / Implementing area filtering (sharpening/blurring/embossing) on an image using convolution, How to do it…, How it works...
  • attenuation
    • per-fragment point light, implementing with / Getting started, How to do it…, How it works…
  • Autodesk® 3ds
    • about / Introduction
  • Autodesk® FBX (.fbx) / Implementing EZMesh model loading
  • Axially Aligned Bounding Box (AABB)
    • about / How to do it…

B

  • bi-directional reflectance distribution function (BRDF) / Implementing global illumination using spherical harmonics lighting
  • Bisection function
    • about / How to do it…
  • blend weights
    • about / Implementing skeletal animation using matrix palette skinning
  • Blinn Phong lighting model
    • about / How it works…
  • blurring effect / How it works...

C

  • C3dsLoader**Load3DS function / How to do it…, How it works…
  • C3dsLoader class / How to do it…
  • CAbstractCamera class / Implementing a vector-based camera with FPS style input support
  • CFreeCamera class
    • about / Implementing a vector-based camera with FPS style input support
  • cloth
    • modelling, transform feedback used / Modeling cloth using transform feedback, Getting ready, How to do it…, How it works…
  • COLLADA / Getting ready
  • Collada (.dae) / Implementing EZMesh model loading
  • collision detection
    • implementing / Implementing collision detection and response on a transform feedback-based cloth model, How to do it…, How it works…, There's more…
  • color
    • used, for implementing object picking / Implementing object picking using color, How it works…
  • colored triangle
    • rendering, shaders used / Rendering a simple colored triangle using shaders, How to do it…, How it works…, There's more…
  • convolution
    • area filtering, applying on image / Implementing area filtering (sharpening/blurring/embossing) on an image using convolution, How to do it…, How it works...
  • CreateTexture function / How to do it…
  • CTargetCamera class
    • about / Implementing a vector-based camera with FPS style input support

D

  • 2D image
    • drawing, fragment shader used / Drawing a 2D image in a window using the fragment shader and the SOIL image loading library, How to do it…, How it works…, There's more…
    • drawing, SOIL image loading library used / Drawing a 2D image in a window using the fragment shader and the SOIL image loading library, How to do it…, How it works…, There's more…
  • 3D graphics programming
    • URL / See also, See also
  • 3ds file format
    • URL / See also
  • 3ds file loader
    • URL / See also
  • 3ds Max
    • about / Introduction
  • 3DS model loading
    • implementing, separate buffers used / Implementing 3ds model loading using separate buffers, How to do it…, How it works…
  • 3D texture slicing
    • about / Implementing volume rendering using 3D texture slicing
    • used, for implementing volume rendering / Implementing volume rendering using 3D texture slicing, How to do it…, How it works…, There's more…
  • depth buffer
    • used, for implementing object picking / Implementing object picking using the depth buffer, How it works…
  • dual depth peeling / There's more…
    • used, for implementing order independent transparency / Implementing order-independent transparency using dual depth peeling, How to do it…, How it works…
  • dual quaternion skinning
    • used, for implementing skeletal animation / Implementing skeletal animation using dual quaternion skinning, How to do it…, How it works…, There's more…
  • dynamic cube mapping
    • used, for rendering reflective object / Rendering a reflective object using dynamic cube mapping, How to do it…, How it works…

E

  • emboss north-east direction effect / How it works...
  • emboss north-west direction effect / How it works...
  • emboss south-east direction effect / How it works...
  • emboss south-west direction effect / How it works...
  • EmitVertex() function / How it works…
  • EndPrimitive() function / How it works…
  • EZMesh (.ezm) / Implementing EZMesh model loading
  • EZMesh format / Getting ready
  • EZMesh model
    • implementing / Implementing EZMesh model loading, How to do it..., How it works…
  • EzmLoader**Load function / How to do it…

F

  • FBO
    • used, for implementing mirror object / Implementing a mirror with render-to-texture using FBO, How to do it…, How it works…
    • shadow mapping, implementing with / Getting started, How to do it…, How it works…
  • FBX / Getting ready
  • FPS style input support
    • used, for implementing vector-based camera / Implementing a vector-based camera with FPS style input support, Getting ready, How to do it…, There's more…
  • fragment shader
    • about / Designing a GLSL shader class
    • used, for drawing 2D image / Drawing a 2D image in a window using the fragment shader and the SOIL image loading library, How to do it…, How it works…, There's more…
    • used, for implementing twirl filter / Implementing the twirl filter using the fragment shader, How to do it…, How it works…, There's more...
  • frame-by-frame animations
    • about / Introduction
  • Framebuffer objects (FBOs) / Introduction
  • free camera
    • about / Implementing the free camera
    • implementing / Getting ready, How to do it…, There's more…
  • freeglut libraries
    • OpenGL v3.3 core profile, setting up on Visual Studio 2010 / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries , How to do it...
    • URL, for downloading / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
  • front-to-back peeling
    • used, for implementing order independent transparency / Implementing order-independent transparency using front-to-back peeling, How to do it…, How it works…

G

  • geometry shader
    • about / Designing a GLSL shader class
    • used, for subdividing plane / Dynamically subdividing a plane using the geometry shader, Getting ready, How to do it…, How it works…, There's more…
    • URL, for tutorial / See also
    • plane, subdividing with instanced rendering / Dynamically subdividing a plane using the geometry shader with instanced rendering, How to do it…, How it works…
  • glBindBufferBase function / Modeling cloth using transform feedback
  • glBufferData function / How to do it…
  • glClearDepth function / There's more…
  • glDepthFunc function / There's more…
  • glDrawElements function / How to do it…
  • GLEW
    • OpenGL v3.3 core profile, setting up on Visual Studio 2010 / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries , How to do it...
  • GLEW library
    • URL, for downloading / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
  • glFramebufferRenderbuffer function / Implementing a mirror with render-to-texture using FBO
  • glFramebufferTexture2D function / Implementing a mirror with render-to-texture using FBO
  • glGetTransformFeedbacks function / Modeling cloth using transform feedback
  • glMapBuffer function / How to do it…
  • glm library
    • URL, for downloading / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
  • global illumination
    • implementing, spherical harmonics lighting used / Implementing global illumination using spherical harmonics lighting, How it works…, There's more…
  • global illumination methods
    • about / Introduction
  • global transform / How it works…
  • glow effect
    • implementing / Implementing the glow effect, How to do it…, How it works…
  • GLSLShader**CreateAndLinkProgram function / There's more…
  • GLSLShader**operator() function / There's more…
  • GLSL shader class
    • designing / Designing a GLSL shader class, Getting ready, How to do it…, How it works…, There's more…
  • glTexImage3D function
    • about / How it works…
  • glTransformFeedbackVaryings function / Modeling cloth using transform feedback
  • glutCloseFunc method / How to do it...
  • glutMainLoop() function / How to do it...
  • glutSwapBuffer function / There's more…
  • glutSwapBuffers function / There's more…
  • glVertexAttribIPointer function / How it works…
  • Gouraud shading
    • about / Implementing per-vertex and per-fragment point lighting
  • GPU-based path tracing
    • implementing / Implementing GPU-based path tracing, How to do it…, How it works…, There's more…
  • GPU-based ray tracing
    • implementing / Implementing GPU-based ray tracing, How to do it…, How it works…

H

  • half angle slicing
    • used, for implementing volumetric lighting / Implementing volumetric lighting using the half-angle slicing, How to do it…, How it works…, There's more…
  • height map
    • used, for implementing terrains / Implementing terrains using the height map, How to do it…, How it works…

I

  • image
    • area filtering, applying on / Implementing area filtering (sharpening/blurring/embossing) on an image using convolution, How to do it…, How it works...
  • interleaved buffers
    • used, for implementing Wavefront ® Obj model / Implementing OBJ model loading using interleaved buffers, How to do it…, How it works…
  • intersectBox function / There's more…

L

  • level of detail (LOD)
    • about / How to do it…
  • Lib3ds
    • URL / See also
  • Lift function
    • about / There's more…
  • Lighthouse 3D view frustum culling
    • URL, for tutorial / See also
  • linear blend skinning (LBS)
    • about / Implementing skeletal animation using matrix palette skinning
  • local transform / How it works…

M

  • main() function / How to do it...
  • Marching Cubes / There's more…
  • Marching Tetrahedra (MT) algorithm
    • used, for implementing polygonal isosurface extraction / Implementing polygonal isosurface extraction using the Marching Tetrahedra algorithm, How to do it…, How it works…, There's more…
    • about / Implementing polygonal isosurface extraction using the Marching Tetrahedra algorithm
  • matrix palette skinning
    • used, for implementing skeletal animation / Implementing skeletal animation using matrix palette skinning, Getting ready, How to do it…, How it works…
    • about / Implementing skeletal animation using matrix palette skinning
  • Maya
    • about / Introduction
  • MeshImport library
    • URL / See also
  • MeshSystem**mSkeletons array / How to do it…
  • mirror, with render-to-texture
    • implementing, FBO used / Implementing a mirror with render-to-texture using FBO, How to do it…, How it works…
  • modelview projection (MVP) / How to do it…
  • Move function / There's more…

N

  • NVIDIA PhysX sdk / Getting ready

O

  • object picking
    • implementing, depth buffer used / Implementing object picking using the depth buffer, How it works…
    • implementing, color used / Implementing object picking using color, How it works…
    • implementing, scene intersection queries used / Implementing object picking using scene intersection queries, How it works…
  • OBJ file specification
    • URL / See also
  • ObjLoader**Load function / How to do it…
  • ObjLoader object / How to do it…
  • offscreen rendering functionality / Introduction
  • OnInit() function / How to do it...
  • OnMouseMove function / There's more
  • OnRender() function / How to do it..., There's more…
  • OnResize() function / How to do it...
  • OnShutdown() function / How to do it..., There's more…, There's more, There's more…
  • OpenGL 4.3
    • about / Introduction
  • OpenGL API
    • about / Introduction
  • OpenGL shading language (GLSL)
    • about / Introduction
  • OpenGL v2.0
    • about / Introduction
  • OpenGL v3.0
    • about / Introduction
  • OpenGL v3.3
    • about / Introduction, Introduction
  • OpenGL v3.3 core profile
    • setting up, on Visual Studio 2010 / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries , How to do it...
  • order independent transparency
    • implementing, front-to-back peeling used / Implementing order-independent transparency using front-to-back peeling, How to do it…, How it works…
    • implementing, dual depth peeling used / Implementing order-independent transparency using dual depth peeling, How to do it…, How it works…

P

  • Pan function / There's more…
  • particle system
    • about / Implementing simple particle system
    • implementing / Getting started, How to do it…, How it works…, There's more…
    • implementing, transform feedback used / Implementing a particle system using transform feedback, How to do it…, How it works…, There's more…
  • per-fragment directional light
    • about / Implementing per-fragment directional light
    • implementing / Getting started, How it works…
  • per-fragment point light
    • implementing, with attenuation / Getting started, How to do it…, How it works…
  • per-fragment point lighting
    • implementing / Getting started, How to do it…, How it works…
  • per-fragment spot light
    • about / Implementing per-fragment spot light
    • implementing / Getting started, How it works…
  • per-vertex point lighting
    • implementing / Getting started, How to do it…, How it works…
  • percentage closer filtering (PCF)
    • about / Implemeting shadow mapping with percentage closer filtering (PCF)
    • shadow mapping, implementing with / Getting started, How it works…, There's more…
  • Phong shading
    • about / Implementing per-vertex and per-fragment point lighting
  • physically based animations
    • about / Introduction
  • plane
    • subdividing, geometry shader used / Dynamically subdividing a plane using the geometry shader, Getting ready, How to do it…, How it works…, There's more…
  • polygonal isosurface extraction
    • implementing, Marching Tetrahedra algorithm used / Implementing polygonal isosurface extraction using the Marching Tetrahedra algorithm, How to do it…, How it works…, There's more…
  • pseudo isosurface rendering
    • implementing, in single-pass GPU ray casting / Implementing pseudo-isosurface rendering in single-pass GPU ray casting, Getting ready, How to do it…, How it works…

Q

  • Quake's md2 (.md2) / Implementing EZMesh model loading
  • Quaternions
    • about / Implementing skeletal animation using dual quaternion skinning

R

  • reflective object
    • rendering, dynamic cube mapping used / Rendering a reflective object using dynamic cube mapping, How to do it…, How it works…
  • response on cloth model
    • implementing / Implementing collision detection and response on a transform feedback-based cloth model, How to do it…, How it works…, There's more…
  • ripple mesh deformer
    • implementing, vertex shader used / Doing a ripple mesh deformer using the vertex shader, How to do it…, How it works…, There's more

S

  • SampleVoxel function / How to do it…
  • scene intersection queries
    • used, for implementing object picking / Implementing object picking using scene intersection queries, How it works…
  • screen space ambient occlusion (SSAO)
    • about / Implementing screen space ambient occlusion (SSAO)
    • implementing / Getting ready, How to do it…, How it works…, There's more…
  • separate buffers
    • used, for implementing 3DS model loading / Implementing 3ds model loading using separate buffers, How to do it…, How it works…
  • shader binding
    • about / There's more…
  • shaders
    • used, for rendering colored triangle / Rendering a simple colored triangle using shaders, How to do it…, How it works…, There's more…
  • shadow mapping
    • implementing, with FBO / Getting started, How to do it…, How it works…
    • implementing, with percentage closer filtering (PCF) / Getting started, How it works…, There's more…
  • sharpening effect / How it works...
  • single-pass GPU ray casting
    • used, for implementing volume rendering / Implementing volume rendering using single-pass GPU ray casting, How to do it…, How it works…, There's more…
    • pseudo isosurface rendering, implementing / Implementing pseudo-isosurface rendering in single-pass GPU ray casting, Getting ready, How to do it…, How it works…
  • skeletal animation
    • about / Introduction, Implementing skeletal animation using matrix palette skinning
    • implementing, matrix palette skinning used / Implementing skeletal animation using matrix palette skinning, Getting ready, How to do it…, How it works…
    • implementing, dual quaternion skinning used / Implementing skeletal animation using dual quaternion skinning, How to do it…, How it works…, There's more…
  • skinning
    • about / Implementing skeletal animation using matrix palette skinning
  • skinning matrix / How it works…
  • skybox
    • rendering, static cube mapping used / Rendering a skybox using static cube mapping, How to do it…, How it works…
  • SliceVolume function
    • about / How it works…
  • smooth mouse filtering
    • URL / See also
  • SOIL image loading library
    • URL, for downloading / Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
    • used, for drawing 2D image / Drawing a 2D image in a window using the fragment shader and the SOIL image loading library, How to do it…, How it works…, There's more…
    / Implementing terrains using the height map
  • spherical harmonics lighting
    • used, for implementing global illumination / Implementing global illumination using spherical harmonics lighting, How it works…, There's more…
  • splatting
    • used, for implementing volume rendering / Implementing volume rendering using splatting, How to do it…, How it works…, There's more…
  • static cube mapping
    • used, for rendering skybox / Rendering a skybox using static cube mapping, How to do it…, How it works…
  • Strafe function
    • about / There's more…

T

  • target camera
    • about / Implementing the target camera
    • implementing / Getting ready, How to do it…, There's more…
  • Terragen
    • about / There's more…
  • terrain height map generation
    • tools / There's more…
  • terrain rendering / How it works…
  • terrains
    • implementing, height map used / Implementing terrains using the height map, How to do it…, How it works…
  • TERRAIN_DEPTH parameter / How to do it…
  • TERRAIN_WIDTH parameter / How to do it…
  • tessellation control shader
    • about / Designing a GLSL shader class
  • tessellation evaluation shader
    • about / Designing a GLSL shader class
  • texelFetchBuffer function / How to do it…
  • transfer function
    • implementing, for volume classification / Implementing transfer function for volume classification, How to do it…, How it works…
  • transform
    • about / How it works…
  • transform feedback
    • about / Modeling cloth using transform feedback
    • used, for modelling cloth / Modeling cloth using transform feedback, Getting ready, How to do it…, How it works…
    • used, for implementing particle system / Implementing a particle system using transform feedback, How to do it…, How it works…, There's more…
  • twirl filter
    • implementing, fragment shader used / Implementing the twirl filter using the fragment shader, How to do it…, How it works…, There's more...

U

  • unweighted smoothing effect / How it works...

V

  • variance shadow mapping
    • about / Implementing variance shadow mapping
    • implementing / Getting started, How to do it…, How it works…, There's more…
  • varying attributes / How it works…
  • vector-based camera
    • implementing, with FPS style input support / Implementing a vector-based camera with FPS style input support, Getting ready, How to do it…, There's more…
  • vertex array object (VAO) / There's more…, How to do it…
  • vertex array objects (VAO) / How to do it…
  • vertex buffer object (VBO) / How to do it…
  • vertex shader
    • about / Designing a GLSL shader class
    • used, for implementing ripple mesh deformer / Doing a ripple mesh deformer using the vertex shader, How to do it…, How it works…, There's more
  • view frustum culling
    • about / Implementing view frustum culling
    • implementing / Implementing view frustum culling, How to do it…, How it works…
  • virtual terrain project
    • URL / There's more…
    • about / There's more…
  • volume classification
    • transfer function, implementing for / Implementing transfer function for volume classification, How to do it…, How it works…
  • volume rendering
    • about / Introduction, Implementing volume rendering using 3D texture slicing
    • implementing, 3D texture slicing used / Implementing volume rendering using 3D texture slicing, How to do it…, How it works…, There's more…
    • implementing, single-pass GPU ray casting used / Implementing volume rendering using single-pass GPU ray casting, How to do it…, How it works…, There's more…
    • implementing, splatting used / Implementing volume rendering using splatting, How to do it…, How it works…, There's more…
  • volumetric lighting
    • implementing, half angle slicing used / Implementing volumetric lighting using the half-angle slicing, How to do it…, How it works…, There's more…

W

  • Walk function
    • about / There's more…
  • Wavefront® OBJ
    • about / Introduction
  • Wavefront ® Obj model
    • implementing, interleaved buffers used / Implementing OBJ model loading using interleaved buffers, How to do it…, How it works…
  • world machine
    • URL / There's more…
    • about / There's more…
  • world space position / Doing a ripple mesh deformer using the vertex shader

X

  • 3 x 3 Gaussian blur effect / How it works...

Z

  • Zoom function / There's more…