Cg-shaders is a project mainly written in C++ and C, it's free.
Old Cg Shader Experiments.
COMP 5900
Mykola Konyk, [email protected]
Hello!
Here's my implementation of Assignment 3.
Project is built using
I've tested it on Nvidia Cg 2.0 and 2.1. Project contains an xcode project, as well as a makefile, which should work on mac, linux and cygwin, providing that OpenGL, GLUT and CG libraries are installed.
I am not sure about compiling the code on Windows, but you might need to change paths to Cg/GL/Glut in Globals.h file (which is included in the project).
It's possible to switch between rendering modes by using number keys (1..7), keys (q, w) and right mouse button - this brings up the menu. Moving mouse while holding left mouse button will rotate the object (scene).
All GUI (GLUT) code is contained in GlutApplication.h/cpp RenderTexture.h/cpp contains basic implementation of render texture, using FBOs CgShader.h/cpp - base class for all shaders in this application CgShaderNormal.h/cpp - shader used for rendering normal buffer CgShaderPhong.h/cpp - shader used for rendering phong lightning model CgShaderCel.h/cpp - shader used for rendering cel shading, with or without object-space outline CgShaderOutline.h/cpp - shader used for rendering outline (from depth - buffer) CgShaderCelScreen.h/cpp - shader used for rendering cel with screen-space outline (merges CgShaderCel and CgShaderOutline results)
All shader code is loaded from c++ code (using strings instead of loading from external cg files).