Computer Graphics I

4003-570-02 / 4005-761-02

Assignment #4: OpenGL Shading Language (GLSL)



Date posted: November 5, 2010
Date due: November 17, 2010 at 11:59 p.m.

Drop box available at myCourses


Introduction

This project is designed to give you experience using the OpenGL Shading Language (GLSL). You are to write a set of GLSL shaders to implement a shading method as described below.

Required Elements

You will be implementing a fragment-shader version of the Phong shading model.

Your implementation must include both a vertex and a fragment shader. The vertex shader must do a portion of the necessary Phong calculations (specifically, any that involve vertex-specific information such as vertex position); the color calculations must be done in the fragment shader.

Supplied Files

You can download skeleton and support files for the assignment here.

The folder contains both C and C++ samples. Please choose the one that is appropriate for you.

The README included in the folders provide a description of the files. Be sure to read this carefully.

What to submit

As you are writing shaders, all you need to submit are the two shader source files you are creating. These files must be named phong.vert and phong.frag. Submit your files (along with an optional README file) to the dropbox on myCourses.

Grading

Your grade will be based on the following items:

Notes

The supplied ShaderSetup() includes all the necessary code to verify that your shaders compiled and linked correctly.

You may want to experiment with your shader code using your scenes from Assignment 3.

The CS systems have OpenGL 2.1.1 and GLSL 1.20 installed on them; thus, features in newer versions of these languages will not work on our systems.

If you will be testing your code on your own system, you may want to determine what versions of OpenGL and GLSL are installed on that system. A simple OpenGL demo program which draws a single line on the screen and also reports the results from glGetString() queries for GL_VENDOR, GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION, and GL_EXTENSIONS is available here.