Cargando…

OpenGL 4.0 shading language cookbook : over 60 highly focused, practical recipes to maximize your use of the OpenGL shading language /

"This hands-on guide cuts short the preamble and gets straight to the point - actually creating graphics, instead of just theoretical learning. Each recipe is specifically tailored to satisfy your appetite for producing real-time 3-D graphics using GLSL 4.0. If you are an OpenGL programmer look...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Wolff, David
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham [England] : Packt Pub., 2011.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • 1. Getting Started with GLSL 4.0
  • 2. The Basics of GLSL Shaders
  • 3. Lighting, Shading Effects, and Optimizations
  • 4. Using Textures
  • 5. Image Processing and Screen Space Techniques
  • 6. Using Geometry and Tessellation Shaders
  • 7. Shadows
  • 8. Using Noise in Shaders
  • 9. Animation and Particles.
  • 1. Getting Started with GLSL 4.0
  • Introduction
  • The OpenGL Shading Language
  • Profiles: Core vs. Compatibility
  • Using the GLEW Library to access the latest OpenGL functionality
  • GLEW visualinfo
  • GLEW glewinfo
  • Checking for extension availability at runtime
  • Using the GLM library for mathematics
  • Using the GLM types as input to OpenGL
  • Determining the GLSL and OpenGL version
  • Compiling a shader
  • Deleting a shader object
  • Linking a shader program
  • Deleting a shader program
  • Sending data to a shader using per-vertex attributes and vertex buffer objects
  • Using layout qualifiers
  • Using element arrays
  • Interleaved arrays
  • Getting a list of active vertex input attributes and indices
  • Sending data to a shader using uniform variables
  • Getting a list of active uniform variables
  • Using uniform blocks and uniform buffer objects
  • Using an instance name with a uniform block
  • Using layout qualifiers with uniform blocks
  • Building a C++ shader program class
  • 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
  • Implementing per-vertex ambient, diffuse, and specular (ADS) shading
  • Using a non-local viewer
  • Per-vertex vs. Per-fragment
  • Directional lights
  • Light attenuation with distance
  • Using functions in shaders
  • The const qualifier
  • Function overloading
  • Passing arrays or structures to a function
  • Implementing two-sided shading
  • Using two-sided rendering for debugging
  • Implementing flat shading
  • Using subroutines to select shader functionality
  • Discarding fragments to create a perforated look
  • 3. Lighting, Shading Effects, and Optimizations
  • Introduction
  • Shading with multiple positional lights
  • Shading with a directional light source
  • Using per-fragment shading for improved realism
  • Using the halfway vector for improved performance
  • Simulating a spotlight
  • Creating a cartoon shading effect
  • Simulating fog
  • Computing distance from the eye
  • 4. Using Textures
  • Introduction
  • Applying a 2D texture
  • Applying multiple textures
  • Using alpha maps to discard pixels
  • Using normal maps
  • Simulating reflection with cube maps
  • Simulating refraction with cube maps
  • The Fresnel equations
  • Chromatic aberration
  • Both sides of the object?
  • Image-based lighting
  • Applying a projected texture
  • Rendering to a texture
  • 5. Image Processing and Screen Space Techniques
  • Introduction
  • Applying an edge detection filter
  • Optimization techniques
  • Applying a Gaussian blur filter
  • Creating a "bloom" effect
  • Using low-res textures
  • Using gamma correction to improve image quality
  • Using multisample anti-aliasing
  • Using deferred shading
  • 6. Using Geometry and Tessellation Shaders
  • Introduction
  • The shader pipeline extended
  • The geometry shader
  • The tessellation shaders
  • Point sprites with the geometry shader
  • Drawing a wireframe on top of a shaded mesh
  • Drawing silhouette lines using the geometry shader
  • Tessellating a curve
  • Tessellating a 2D quad
  • Tessellating a 3D surface
  • Tessellating based on depth
  • 7. Shadows
  • Introduction
  • Rendering shadows with shadow maps
  • Aliasing
  • Rendering back faces only for the shadow map
  • Anti-aliasing shadow edges with PCF
  • Creating soft shadow edges with random sampling
  • Improving realism with prebaked ambient occlusion
  • Screen-space ambient occlusion
  • Another technique for dynamic ambient occlusion
  • 8. Using Noise in Shaders
  • Introduction
  • Creating a noise texture using libnoise
  • Creating a seamless noise texture
  • Creating a cloud-like effect
  • Creating a wood grain effect
  • Creating a disintegration effect
  • Creating a paint-spatter effect
  • Creating a night-vision effect
  • 9. Animation and Particles
  • Introduction
  • Animating a surface with vertex displacement
  • Creating a particle fountain
  • Creating a particle system using transform feedback
  • Querying transform feedback results
  • Recycling particles
  • Creating a particle system using instanced particles
  • Simulating fire with particles
  • Simulating smoke with particles.