Trade in Yours
For a 1.22 Gift Card
Trade in
Have one to sell? Sell yours here
Tell the Publisher!
Id like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

OpenGL Shading Language [Paperback]

Randi J. Rost
4.0 out of 5 stars  See all reviews (1 customer review)

Available from these sellers.


‹  Return to Product Overview

Table of Contents



Foreword.


Preface.


About the Author.


About the Contributors.


Acknowledgments.


1. Review of OpenGL Basics.

OpenGL History.

Evolving OpenGL.

Execution Model.

The Frame Buffer.

State.

Processing Pipeline.

Drawing Geometry.

Specifying Geometry.

Per-Vertex Operations.

Primitive Assembly.

Primitive Processing.

Rasterization.

Fragment Processing.

Per-Fragment Operations.

Frame Buffer Operations.

Drawing Images.

Pixel Unpacking.

Pixel Transfer.

Rasterization and Back-End Processing.

Read Control.

Coordinate Transforms.

Texturing.

Summary.

Further Information.



2. Basics.

Introduction to the OpenGL Shading Language.

Why Write Shaders?

OpenGL Programmable Processors.

Vertex Processor.

Fragment Processor.

Language Overview.

Language Design Considerations.

C Basis.

Additions to C.

Additions from C++.

C Features Not Supported.

Other Differences.

System Overview.

Driver Model.

OpenGL Shading Language Compiler/Linker

OpenGL API Extensions.

Key Benefits.

Summary.

Further Information.



3. Language Definition.

Example Shader Pair.

Data Types.

Scalars.

Vectors.

Matrices.

Samplers.

Structures.

Arrays.

Void.

Declarations and Scope.

Type Matching and Promotion.

Initializers and Constructors.

Type Conversions.

Qualifiers and Interface to a Shader.

Attribute Qualifiers.

Uniform Qualifiers.

Varying Qualifiers.

Constant Qualifiers.

Absent Qualifier.

Flow Control.

Functions.

Calling Conventions.

Built-in Functions.

Operations.

Indexing.

Swizzling.

Component-wise Operation.

Preprocessor.

Preprocessor Expressions.

Error Handling.

Summary.

Further Information.



4. The OpenGL Programmable Pipeline.

The Vertex Processor.

Vertex Attributes.

Uniform Variables.

Special Output Variables.

Built-in Varying Variables.

User-Defined Varying Variables.

The Fragment Processor.

Varying Variables.

Uniform Variables.

Special Input Variables.

Special Output Variables.

Built-in Uniform Variables.

Built-in Constants.

Interaction with OpenGL Fixed Functionality.

Two-Sided Color Mode.

Point Size Mode.

Clipping.

Raster Position.

Position Invariance.

Texturing.

Summary.

Further Information.



5. Built-in Functions.

Angle and Trigonometry Functions.

Exponential Functions.

Common Functions.

Geometric Functions.

Matrix Functions.

Vector Relational Functions.

Texture Access Functions.

Fragment Processing Functions.

Noise Functions.

Summary.

Further Information.



6. Simple Shading Example.

Brick Shader Overview.

Vertex Shader.

Fragment Shader.

Observations.

Summary.

Further Information.



7. OpenGL Shading Language API.

Creating Shader Objects.

Compiling Shader Objects.

Linking and Using Shaders.

Cleaning Up.

Query Functions.

Specifying Vertex Attributes.

Specifying Uniform Variables.

Samplers.

Development Aids.

Implementation-Dependent API Values.

Application Code for Brick Shaders.

Summary.

Further Information.



8. Shader Development.

General Principles.

Understand the Problem.

Add Complexity Progressively.

Test and Iterate.

Strive for Simplicity.

Modularity.

Performance Considerations.

Consider Computational Frequency.

Analyze Your Algorithm.

Use the Built-in Functions.

Use Vectors.

Use Textures to Encode Complex Functions.

Review the Info Logs.

Shader Debugging.

Use the Vertex Shader Output.

Use the Fragment Shader Output.

Use Simple Geometry.

Shader Development Tools.

RenderMonkey.

OpenGL Shading Language Compiler Front End.

Summary.

Further Information.



9. Traditional Shaders.

Transformation.

Light Sources.

Directional Lights.

Point Lights.

Spotlights.

Material Properties and Lighting.

Two-Sided Lighting.

No Lighting.

Fog.

Texture Coordinate Generation.

User Clipping.

Texture Application.

Summary.

Further Information.



10. Stored Texture Shaders.

Accessing Texture Maps from a Shader.

Simple Texturing Example.

Application Setup.

Vertex Shader.

Fragment Shader.

Multitexturing Example.

Application Setup.

Vertex Shader.

Fragment Shader.

Environment Mapping Example.

Application Setup.

Vertex Shader.

Fragment Shader.

Polynomial Texture Mapping with BRDF Data.

Application Setup.

Vertex Shader.

Fragment Shader.

Summary.

Further Information.



11. Procedural Texture Shaders.

Regular Patterns.

Stripes vertex shader.

Stripes Fragment Shader.

Toy Ball.

Application Setup.

Vertex Shader.

Fragment Shader.

Lattice.

Bump Mapping.

Application Setup.

Vertex Shader.

Fragment Shader.

Normal Maps.

Summary.

Further Information.



12. Noise.

Defining Noise.

2D Noise.

Higher Dimensions of Noise.

Using Noise in OpenGL Shaders.

Noise Textures.

Trade-offs.

A Simple Noise Shader.

Application Setup.

Vertex Shader.

Fragment Shader.

Turbulence.

Sun Surface Shader.

Marble.

Granite.

Wood.

Application Setup.

Fragment Shader.

Summary.

Further Information.



13. Animated Shaders.

On/Off.

Threshold.

Translation.

Key-Frame Interpolation.

Key-Frame Interpolation Vertex Shader.

Other Blending Effects.

Particle Systems.

Application Setup.

Confetti Cannon Vertex Shader.

Confetti Cannon Fragment Shader.

Further Enhancements.

Wobble.

Summary.

Further Information.



14. Antialiasing Procedural Textures.

Sources of Aliasing.

Avoiding Aliasing.

Increasing Resolution.

Antialiased Stripe Example.

Generating Stripes.

Analytic Prefiltering.

Adaptive Analytic Prefiltering.

Analytic Integration.

Antialiased Brick Fragment Shader.

Frequency Clamping.

Antialiased Checkerboard Fragment Shader.

Summary.

Further Information.



15. Non-Photorealistic Shaders.

Hatching Example.

Application Setup.

Vertex Shader.

Generating Hatching Strokes.

Obtaining Uniform Line Density.

Lighting.

Adding Character.

Hatching Fragment Shader.

Technical Illustration Example.

Application Setup.

Vertex Shader.

Fragment Shader.

Mandelbrot Example.

About the Mandelbrot Set.

Vertex Shader.

Fragment Shader.

Julia Sets.

Summary.

Further Information.



16. Shaders for Imaging.

Geometric Image Transforms.

Mathematical Mappings.

Lookup Table Operations.

Color Space Conversions.

Image Interpolation and Extrapolation.

Brightness.

Contrast.

Saturation.

Sharpness.

Blend Modes.

Normal.

Average.

Dissolve.

Behind.

Clear.

Darken.

Lighten.

Multiply.

Screen.

Color Burn.

Color Dodge.

Overlay.

Soft Light.

Hard Light.

Add.

Subtract.

Difference.

‹  Return to Product Overview