GLSL Core Tutorial – Index
Prev: Texturing with Images | Next: Pipeline |
The Graphics Pipeline
- A Simplified Diagram of the Pipeline
- Vertex Shader
- Primitive Assembly
- Tessellation Shader
- Geometry Shader
- Geometry Shader Examples
- Rasterization and Interpolation
- Fragment Shader
OpenGL Setup
- Introduction
- Creating a Shader
- Creating a Program
- Setup Example
- Troubleshooting: the Infolog
- Cleaning Up
GLSL Syntax
Communication Application => Shader
Inter Shader Communication – Interfaces
Some notes before diving into the examples
Shader examples
Cube – This is the first example of this tutorial. It is quite simple on purpose, it just covers the basics to get our geometry on screen. It uses uniform blocks, and it shows how to transform points using the projection-view-model matrix.
Colored Cube – In this second example we talk about several approaches on how to set color. We explore colour as a vertex atribute, and setting color with uniform variables. We also introduce the theme of debugging shaders using color to display input or computed values.
Lighting – Lighting is essential in CG. This example goes through the basic theory and implementation of simple local lighting, using both Gouraud and Phong shading models for three common light types: directional, point and spot lights.
- Introduction
- Directional Lights per Vertex I
- Directionl Lights per Vertex II
- Directional Lights per Pixel
- Point Lights
- Spot Lights
Playing with Texture Coordinates – Texture coordinates are commonly used to define how an image maps to a surface. However texture coordinates are not restricted to perform this mapping. Texture coordinates per se can be used to color a model. Here we will see a couple examples of how texture coordinates can be used on their own and explore a few new GLSL functions, such as mix
and smoothstep
.
Image Texturing – Images are commonly used as wallpaper applied to 3D shapes to create a variety of effects. In this section we focus on the OpenGL and GLSL typical scenario of texture usage, and explore a few new GLSL functions, such as textureSize
, textureQueryLod
, and textureQueryLevels
.
Source code and a VS2010 project are also included in each example.
Prev: Texturing with Images | Next: Pipeline |