Project 2: Due Thursday, March 31, 2005
Preliminary
In this project, you are trying to get familier with GPU programming using the Cg language. The first step is to set up Cg. First make sure that:Try to perform the following preliminary tasks:
- Your graphics card has a programmable GPU
- You have Microsoft Visual Studio (at least Version 6)
- OpenGL and GLUT are set up on your system
Specific tasks that you should aim to learn how to do from the tutorials/exploration include:
- Download the latest Version of the Cg toolkit at http://developer.nvidia.com/object/cg_toolkit.html
- Install the Cg toolkit and set up a working Cg Programming Environment
- Read the Cg User Manual which comes with the Cg toolkit
- Download the Tutorial Examples that come with the book, Cg Tutorial at http://developer.nvidia.com/object/cg_tutorial_software.html
- After installing the Cg Tutorial Examples, you can fire up the tutorial framework by typing:
C:\Program Files\NVIDIA Corporation\Cg Tutorial Examples\Bin\CgTutorial.exe- Go through the tutorial examples
- Also go through some of the Cg tutorials and examples provided with the Cg Toolkit, or on other Cg resources on the web such as www.cgshaders.org, etc.
- Setting up MS Visual Studio to work with Cg (by setting the include and lib directories)
- How to work with Cg shaders from OpenGL/GLUT programs programs
- Understanding the basic structure of Cg vertex and fragment shaders
- Writing your own shader
Project Write up
Please print and read the following project write up which explains the requirements for the project. Links mentioned in the write-up are shown below.Useful Links for this Project
- The Cg Toolkit at Nvidia
- Cg Tutorial Examples at Nvidia
- Cg in Two Pages by Mark Kilgard
- Slides for Cg Introductory Workshop at Nvidia
- Surface Reflection Models by Frank Losasso of Nvidia
- Code and VC++ project for PlyLoader
- Information about Ply file format by Paul Bourke in Swindon, Australia
- Morgan McGuire guide to Cg 1.1 at graphics3d.com (Beware: a little old)
- Cg Setup (Lesson 47 at nehe.gamedev.net)