OpenGL and GLSL Demo

Found some time to play with GLSL Extension. I started with a simple Cube Demo from NeHe using SDL for the user interface programming. Then i added GLEW as the GLSL extension wrapper. The Shader Programs are taken from Linux Magazin Article. Currently no own ideas 🙂 First i had to refresh my OpenGL basics. So i added some switches to trigger Alpha Blending and different textures.

When running the demo you press following keys to trigger different effects:

  • ‘l’ to toggle Light
  • ‘b’ to enable Alpha Blend
  • ‘f’ to step through NEAREST, LINEAR and MIPMAP textures
  • ‘s’ toggle current Shader Programm
  • ‘n’ switch to different Shader Programms

Use the mouse and the left button to rotate the cube. The right button and mouse motion to zoom into the scene.
The code was tested with a Nvida GT6800 card. You’ll need nvidia GL library, Glew and SDLlib to build it from sources.

Toonshading

glsl

Deformation

glsl

Mipmapped Texture

glsl

Source

Scroll to Top