What this book covers
Chapter 1, Getting Started with GLSL 4.0, provides tips and tricks for setting up your OpenGL development environment to take advantage of the latest OpenGL and GLSL language features. It also teaches the basic techniques for communicating with shader programs.
Chapter 2, The Basics of GLSL Shaders, provides examples of basic shading techniques such as diffuse shading, two-sided shading, and flat shading. It also discuses an example of a new 4.0 language feature: subroutines.
Chapter 3, Lighting and Shading Effects and Optimizations, provides examples of more complex lighting and shading such as multiple lights, per-fragment shading, spotlights, cartoon shading, and fog. It moves further to explain how to gain a slight increase in execution speed by using the halfway vector or a directional light source.
Chapter 4, Using Textures, provides a variety of examples illustrating how textures can be used in GLSL shaders. It also explores examples involving simple 2D textures, multiple textures, normal maps, alpha maps, cube maps, and projected textures. It also discusses how to render to a texture using framebuffer objects.
Chapter 5, Image Processing and Screen Space Techniques, discusses various techniques to apply post-processing effects such as bloom, blur, and edge detection. It also discusses an example of a very popular rendering technique known as deferred shading.
Chapter 6, Using Geometry and Tessellation Shaders, provides a series of examples to introduce you to the new and powerful segments of the shader pipeline. It provides some examples of geometry shaders, and discusses how to use tessellation shaders to dynamically render geometry at different levels of detail.
Chapter 7, Shadows, provides several recipes surrounding the shadow-mapping algorithm. It also discusses some basic and advanced techniques for producing shadows, focusing mainly on texture-based shadow maps.
Chapter 8, Using Noise in Shaders, provides recipes that demonstrate how to make use of a pre-computed noise texture to create a variety of effects. The first two recipes demonstrate how to generate a noise texture using the free, open-source library libnoise. Then, it moves on to explain several examples that use noise textures to produce natural and artificial effects such as wood grain, clouds, electrical interference, splattering, and erosion.
Chapter 9, Animation and Particles, discusses several examples of animation within shaders, focusing mostly on particle systems. It also provides an example illustrating how to use OpenGL's transform feedback functionality within a particle system. The last two recipes in the chapter demonstrate some particle systems for simulating complex real systems, such as smoke and fire.