GLSL shaders
In class design problems
Notes from our in class design problems. I've tried to incorporate my
own as well as student design solutions.
Schedule
Project submission specifications .
Examples
To avoid any misunderstanding by anyone (aka a student in one of my
classes), the following disclaimer has been patterned from a Microsoft
web page and is applied to code found herein or on any of Professor
Barnes' web pages.
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THESE WEB PAGES IS AT
YOUR OWN RISK.
Professor Barnes provides this code "as is" without
warranty of any kind, either express or implied, including but not
limited to the implied warranties of merchantability and/or fitness
for a particular purpose.
Professor Barnes will not be held responsible for any inaccuracies,
bugs, documented or undocumented, in the sample code below.
SHOULD YOU WISH TO USE THESE EXAMPLES FOR COURSEWORK, YOU ARE DOING SO
AT YOUR OWN RISK.
Professor Barnes will not grant extra credit, time, debugging time, or
anything else should you find a bug in the code;
I may say, "Thanks for pointing that out!".
- Compiling your first OpenGL program, "cube"
- Menu example for shapes and colors
menuGlut.cpp
- Arguments to glutWireTorus example
torus.cpp.
- Using transforms to size, orient, and place objects
manyCubes.cpp.
- Animation of 3 torii and displaying of text on screen
- Color, material and lights
colorMaterial.cpp.
- C++ and GLUT spot light demo spot.cpp :
sphere tesselation, shading, and spot light. Modified from
example in Ch 5 pp 212 - 222 SuperBible 4th edition.
- Using matrices in OpenGL
- Hierarchical Modelling with matrices, E. Angel's
figuretree.c
- Getting values from OpenGL matrices
matrixInfo.cpp
- Watching values in an object's translation and rotation
matrices as the object rotates on an orbit.
rotateInfo.cpp
- A class object's with a local reference frame (matrix)
matrixOps.cpp
- Applying transforms after setting gluLookAt() and before
transformLookAt.cpp
- Applying transforms and rotations to change the view
viewMatrix.cpp
- Projection matrices equivalence: glFrustum(...) and gluPerspective(...)
glFrustum.cpp.
- Shadows in OpenGL with projection
shadowShape.cpp.
- Picking and selection buffer example
pickExample.cpp
Uses both ortho and pespective projection for selection.
Uses wireframe to visually show the selected sphere.
- There are several texture related examples in the
images examples directory .
- Example program that loads and display a *.raw texture
rawTexture.cpp .
You also need to save the texture
therapist.raw .
(it will not open in a browser).
- Bitmap and image examples from SuperBible V4.
I've included an edited (reduced) version of SuperBible's
gltools.h and gltools.cpp as SuperBibleGLTools.cpp.
Examples: bitmap.cpp, tgaImage.cpp, and stonePyramid.
- You need texture file Fire.tga for tgaImage.cpp example.
- You need texture file stone.tga for stonePyramid.cpp example.
Example stonePyramid illustrates loss of geometry color when
textures are not enabled/disabled (press F1 to see effect).
- Blending example source file:
waterBlend.cpp
Press F1 (sand), F2 (sand + water), F3 (sand + light), F4 (all)
image files:
Resources
- OpenGL installations
SDKs from opengl.org
- GLUT
- For GLSL shading language development install
GLee
- C++ for Java programmers
- GLUT
on-line documenation .
- OpenGL
- OpenGL Programming Guide: The official Guide to Learning OpenGL,
Version 2 (5th edition), D. Shreiner, M. Woo, J. Neider, T. Davis,
Addison Wesley, 2005 -- the "redbook".
version 1 is on-line at:
glprogramming.com ,
or,
site 2 ,
and
source for all examples (v1.1)
- Interactive Computer Graphics: A Top Down Approach Using OpenGL
E. Angel, 2009,
example programs.
- OpenGL: A Primer 2nd edition, E. Angel, 2004,
tion, Addison Wesley,
example programs
- OpenGL: SuperBible 4th edition, R. S. Wright, B. Lipchak,
N. Haemel, Addison-Wesley, 2007,
example programs
- Nate Robin's
OpenGL tutors a zipped file. These are the demos I've been
using in class.
- NeHe Productions,
OpenGL tutorials
- Mark Kilgard's
OpenGL pitfalls.
- An OpenGL
light / material
tutorial (a windows exe file).
- Paul Rademacher's
GLUI User Interface Library, and
manual.
- Java OpenGL bindings
- C# OpenGL bindings
CsGL .
Be sure to read the FAQ on how to install/deploy.
- Game Developer Associations
- Kinetics, Simulation
- D.M. Bourg, Physics for Game Programmers, O'Reilly, 2002.
- E. Lengyel, Mathematics for 3D Game Programming and Computer Graphics,
Charles River, 2002.
- P. J. Schneider, D.H. Eberly, Geometric Tools for Computer Graphics,
Morgan Kaufmann, 2003.
- Algorithmic Modeling of objects and behavior
- Laurens Lapre's L system parser
LParser2.
Original
Lparser and links to other L Systems
- Craig Reynold's
Boids
algorithms for flocking behavior and links to related work.
- G. W. Flake, Computer Explorations of Fractals, Chaos,
Complex Systems, and Adaptation, MIT, 2000.
- P. Martz,
Generating Random Fractal Terrain
- H.C. Sun, D.N. Metaxas,
Automating Gait Animation
- Nvidia,
Procedural Tree demo -- zipped file.
- P Prusinkiewicz,
Algorithmic Botany .
Plants, L-Studio
- M. Walter, et.al,
Integrating Shape and Pattern in Mammalian Models
- Y. Parish, et.al,
Procedural Modeling of Cities
- SDKs, Related sites, books, miscellaneous
- SDL -- game engine
Sound library works well w/ OpenGL.
-
VTK -- Visualization ToolKit
- D. Bourg, AI for Game Developers, O'Reilly, 2004.
- M. Buckland, Programming Game AI by Example, Wordware, 2005.
Game AI tutorials
AI junkie
-
Digital Game Developer discussion, resources.
- D. Luebke, M. Reddy, J.D. Cohen, A. Varshney, B. Watson, R. Huebner,
Level of Detail for 3D Graphics, Morgan Kaufmann, 2003.
- K. Brilliant, Building a digital human,
Charles River Media, 2003.