
README for cg_bumpdemo source code distribution
-----------------------------------------------

This source code distribution is to accompany the article "A Follow-up
Cg Runtime Tutorial for Readers of The Cg Tutorial" by Mark J. Kilgard
(mjk@nvidia.com).

You have permission to modify and redistribute this source code
distribution for non-commercial or educational use.  These files are
provided without guarantee or warrantee expressed or implied.

If you find this article and accompany source code useful, please purchase
a copy of The Cg Tutorial (ISBN 0-321-19496-9) by Randima Fernando and
Mark Kilgard.  More information about the book can be found here:

  http://developer.nvidia.com/object/cg_tutorial_home.html

To compile this code, please obtain the latest version of the Cg Toolkit
from http://developer.nvidia.com/object/cg_toolkit.html

Please find the following files in this directory:

  cg_bumpdemo.c     -- the main source program

  C8E4f_specSurf.cg -- Cg fragment program for specular and diffuse
                       texture-space bump mapping

  C8E6v_torus.cg    -- Cg vertex program 

  brick_image.h     -- data for a brick normal map texture (#include'd by
                       cg_bumpdemo.c)
  
  norm_cm.c         -- data for a 32x32 normalization cube map
                       (#include'd by cg_bumpdemo.c)

  Makefile          -- a hand-written Visual C Makefile

  cg_bumpdemo.dsp   -- a Visual C 6 project file

  cg_bumpdemo.dsw   -- a Visual C 6 workspace file

  cg_bumpdemo.mak   -- an exported Visual C 6 Makefile file

  GL/glut.h         -- GLUT 3.7 header file

  glut32.lib        -- pre-compiled Windows GLUT link library (.LIB)

  glut32.DLL        -- pre-compiled Windows GLUT dynamic link library
                       (.DLL)

  README.txt        -- this file

Windows users can open the cg_bumpdemo.dsw workspace (Visual.NET users
will need to convert the workspace).  You can also use the included
Makefile for command line compiles.

This distribution is designed to compile for Windows but Linux users
should find it easy to compile the code as well.  Assuming you have
OpenGL, Cg, and GLUT installed, use a compile command like this:

  gcc -o cg_bumpdemo cg_bumpdemo.c -I. -lCg -lCgGL -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm

It may help to add the following options:

  -L/usr/X11R6/lib
  -I/usr/X11R6/include
  -lpthread

Play safe.  Make good choices.

- Mark J. Kilgard
  April 21, 2005
