更新时间:2021-04-02 18:59:55
封面
版权信息
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Getting Started with GLSL 4.0
Introduction
Using the GLEW Library to access the latest OpenGL functionality
Using the GLM library for mathematics
Determining the GLSL and OpenGL version
Compiling a shader
Linking a shader program
Sending data to a shader using per-vertex attributes and vertex buffer objects
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
Building a C++ shader program class
Chapter 2. The Basics of GLSL Shaders
Implementing diffuse per-vertex shading with a single point light source
Implementing per-vertex ambient diffuse and specular (ADS) shading
Using functions in shaders
Implementing two-sided shading
Implementing flat shading
Using subroutines to select shader functionality
Discarding fragments to create a perforated look
Chapter 3. Lighting Shading Effects and Optimizations
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
Chapter 4. Using Textures
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
Image-based lighting
Applying a projected texture
Rendering to a texture
Chapter 5. Image Processing and Screen Space Techniques
Applying an edge detection filter
Applying a Gaussian blur filter
Creating a "bloom" effect
Using gamma correction to improve image quality
Using multisample anti-aliasing
Using deferred shading
Chapter 6. Using Geometry and 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
Chapter 7. Shadows
Rendering shadows with shadow maps
Anti-aliasing shadow edges with PCF
Creating soft shadow edges with random sampling
Improving realism with prebaked ambient occlusion
Chapter 8. Using Noise in Shaders
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
Chapter 9. Animation and Particles
Animating a surface with vertex displacement
Creating a particle fountain
Creating a particle system using transform feedback
Creating a particle system using instanced particles
Simulating fire with particles
Simulating smoke with particles
Index