OpenGL 3 and OpenGL 4 with GLSL

 
 
OpenGL.org OpenGL 3 and OpenGL 4 with GLSL is available but there is a lack of simple and complex example programs. On this webpage, I do want to fill this gap by providing example programs using OpenGL 3 and OpenGL 4 with GLSL. The examples itself are platform independent by using GLUS, a helper library included in the project, GLEW and GLFW. Please note, that all example programs do not use any deprecated OpenGL functions.

Source Code (Eclipse Project Files for Windows, Linux and Mac):


Do you like the examples? If yes, please recommend this site on Facebook:



Example 01 Example01 - Basic window and OpenGL 3 initialization
Example 02 Example02 - Rendering of a triangle
Example 03 Example03 - Grey filter
Example 04 Example04 - Perspective rendering of a cube
Example 05 Example05 - Phong rendering of a sphere
Example 06 Example06 - Texturing of a cube
Example 07 Example07 - Normal mapping
Example 08 Example08 - Environment/cube mapping
Example 09 Example09 - GPU Particles
Example 10 Example10 - Geometry Shader
Example 11 Example11 - Reflection and Refraction
Example 12 Example12 - Shadow mapping
Example 13 Example13 - Simple tessellation (OpenGL 4.2)
Example 14 Example14 - Terrain Rendering (OpenGL 4.2)
Example 15 Example15 - Water Rendering
Example 16 Example16 - Model loading and rendering
Example 17 Example17 - Clipping planes and two sided rendering
Example 18 Example18 - Using stencil buffer and clipping planes
Example 19 Example19 - Render to texture and planar reflection
Example 20 Example20 - Texture matrix, alpha blending and discarding
Example 21 Example21 - Compute Shader (OpenGL 4.3)
Example 22 Example22 - Shadow volumes
Example 23 Example23 - Displacement mapping (OpenGL 4.2)
Example 24 Example24 - Erode effect using perlin noise
Example 25 Example25 - Model with groups and materials

Tested platforms:

  • Linux Ubuntu 12.04 (64bit) with an NVIDIA GeForce GT 640
  • Windows 7 SP1 (64bit) and Linux Ubuntu 12.04 (64bit) with an ATI Radeon HD 7970
  • Windows 7 SP1 (64bit) with an NVIDIA GeForce GT 630M
  • Windows 7 SP1 (64bit) and Mac OS X 10.8.2 (64bit) with an ATI Radeon HD 6750M

Thanks a lot to Pablo Alonso-Villaverde Roza and Alexandr Palamar for testing and helping to make the previous Linux version happen!