Home Page Icon
Home Page
Table of Contents for
Table of Contents
Close
Table of Contents
by William C. Y. Lo, Raymond C. H. Lo, David Wolff, Muhammad Mobeen Movania
OpenGL – Build high performance graphics
OpenGL – Build high performance graphics
Table of Contents
OpenGL – Build high performance graphics
OpenGL – Build high performance graphics
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Module 1
1. Introduction to Modern OpenGL
Introduction
Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
How to do it...
There's more…
Designing a GLSL shader class
Getting ready
How to do it…
How it works…
There's more…
Rendering a simple colored triangle using shaders
Getting ready
How to do it…
How it works…
There's more…
See also
Doing a ripple mesh deformer using the vertex shader
Getting ready
How to do it…
How it works…
There's more
Dynamically subdividing a plane using the geometry shader
Getting ready
How to do it…
How it works…
There's more…
See also
Dynamically subdividing a plane using the geometry shader with instanced rendering
Getting ready
How to do it…
How it works…
See also
Drawing a 2D image in a window using the fragment shader and the SOIL image loading library
Getting ready
How to do it…
How it works…
There's more…
2. 3D Viewing and Object Picking
Introduction
Implementing a vector-based camera with FPS style input support
Getting ready
How to do it…
There's more…
See also
Implementing the free camera
Getting ready
How to do it…
There's more…
See also
Implementing the target camera
Getting ready
How to do it…
There's more…
See also
Implementing view frustum culling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing object picking using the depth buffer
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing object picking using color
Getting ready
How to do it…
How it works…
See also
Implementing object picking using scene intersection queries
Getting ready
How to do it…
How it works…
There's more…
See also
3. Offscreen Rendering and Environment Mapping
Introduction
Implementing the twirl filter using the fragment shader
Getting ready
How to do it…
How it works…
There's more...
Rendering a skybox using static cube mapping
Getting ready
How to do it…
How it works…
There's more…
Implementing a mirror with render-to-texture using FBO
Getting ready
How to do it…
How it works…
There's more…
See also
Rendering a reflective object using dynamic cube mapping
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing area filtering (sharpening/blurring/embossing) on an image using convolution
Getting ready
How to do it…
How it works...
There's more…
See also
Implementing the glow effect
How to do it…
How it works…
There's more…
See also
4. Lights and Shadows
Introduction
Implementing per-vertex and per-fragment point lighting
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment directional light
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment point light with attenuation
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment spot light
Getting started
How to do it…
How it works…
There's more…
See also
Implementing shadow mapping with FBO
Getting started
How to do it…
How it works…
There's more…
See also
Implemeting shadow mapping with percentage closer filtering (PCF)
Getting started
How to do it…
How it works…
There's more…
See also
Implementing variance shadow mapping
Getting started
How to do it…
How it works…
There's more…
See also
5. Mesh Model Formats and Particle Systems
Introduction
Implementing terrains using the height map
Getting started
How to do it…
How it works…
There's more…
See also
Implementing 3ds model loading using separate buffers
Getting started
How to do it…
How it works…
There's more…
See also
Implementing OBJ model loading using interleaved buffers
Getting started
How to do it…
How it works…
There's more…
See also
Implementing EZMesh model loading
Getting started
How to do it...
How it works…
There's more…
See also
Implementing simple particle system
Getting started
How to do it…
How it works…
There's more…
See also
6. GPU-based Alpha Blending and Global Illumination
Introduction
Implementing order-independent transparency using front-to-back peeling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing order-independent transparency using dual depth peeling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing screen space ambient occlusion (SSAO)
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing global illumination using spherical harmonics lighting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing GPU-based ray tracing
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing GPU-based path tracing
Getting ready
How to do it…
How it works…
There's more…
See also
7. GPU-based Volume Rendering Techniques
Introduction
Implementing volume rendering using 3D texture slicing
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volume rendering using single-pass GPU ray casting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing pseudo-isosurface rendering in single-pass GPU ray casting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volume rendering using splatting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing transfer function for volume classification
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing polygonal isosurface extraction using the Marching Tetrahedra algorithm
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volumetric lighting using the half-angle slicing
Getting ready
How to do it…
How it works…
There's more…
See also
8. Skeletal and Physically-based Simulation on the GPU
Introduction
Implementing skeletal animation using matrix palette skinning
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing skeletal animation using dual quaternion skinning
Getting ready
How to do it…
How it works…
There's more…
See also
Modeling cloth using transform feedback
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing collision detection and response on a transform feedback-based cloth model
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing a particle system using transform feedback
Getting ready
How to do it…
How it works…
There's more…
See also
2. Module 2
1. Getting Started with GLSL
Introduction
The OpenGL Shading Language
Profiles – Core vs. Compatibility
Using a function loader to access the latest OpenGL functionality
Getting ready
How to do it...
How it works...
There's more...
Generating a C++ loader
No-load styles
Using Extensions
See also
Using GLM for mathematics
Getting ready
How to do it...
How it works...
There's more...
Using the GLM types as input to OpenGL
See also
Determining the GLSL and OpenGL version
How to do it...
How it works...
There's more...
See also
Compiling a shader
Getting ready
How to do it...
How it works...
There's more...
Deleting a Shader Object
See also
Linking a shader program
Getting ready
How to do it...
How it works...
There's more...
Deleting a Shader program
See also
Sending data to a shader using vertex attributes and vertex buffer objects
Getting ready
How to do it...
How it works...
There's more...
Separate attribute format
Fragment shader output
Specifying attribute indexes without using layout qualifiers
Using element arrays
Interleaved arrays
Getting a list of active vertex input attributes and locations
Getting ready
How to do it...
How it works...
There's more...
See also
Sending data to a shader using uniform variables
Getting ready
How to do it...
How it works...
There's more...
See also
Getting a list of active uniform variables
Getting ready
How to do it…
How it works...
There's more...
See also
Using uniform blocks and uniform buffer objects
Getting ready
How to do it...
How it works...
There's more...
Using an instance name with a uniform block
Using layout qualifiers with uniform blocks
See also
Getting debug messages
Getting ready
How to do it...
How it works...
There's more...
Building a C++ shader program class
Getting ready
How to do it...
How it works...
See also
2. The Basics of GLSL Shaders
Introduction
Vertex and fragment shaders
Replicating the old fixed functionality
Implementing diffuse, per-vertex shading with a single point light source
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing per-vertex ambient, diffuse, and specular (ADS) shading
Getting ready
How to do it...
How it works...
There's more...
Using a non-local viewer
Per-vertex versus per-fragment
Directional lights
Light attenuation with distance
See also
Using functions in shaders
Getting ready
How to do it...
How it works...
There's more...
The const qualifier
Function overloading
Passing arrays or structures to a function
See also
Implementing two-sided shading
Getting ready
How to do it...
How it works...
There's more...
Using two-sided rendering for debugging
See also
Implementing flat shading
How to do it...
How it works...
See also
Using subroutines to select shader functionality
Getting ready
How to do it...
How it works...
There's more...
See also
Discarding fragments to create a perforated look
Getting ready
How to do it...
How it works...
See also
3. Lighting, Shading, and Optimization
Introduction
Shading with multiple positional lights
Getting ready
How to do it...
How it works...
See also
Shading with a directional light source
Getting ready
How to do it...
How it works...
There's more...
See also
Using per-fragment shading for improved realism
Getting ready
How to do it...
How it works...
There's more...
See also
Using the halfway vector for improved performance
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating a spotlight
Getting ready
How to do it...
How it works...
See also
Creating a cartoon shading effect
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating fog
Getting ready
How to do it...
How it works...
There's more...
Computing distance from the eye
See also
Configuring the depth test
How to do it...
How it works...
See also
4. Using Textures
Introduction
Applying a 2D texture
Getting ready
How to do it...
How it works...
There's more...
Specifying the sampler binding within GLSL
See also
Applying multiple textures
Getting ready
How to do it...
How it works...
There's more...
See also
Using alpha maps to discard pixels
Getting ready
How to do it...
How it works...
There's more...
See also
Using normal maps
Getting ready
How to do it...
How it works...
See also
Simulating reflection with cube maps
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating refraction with cube maps
Getting ready
How to do it...
How it works...
There's more...
The Fresnel equations
Chromatic aberration
Refracting through both sides of the object
See also
Applying a projected texture
Getting ready
How to do it...
How it works...
There's more...
See also
Rendering to a texture
Getting ready
How to do it...
How it works...
There's more...
See also
Using sampler objects
Getting ready
How to do it...
How it works...
See also
5. Image Processing and Screen Space Techniques
Introduction
Applying an edge detection filter
Getting ready
How to do it...
How it works...
There's more...
Optimization techniques
See also
Applying a Gaussian blur filter
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing HDR lighting with tone mapping
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a bloom effect
Getting ready
How to do it...
How it works...
There's more...
See also
Using gamma correction to improve image quality
How to do it...
How it works...
There's more...
Using multisample anti-aliasing
Getting ready
How to do it...
How it works...
There's more...
Using deferred shading
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing order-independent transparency
Getting ready
How to do it...
How it works...
There's more...
See also
6. Using Geometry and Tessellation Shaders
Introduction
The shader pipeline extended
The geometry shader
The tessellation shaders
Point sprites with the geometry shader
Getting ready
How to do it...
How it works...
There's more...
Drawing a wireframe on top of a shaded mesh
Getting ready
How to do it...
How it works...
There's more...
See also…
Drawing silhouette lines using the geometry shader
Getting ready
How to do it...
How it works...
There's more...
See also
Tessellating a curve
Getting ready
How to do it...
How it works...
There's more...
Tessellating a 2D quad
Getting ready
How to do it...
How it works...
See also
Tessellating a 3D surface
Getting ready
How to do it...
How it works...
See also
Tessellating based on depth
Getting ready
How to do it...
How it works...
There's more...
See also
7. Shadows
Introduction
Rendering shadows with shadow maps
Getting ready
How to do it...
How it works...
There's more...
Aliasing
Rendering back faces only for the shadow map
See also
Anti-aliasing shadow edges with PCF
Getting ready
How to do it...
How it works...
There's more...
See also
Creating soft shadow edges with random sampling
Getting ready
How to do it...
How it works...
There's more...
See also
Creating shadows using shadow volumes and the geometry shader
Getting ready
How to do it...
How it works...
There's more...
See also
8. Using Noise in Shaders
Introduction
See Also…
Creating a noise texture using GLM
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a seamless noise texture
Getting ready
How to do it...
How it works...
See also
Creating a cloud-like effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a wood-grain effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a disintegration effect
Getting ready
How to do it...
How it works...
See also
Creating a paint-spatter effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a night-vision effect
Getting ready
How to do it...
How it works...
There's more...
See also
9. Particle Systems and Animation
Introduction
Animating a surface with vertex displacement
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a particle fountain
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a particle system using transform feedback
Getting ready
How to do it...
How it works...
There's more...
Using layout qualifiers
Querying transform feedback results
Recycling particles
See also
Creating a particle system using instanced particles
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating fire with particles
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating smoke with particles
Getting ready
How to do it...
How it works...
See also
10. Using Compute Shaders
Introduction
Compute space and work groups
Executing the Compute Shader
Implementing a particle simulation with the compute shader
Getting ready
How to do it...
How it works...
See also
Using the compute shader for cloth simulation
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing an edge detection filter with the compute shader
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a fractal texture using the compute shader
Getting ready
How to do it...
How it works...
There's more...
3. Module 3
1. Getting Started with OpenGL
Introduction
Setting up a Windows-based development platform
Installing Visual Studio 2013
Getting ready
How to do it...
Installing CMake in Windows
Getting ready
How to do it…
Setting up a Mac-based development platform
Installing Xcode and command-line tools
Getting ready
How to do it...
See also
Installing MacPorts and CMake
Getting ready
How to do it...
Setting up a Linux-based development platform
Getting ready
How to do it…
How it works…
See also
Installing the GLFW library in Windows
Getting ready
How to do it...
Installing the GLFW library in Mac OS X and Linux
Getting ready
How to do it...
How it works...
Creating your first OpenGL application with GLFW
Getting ready
How to do it...
How it works...
Compiling and running your first OpenGL application in Windows
Getting ready
How to do it...
Compiling and running your first OpenGL application in Mac OS X or Linux
Getting ready
How to do it...
2. OpenGL Primitives and 2D Data Visualization
Introduction
OpenGL primitives
Drawing points
Getting ready
How to do it…
How it works…
See also
Drawing line segments
Getting ready
How to do it…
How it works…
Drawing triangles
Getting ready
How to do it…
How it works…
Creating a 2D plot using primitives
Getting ready
How to do it…
How it works…
Real-time visualization of time series
Getting ready
How to do it…
How it works…
2D visualization of 3D/4D datasets
Getting ready
How to do it…
How it works…
There's more…
3. Interactive 3D Data Visualization
Introduction
Setting up a virtual camera for 3D rendering
Getting ready
How to do it...
How it works...
There's more...
Creating a 3D plot with perspective rendering
Getting ready
How to do it...
How it works...
There's more...
Creating an interactive environment with GLFW
Getting ready
How to do it...
How it works...
See also
Rendering a volumetric dataset – MCML simulation
Getting ready
How to do it...
How it works...
There's more...
See also
4. Rendering 2D Images and Videos with Texture Mapping
Introduction
Getting started with modern OpenGL (3.2 or higher)
Getting ready
How to do it...
How it works...
See also
Setting up the GLEW, GLM, SOIL, and OpenCV libraries in Windows
Getting ready
How to do it...
See also
Setting up the GLEW, GLM, SOIL, and OpenCV libraries in Mac OS X/Linux
Getting ready
How to do it...
See also
Creating your first vertex and fragment shader using GLSL
Getting ready
How to do it...
How it works...
Rendering 2D images with texture mapping
Getting ready
How to do it...
How it works...
Real-time video rendering with filters
Getting ready
How to do it...
How it works...
5. Rendering of Point Cloud Data for 3D Range-sensing Cameras
Introduction
Getting started with the Microsoft Kinect (PrimeSense) 3D range-sensing camera
How to do it...
See also
Capturing raw data from depth-sensing cameras
How to do it...
How it works...
OpenGL point cloud rendering with texture mapping and overlays
Getting ready
How to do it...
How it works...
6. Rendering Stereoscopic 3D Models using OpenGL
Introduction
Installing the Open Asset Import Library (Assimp)
How to do it...
See also
Loading the first 3D model in the Wavefront Object (.obj) format
How to do it...
How it works...
Rendering 3D models with points, lines, and triangles
How to do it...
How it works...
See also
Stereoscopic 3D rendering
How to do it...
How it works...
See also
7. An Introduction to Real-time Graphics Rendering on a Mobile Platform using OpenGL ES 3.0
Introduction
Setting up the Android SDK
How to do it...
See also
Setting up the Android Native Development Kit (NDK)
How to do it...
See also
Developing a basic framework to integrate the Android NDK
How to do it...
How it works...
See also
Creating your first Android application with OpenGL ES 3.0
Getting ready
How to do it...
How it works...
See also
8. Interactive Real-time Data Visualization on Mobile Devices
Introduction
Visualizing real-time data from built-in Inertial Measurement Units (IMUs)
Getting ready
How to do it…
How it works…
See also
Part I – handling multi-touch interface and motion sensor inputs
How to do it…
How it works…
See also
Part II – interactive, real-time data visualization with mobile GPUs
How to do it…
How it works…
9. Augmented Reality-based Visualization on Mobile or Wearable Platforms
Introduction
Getting started I: Setting up OpenCV on Android
Getting ready
How to do it...
See also
Getting started II: Accessing the camera live feed using OpenCV
Getting ready
How to do it...
How it works...
Displaying real-time video using texture mapping
Getting ready
How to do it...
How it works...
See also
Augmented reality-based data visualization over real-world scenes
Getting ready
How to do it...
How it works...
See also
A. Bibliography
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
OpenGL – Build high performance graphics
Table of Contents
OpenGL – Build high performance graphics
OpenGL – Build high performance graphics
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Module 1
1. Introduction to Modern OpenGL
Introduction
Setting up the OpenGL v3.3 core profile on Visual Studio 2010 using the GLEW and freeglut libraries
How to do it...
There's more…
Designing a GLSL shader class
Getting ready
How to do it…
How it works…
There's more…
Rendering a simple colored triangle using shaders
Getting ready
How to do it…
How it works…
There's more…
See also
Doing a ripple mesh deformer using the vertex shader
Getting ready
How to do it…
How it works…
There's more
Dynamically subdividing a plane using the geometry shader
Getting ready
How to do it…
How it works…
There's more…
See also
Dynamically subdividing a plane using the geometry shader with instanced rendering
Getting ready
How to do it…
How it works…
See also
Drawing a 2D image in a window using the fragment shader and the SOIL image loading library
Getting ready
How to do it…
How it works…
There's more…
2. 3D Viewing and Object Picking
Introduction
Implementing a vector-based camera with FPS style input support
Getting ready
How to do it…
There's more…
See also
Implementing the free camera
Getting ready
How to do it…
There's more…
See also
Implementing the target camera
Getting ready
How to do it…
There's more…
See also
Implementing view frustum culling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing object picking using the depth buffer
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing object picking using color
Getting ready
How to do it…
How it works…
See also
Implementing object picking using scene intersection queries
Getting ready
How to do it…
How it works…
There's more…
See also
3. Offscreen Rendering and Environment Mapping
Introduction
Implementing the twirl filter using the fragment shader
Getting ready
How to do it…
How it works…
There's more...
Rendering a skybox using static cube mapping
Getting ready
How to do it…
How it works…
There's more…
Implementing a mirror with render-to-texture using FBO
Getting ready
How to do it…
How it works…
There's more…
See also
Rendering a reflective object using dynamic cube mapping
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing area filtering (sharpening/blurring/embossing) on an image using convolution
Getting ready
How to do it…
How it works...
There's more…
See also
Implementing the glow effect
How to do it…
How it works…
There's more…
See also
4. Lights and Shadows
Introduction
Implementing per-vertex and per-fragment point lighting
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment directional light
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment point light with attenuation
Getting started
How to do it…
How it works…
There's more…
See also
Implementing per-fragment spot light
Getting started
How to do it…
How it works…
There's more…
See also
Implementing shadow mapping with FBO
Getting started
How to do it…
How it works…
There's more…
See also
Implemeting shadow mapping with percentage closer filtering (PCF)
Getting started
How to do it…
How it works…
There's more…
See also
Implementing variance shadow mapping
Getting started
How to do it…
How it works…
There's more…
See also
5. Mesh Model Formats and Particle Systems
Introduction
Implementing terrains using the height map
Getting started
How to do it…
How it works…
There's more…
See also
Implementing 3ds model loading using separate buffers
Getting started
How to do it…
How it works…
There's more…
See also
Implementing OBJ model loading using interleaved buffers
Getting started
How to do it…
How it works…
There's more…
See also
Implementing EZMesh model loading
Getting started
How to do it...
How it works…
There's more…
See also
Implementing simple particle system
Getting started
How to do it…
How it works…
There's more…
See also
6. GPU-based Alpha Blending and Global Illumination
Introduction
Implementing order-independent transparency using front-to-back peeling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing order-independent transparency using dual depth peeling
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing screen space ambient occlusion (SSAO)
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing global illumination using spherical harmonics lighting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing GPU-based ray tracing
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing GPU-based path tracing
Getting ready
How to do it…
How it works…
There's more…
See also
7. GPU-based Volume Rendering Techniques
Introduction
Implementing volume rendering using 3D texture slicing
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volume rendering using single-pass GPU ray casting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing pseudo-isosurface rendering in single-pass GPU ray casting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volume rendering using splatting
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing transfer function for volume classification
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing polygonal isosurface extraction using the Marching Tetrahedra algorithm
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing volumetric lighting using the half-angle slicing
Getting ready
How to do it…
How it works…
There's more…
See also
8. Skeletal and Physically-based Simulation on the GPU
Introduction
Implementing skeletal animation using matrix palette skinning
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing skeletal animation using dual quaternion skinning
Getting ready
How to do it…
How it works…
There's more…
See also
Modeling cloth using transform feedback
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing collision detection and response on a transform feedback-based cloth model
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing a particle system using transform feedback
Getting ready
How to do it…
How it works…
There's more…
See also
2. Module 2
1. Getting Started with GLSL
Introduction
The OpenGL Shading Language
Profiles – Core vs. Compatibility
Using a function loader to access the latest OpenGL functionality
Getting ready
How to do it...
How it works...
There's more...
Generating a C++ loader
No-load styles
Using Extensions
See also
Using GLM for mathematics
Getting ready
How to do it...
How it works...
There's more...
Using the GLM types as input to OpenGL
See also
Determining the GLSL and OpenGL version
How to do it...
How it works...
There's more...
See also
Compiling a shader
Getting ready
How to do it...
How it works...
There's more...
Deleting a Shader Object
See also
Linking a shader program
Getting ready
How to do it...
How it works...
There's more...
Deleting a Shader program
See also
Sending data to a shader using vertex attributes and vertex buffer objects
Getting ready
How to do it...
How it works...
There's more...
Separate attribute format
Fragment shader output
Specifying attribute indexes without using layout qualifiers
Using element arrays
Interleaved arrays
Getting a list of active vertex input attributes and locations
Getting ready
How to do it...
How it works...
There's more...
See also
Sending data to a shader using uniform variables
Getting ready
How to do it...
How it works...
There's more...
See also
Getting a list of active uniform variables
Getting ready
How to do it…
How it works...
There's more...
See also
Using uniform blocks and uniform buffer objects
Getting ready
How to do it...
How it works...
There's more...
Using an instance name with a uniform block
Using layout qualifiers with uniform blocks
See also
Getting debug messages
Getting ready
How to do it...
How it works...
There's more...
Building a C++ shader program class
Getting ready
How to do it...
How it works...
See also
2. The Basics of GLSL Shaders
Introduction
Vertex and fragment shaders
Replicating the old fixed functionality
Implementing diffuse, per-vertex shading with a single point light source
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing per-vertex ambient, diffuse, and specular (ADS) shading
Getting ready
How to do it...
How it works...
There's more...
Using a non-local viewer
Per-vertex versus per-fragment
Directional lights
Light attenuation with distance
See also
Using functions in shaders
Getting ready
How to do it...
How it works...
There's more...
The const qualifier
Function overloading
Passing arrays or structures to a function
See also
Implementing two-sided shading
Getting ready
How to do it...
How it works...
There's more...
Using two-sided rendering for debugging
See also
Implementing flat shading
How to do it...
How it works...
See also
Using subroutines to select shader functionality
Getting ready
How to do it...
How it works...
There's more...
See also
Discarding fragments to create a perforated look
Getting ready
How to do it...
How it works...
See also
3. Lighting, Shading, and Optimization
Introduction
Shading with multiple positional lights
Getting ready
How to do it...
How it works...
See also
Shading with a directional light source
Getting ready
How to do it...
How it works...
There's more...
See also
Using per-fragment shading for improved realism
Getting ready
How to do it...
How it works...
There's more...
See also
Using the halfway vector for improved performance
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating a spotlight
Getting ready
How to do it...
How it works...
See also
Creating a cartoon shading effect
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating fog
Getting ready
How to do it...
How it works...
There's more...
Computing distance from the eye
See also
Configuring the depth test
How to do it...
How it works...
See also
4. Using Textures
Introduction
Applying a 2D texture
Getting ready
How to do it...
How it works...
There's more...
Specifying the sampler binding within GLSL
See also
Applying multiple textures
Getting ready
How to do it...
How it works...
There's more...
See also
Using alpha maps to discard pixels
Getting ready
How to do it...
How it works...
There's more...
See also
Using normal maps
Getting ready
How to do it...
How it works...
See also
Simulating reflection with cube maps
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating refraction with cube maps
Getting ready
How to do it...
How it works...
There's more...
The Fresnel equations
Chromatic aberration
Refracting through both sides of the object
See also
Applying a projected texture
Getting ready
How to do it...
How it works...
There's more...
See also
Rendering to a texture
Getting ready
How to do it...
How it works...
There's more...
See also
Using sampler objects
Getting ready
How to do it...
How it works...
See also
5. Image Processing and Screen Space Techniques
Introduction
Applying an edge detection filter
Getting ready
How to do it...
How it works...
There's more...
Optimization techniques
See also
Applying a Gaussian blur filter
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing HDR lighting with tone mapping
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a bloom effect
Getting ready
How to do it...
How it works...
There's more...
See also
Using gamma correction to improve image quality
How to do it...
How it works...
There's more...
Using multisample anti-aliasing
Getting ready
How to do it...
How it works...
There's more...
Using deferred shading
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing order-independent transparency
Getting ready
How to do it...
How it works...
There's more...
See also
6. Using Geometry and Tessellation Shaders
Introduction
The shader pipeline extended
The geometry shader
The tessellation shaders
Point sprites with the geometry shader
Getting ready
How to do it...
How it works...
There's more...
Drawing a wireframe on top of a shaded mesh
Getting ready
How to do it...
How it works...
There's more...
See also…
Drawing silhouette lines using the geometry shader
Getting ready
How to do it...
How it works...
There's more...
See also
Tessellating a curve
Getting ready
How to do it...
How it works...
There's more...
Tessellating a 2D quad
Getting ready
How to do it...
How it works...
See also
Tessellating a 3D surface
Getting ready
How to do it...
How it works...
See also
Tessellating based on depth
Getting ready
How to do it...
How it works...
There's more...
See also
7. Shadows
Introduction
Rendering shadows with shadow maps
Getting ready
How to do it...
How it works...
There's more...
Aliasing
Rendering back faces only for the shadow map
See also
Anti-aliasing shadow edges with PCF
Getting ready
How to do it...
How it works...
There's more...
See also
Creating soft shadow edges with random sampling
Getting ready
How to do it...
How it works...
There's more...
See also
Creating shadows using shadow volumes and the geometry shader
Getting ready
How to do it...
How it works...
There's more...
See also
8. Using Noise in Shaders
Introduction
See Also…
Creating a noise texture using GLM
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a seamless noise texture
Getting ready
How to do it...
How it works...
See also
Creating a cloud-like effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a wood-grain effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a disintegration effect
Getting ready
How to do it...
How it works...
See also
Creating a paint-spatter effect
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a night-vision effect
Getting ready
How to do it...
How it works...
There's more...
See also
9. Particle Systems and Animation
Introduction
Animating a surface with vertex displacement
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a particle fountain
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a particle system using transform feedback
Getting ready
How to do it...
How it works...
There's more...
Using layout qualifiers
Querying transform feedback results
Recycling particles
See also
Creating a particle system using instanced particles
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating fire with particles
Getting ready
How to do it...
How it works...
There's more...
See also
Simulating smoke with particles
Getting ready
How to do it...
How it works...
See also
10. Using Compute Shaders
Introduction
Compute space and work groups
Executing the Compute Shader
Implementing a particle simulation with the compute shader
Getting ready
How to do it...
How it works...
See also
Using the compute shader for cloth simulation
Getting ready
How to do it...
How it works...
There's more...
See also
Implementing an edge detection filter with the compute shader
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a fractal texture using the compute shader
Getting ready
How to do it...
How it works...
There's more...
3. Module 3
1. Getting Started with OpenGL
Introduction
Setting up a Windows-based development platform
Installing Visual Studio 2013
Getting ready
How to do it...
Installing CMake in Windows
Getting ready
How to do it…
Setting up a Mac-based development platform
Installing Xcode and command-line tools
Getting ready
How to do it...
See also
Installing MacPorts and CMake
Getting ready
How to do it...
Setting up a Linux-based development platform
Getting ready
How to do it…
How it works…
See also
Installing the GLFW library in Windows
Getting ready
How to do it...
Installing the GLFW library in Mac OS X and Linux
Getting ready
How to do it...
How it works...
Creating your first OpenGL application with GLFW
Getting ready
How to do it...
How it works...
Compiling and running your first OpenGL application in Windows
Getting ready
How to do it...
Compiling and running your first OpenGL application in Mac OS X or Linux
Getting ready
How to do it...
2. OpenGL Primitives and 2D Data Visualization
Introduction
OpenGL primitives
Drawing points
Getting ready
How to do it…
How it works…
See also
Drawing line segments
Getting ready
How to do it…
How it works…
Drawing triangles
Getting ready
How to do it…
How it works…
Creating a 2D plot using primitives
Getting ready
How to do it…
How it works…
Real-time visualization of time series
Getting ready
How to do it…
How it works…
2D visualization of 3D/4D datasets
Getting ready
How to do it…
How it works…
There's more…
3. Interactive 3D Data Visualization
Introduction
Setting up a virtual camera for 3D rendering
Getting ready
How to do it...
How it works...
There's more...
Creating a 3D plot with perspective rendering
Getting ready
How to do it...
How it works...
There's more...
Creating an interactive environment with GLFW
Getting ready
How to do it...
How it works...
See also
Rendering a volumetric dataset – MCML simulation
Getting ready
How to do it...
How it works...
There's more...
See also
4. Rendering 2D Images and Videos with Texture Mapping
Introduction
Getting started with modern OpenGL (3.2 or higher)
Getting ready
How to do it...
How it works...
See also
Setting up the GLEW, GLM, SOIL, and OpenCV libraries in Windows
Getting ready
How to do it...
See also
Setting up the GLEW, GLM, SOIL, and OpenCV libraries in Mac OS X/Linux
Getting ready
How to do it...
See also
Creating your first vertex and fragment shader using GLSL
Getting ready
How to do it...
How it works...
Rendering 2D images with texture mapping
Getting ready
How to do it...
How it works...
Real-time video rendering with filters
Getting ready
How to do it...
How it works...
5. Rendering of Point Cloud Data for 3D Range-sensing Cameras
Introduction
Getting started with the Microsoft Kinect (PrimeSense) 3D range-sensing camera
How to do it...
See also
Capturing raw data from depth-sensing cameras
How to do it...
How it works...
OpenGL point cloud rendering with texture mapping and overlays
Getting ready
How to do it...
How it works...
6. Rendering Stereoscopic 3D Models using OpenGL
Introduction
Installing the Open Asset Import Library (Assimp)
How to do it...
See also
Loading the first 3D model in the Wavefront Object (.obj) format
How to do it...
How it works...
Rendering 3D models with points, lines, and triangles
How to do it...
How it works...
See also
Stereoscopic 3D rendering
How to do it...
How it works...
See also
7. An Introduction to Real-time Graphics Rendering on a Mobile Platform using OpenGL ES 3.0
Introduction
Setting up the Android SDK
How to do it...
See also
Setting up the Android Native Development Kit (NDK)
How to do it...
See also
Developing a basic framework to integrate the Android NDK
How to do it...
How it works...
See also
Creating your first Android application with OpenGL ES 3.0
Getting ready
How to do it...
How it works...
See also
8. Interactive Real-time Data Visualization on Mobile Devices
Introduction
Visualizing real-time data from built-in Inertial Measurement Units (IMUs)
Getting ready
How to do it…
How it works…
See also
Part I – handling multi-touch interface and motion sensor inputs
How to do it…
How it works…
See also
Part II – interactive, real-time data visualization with mobile GPUs
How to do it…
How it works…
9. Augmented Reality-based Visualization on Mobile or Wearable Platforms
Introduction
Getting started I: Setting up OpenCV on Android
Getting ready
How to do it...
See also
Getting started II: Accessing the camera live feed using OpenCV
Getting ready
How to do it...
How it works...
Displaying real-time video using texture mapping
Getting ready
How to do it...
How it works...
See also
Augmented reality-based data visualization over real-world scenes
Getting ready
How to do it...
How it works...
See also
A. Bibliography
Index
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset