|OpenGL 3 Per-Fragment Directional Lighting Demo.
This Windows application demonstrates how to implement the Phong lighting model for a single directional light source using OpenGL 3 or a forward compatible OpenGL 3.0 rendering context. The shaders can be extended to support multiple directional light sources.
Press the SPACE BAR to pause the spinning cube. Press ALT and ENTER to toggle between windowed mode and full screen mode.
1. This is an OpenGL 3 demo. This demo will not run on OpenGL 2.x and OpenGL 1.x hardware.
2. This demo requires the Visual C++ 2010 Library Runtimes. Download instructions can be found here.
Download executable, source, and Visual C++ 2010 solution files.
10 July 2010.
Added missing .vcxproj.filters file to the project.
13 June 2010.
Updated solution to Microsoft Visual Studio 2010.
23 December 2009.
phong_dir.vert: Fixed a bug where VertexPos was not being calculated correctly. It wasn't being divided by the homogeneous w value.