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:
Example01 - Basic window and OpenGL 3 initialization
Example02 - Rendering of a triangle
Example03 - Grey filter
Example04 - Perspective rendering of a cube
Example05 - Phong rendering of a sphere
Example06 - Texturing of a cube
Example07 - Normal mapping
Example08 - Environment/cube mapping
Example09 - GPU Particles
Example10 - Geometry Shader
Example11 - Reflection and Refraction
Example12 - Shadow mapping
Example13 - Simple tessellation (OpenGL 4.2)
Example14 - Terrain Rendering (OpenGL 4.2)
Example15 - Water Rendering
Example16 - Model loading and rendering
Example17 - Clipping planes and two sided rendering
Example18 - Using stencil buffer and clipping planes
Example19 - Render to texture and planar reflection
Example20 - Texture matrix, alpha blending and discarding
Example21 - Compute Shader (OpenGL 4.3)
Example22 - Shadow volumes
Example23 - Displacement mapping (OpenGL 4.2)
Example24 - Erode effect using perlin noise
Example25 - Model with groups and materialsTested 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!