dhpoware logo
navbar
home products source demos contact us
navbar navbar
box top left corner box top right corner
 
 
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.

Note:
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.

screen shot

zip file Download executable, source, and Visual C++ 2010 solution files.

Change History:

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.

 
box bottom left corner content box box bottom right corner
logo logo