CS 457 / 557 -- Computer Graphics Shaders

Winter Quarter 2021


Resources Page

Projects Handouts Piazza PB Zoom

This page was last updated: March 14, 2021

"Don't wake me for the end of the world unless it has very good special effects."
-- Roger Zelazny (science fiction writer)

Coronavirus Information

Your well-being is our #1 concern! I want all of you to have ready-access to the latest information:

Stuff You Should Be Interested In:

What We Will Be Doing

The goals of this course are to leave you "career-ready" (i.e., both work-ready and research-ready) for tasks that require the implementation of graphics algorithms in the form of shaders.

CS 457/557 topics include:

Graphics Card Levels

If you are wondering what types of shaders your own graphics card supports, check this table. You can tell what shaders the card supports by looking at the Shader Model (or Shader Level) or what DirectX / OpenGL version it supports:
Shader ModelOpenGLDirectXSupports
3.02.x9Vertex, Fragment
5.04.x11Tessellation, Compute

We will cover all of these different types of shaders.


While you don't exactly need previous 3D graphics programming experience to take this course, we are going to jump into shader topics as if you have it.

CS 450/550, 453/553, or 554 are good preparation. CS 491 is adequate preparation if you looked at and understood the graphics programs that were supplied to you.

If you don't have any of these under your belt, I suggest that you look over the CS 450/550 class notes, which can be found here.


The class is being taught by Professor Mike Bailey.

Office: Kelley 2117 (2nd floor, south side)
Phone: 541-737-2542
Email: mjb@cs.oregonstate.edu

Prof. Bailey's Office Hours:

Mondays 8:00 - 9:00, 12:00 - 2:00
Wednesdays 8:00 - 9:00, 12:00 - 2:00
Thursdays 10:00 - 12:00
  or, by appointment -- send email


The TAs for this course are: Braxton Cuneo and Josiah Blaisdell. Both have a huge amount of computer graphics experience. We are lucky to have them!

Total Office Hours

  Josiah Blaisdell Braxton Cuneo Prof. Bailey
Email blaisdjo@oregonstate.edu cuneob@oregonstate.edu mjb@cs.oregonstate.edu
Zoom-room Zoom Zoom Zoom
Mondays 7:50 - 9:50 (AM)   8:00-9:00 (AM), 12:00-2:00
Tuesdays 7:50 - 9:50 (AM) 11:00 - 2:00  
Wednesdays 7:50 - 9:50 (AM)   8:00-9:00 (AM), 12:00-2:00
Thursdays 7:50 - 9:50 (AM) 11:00-2:00 10:00-12:00
Fridays 7:50 - 9:50 (AM)    
Saturdays 8:00 - 10:00 (AM)    

  8:00 9:00 10:00 11:00 12:00 1:00 2:00 3:00 4:00 5:00
Mondays PB, JB JB LL LL PB PB        
Tuesdays JB JB   BC BC BC        
Wednesdays PB, JB JB LL LL PB PB    
Thursdays JB JB PB PB, BC BC BC        
Fridays JB JB              
Saturdays JB JB              
PB = Prof. Bailey
JB = Josiah Blaisdell
BC = Braxton Cuneo
LL = Live Lectures
The links point to the Zoom-Rooms.

Optional Textbook

This book was written based on the Oregon State University shaders class notes.

Bailey and Cunningham, Graphics Shaders: Theory and Practice, Second Edition, CRC Press, 2012. ISBN: 978-1-56881-434-6.

You are not required to get it. However, it has more detailed information than the course notes do.

If you want it, it is available through Amazon, or through CRC Press.

There is one in the CGEL "library". It is chained to the bookshelf.

Other course material will consist of printable notes, web pages, and notes taken in class.

Other Good References

The Shreiner and Upstill books are in the "CGEL Library".

Handouts and Recorded Videos

LV = Lecture Video ; DV = Demo Video
Introduction to CS 457/557 1pp 2pp 4pp 6pp LV      
Navigating our Class Resources Page HTML       LV      
Project Notes for CS 457/557 1pp 2pp 4pp 6pp LV      
History of Shaders 1pp 2pp 4pp 6pp LV      
Homogeneous Coordinates 1pp 2pp 4pp 6pp LV      
Shaders Notes from CS 450/550 1pp 2pp 4pp 6pp LV      
Model vs. Eye/World Coordinates               DV
GLSL API 1pp 2pp 4pp 6pp LV      
Glman PDF             DV
Mixing 1pp 2pp 4pp 6pp LV      
Stripes, Rings, and Dots 1pp 2pp 4pp 6pp LV-1 LV-2   DV
Lighting 1pp 2pp 4pp 6pp LV      
Texturing in GLSL 1pp 2pp 4pp 6pp LV     DV
Noise 1pp 2pp 4pp 6pp LV-1 LV-2 LV-3 DV
Dome Projection 1pp 2pp 4pp 6pp LV     DV
Hyperbolic Geometry 1pp 2pp 4pp 6pp LV     DV
Morphing 1pp 2pp 4pp 6pp LV     DV
Timer 1pp 2pp 4pp 6pp LV      
Bump Mapping 1pp 2pp 4pp 6pp LV-1 LV-2   DV
Bump Mapping with Surface Local Coordinates 1pp 2pp 4pp 6pp LV     DV
Normal-Mapping 1pp 2pp 4pp 6pp LV     DV
Cube Mapping 1pp 2pp 4pp 6pp LV     DV
Image Manipulation 1pp 2pp 4pp 6pp LV     DV
Red-Cyan Stereographics 1pp 2pp 4pp 6pp LV     DV
Render-to-Texture 1pp 2pp 4pp 6pp LV     DV
Test #1 Review       LV      
GLM 1pp 2pp 4pp 6pp LV      
Shadows 1pp 2pp 4pp 6pp LV     DV
Spectral Effects 1pp 2pp 4pp 6pp LV     DV
Lens Effects 1pp 2pp 4pp 6pp LV     DV
The Science of Pixar 1pp 2pp 4pp 6pp LV      
Geometry Shaders 1pp 2pp 4pp 6pp LV-1 LV-2   DV
Scientific Visualization using Shaders 1pp 2pp 4pp 6pp LV-1 LV-2 LV-3 DV
The SuperQuad 1pp 2pp 4pp 6pp LV     DV
Tessellation Shaders 1pp 2pp 4pp 6pp LV-1 LV-2   DV
Compute Shaders 1pp 2pp 4pp 6pp LV     DV
Introduction to Vulkan 1pp 2pp 4pp 6pp LV      
Vulkan GLSL 1pp 2pp 4pp 6pp LV      
Algorithmic Art 1pp 2pp 4pp 6pp LV     DV
Intro to RenderMan for GLSLers 1pp 2pp 4pp 6pp LV      
Disco-ball Lighting 1pp 2pp 4pp 6pp LV     DV
More Information PDF       LV      
Test #2 Review       LV      
Creating a Video Demo of a Graphics Project 1pp 2pp 4pp 6pp        

Live Lectures

Every Monday and Wednesday, starting at 10:00, I will be hosting Live Lectures. We will go over some current materials, some upcoming materials, and maybe some extra materials (such as shader demos). It will be a time for you to also ask live questions. Attendance at the live session is optional, but the material we cover there is eligible to be on quizzes and tests. These sessions will be recorded (see below) in case you missed them.

Here is my Zoom-room.
If you need a passcode, use ZeldaDog

Week #DayChatVideoExtra Notes
4WednesdayPDFLV Sorry, I started the recording a little late
9WednesdayPDFLV So excited about the Cat Highlights, didn't hit the Record soon enough


LV = Lecture Video
DV = Demo Video

Project # Points Title Due Date Lecture Video Demo Video
1 60 Step- and Blended-edged Elliptical Dots January 15 LV DV
2 100 Noisy Elliptical Dots January 20 LV DV
3 100 Displacement Mapping, Bump Mapping, and Lighting January 27 LV DV
4 100 Cube Mapping Reflective and Refractive Bump-mapped Surfaces February 9 LV DV
5 100 Image Manipulation February 16
February 18
FP Proposal 5 Final Project Proposal February 17, 23:59:59, no BDs LV  
6 60 The Cat Menagerie February 23
February 25
7 100 Geometry Shaders: The Lego™ Project March 4 LV DV
557 Paper 100 Paper Project (for those in CS 557) March 16, 23:59:59, no BDs LV  
FP 95 Final Project March 16, 23:59:59, no BDs LV  

Project Turn-In Procedures

Bonus Days and Late Assignments

Projects are due at 23:59:59 on the listed due date, with the following exception:

Each of you has been granted 5 Bonus Days, which are no-questions-asked one-day extensions which may be applied to any project, subject to the following rules:

  1. No more than 2 Bonus Days may be applied to any one project
  2. Bonus Days cannot be applied to tests
  3. Bonus Days cannot be applied such that they extend a project due date past the start of Test #2.

If you turn in a project 3 or more days late, the score is a zero.

If you turn in a project late and don't have enough Bonus Days left to spend on it, the score is a zero.

You don't need to ask me or even tell me that you are using Bonus Days. Just turn your project in late. I have a script that will check your turn-in date and deduct the Bonus Days.


Your scores will be posted on Canvas

CS 557 will be graded on a fill-the-bucket basis. There will be 8 programming projects, 11 quizzes, and two tests. You get to keep all the points you earn.

Those taking the class as CS 557 will also do a 100-point essay summarizing a research paper. (Those taking the class as CS 457 will get a free 100 points for this assignment.)

The quizzes will be done via Canvas. They will open each Friday at 12:01 PM and will close Sunday night at 23:59. Canvas is very unforgiving about due times -- don't push it.

... with the exception of Week #0:

Quiz #0 opens Monday, January 4 at 12:01 AM and is due to me by 4:00 PM on Friday, January 8. Fortunately, it is not too hard: All you need to do is go to Quiz #0 on Canvas and, in the space provided, tell me why you are taking this class. What do you hope to get out of being here? Be honest -- no sucking up!

Your final grade will be based on your overall class point total. Based on an available point total of 1130, grade cutoffs will be no higher than:

Points Grade
1060 A- 
1040 B+
1000 B- 
980 C+
940 C- 
920 D+
880 D- 

Notice that this grade scale is not 90%-80%-70%-60%. That is because I just do a soft grade on the projects.

Downloadable Files

Here is a folder with some of my favorite OBJ files.

Opening up the Sample2019.zip or SampleLinux.tar file will produce a folder full of all the other files you need. You do not need to go hunt the internet for any other files. Use the ones that have been given to you.

Windows Visual Studio 2019 Sample Program Sample2019.zip Un-zip and double-click on the .sln file, then select Build→Clean Solution, then select Build→Build Sample, then select Debug→Start Without Debugging
Linux Sample Program SampleLinux.tar Un-tar (tar xvf SampleLinux.tar), then cd SampleLinux, then make sample, then ./sample
Windows Visual Studio 2019 Sample Shaders Program ShaderIntro2019.zip Un-zip and double-click on the .sln file, then select Build→Clean Solution, then select Build→Build Sample, then select Debug→Start Without Debugging
Windows Visual Studio 2019 Shadows Program Shadows2019.zip Un-zip and double-click on the .sln file, then select Build→Clean Solution, then select Build→Build Sample, then select Debug→Start Without Debugging
Windows Visual Studio 2019 Vertex Buffer Object sample Program VBO.zip Un-zip and double-click on the .sln file, then select Build→Clean Solution, then select Build→Build Sample, then select Debug→Start Without Debugging
A color-picker program ColorPicker.exe  
Our own version of the sphere-drawing function osusphere.cpp  
C++ class to use GLSL shaders glslprogram.h, glslprogram.cpp  
Code to load an OBJ file loadobjfile.cpp  
glm Folder glm.zip Un-zip into your VS project folder
Keytime Animation C++ class keytime.h, keytime.cpp  
2D Noise Texture noise2d.064.tex  
3D Noise Texture noise3d.064.tex  
Kelley Engineering Center test image kec.bmp  
The find shader find.glib, find.vert, find.frag  
Shader code to produce the rainbow and heated-object color scales colorscales.txt
Mars Panoram MarsPanoram.zip  

If you want to load a .obj file as part of one of your projects, incorporate the file loadobjfile.cpp into your own code. I usually use this by placing the .obj object into a display list:

// a global variable:
GLuint DL;

. . .

// do this in InitGraphics( ):
DL = glGenLists( 1 );
glNewList( DL, GL_COMPILE );
LoadObjFile( "spaceship.obj" );
glEndList( );

. . .

// do this in Display( ):
glCallList( DL );

  1. OpenGL/GLSL-related files
  2. .obj files

  3. Want to use the Nvidia Lobby in a cube map? Here are the files:

  4. Want to use the Kelley Atrium in a cube map? Here are the files:

Downloadable Executables

These executables are all loaded on the CGEL machines, but you can also get them here in case you want to run them on other Windows machines.

  1. noisegraph.exe
  2. glman.exe

You might also need these dlls:

  1. glew32.dll
  2. glut32.dll
  3. libcd.lib
  4. libcid.lib
  5. msvcr71d.dll

Class Rules

Link to the Code of Student Conduct


Students With Disabilities

Accommodations for students with disabilities are determined and approved by Disability Access Services (DAS). If you, as a student, believe you are eligible for accommodations but have not obtained approval please contact DAS immediately at 541-737-4098 or at http://ds.oregonstate.edu. DAS notifies students and faculty members of approved academic accommodations and coordinates implementation of those accommodations. While not required, students and faculty members are encouraged to discuss details of the implementation of individual accommodations.

Religious Holidays

Oregon State University strives to respect all religious practices. If you have religious holidays that are in conflict with any of the requirements of this class, please see me immediately so that we can make alternative arrangements.

Life Events

As {John Lennon? Allen Saunders?} has said: "Life is what happens to you while you're busy making other plans". I care about you as a person. When life happens to you, send me an email and come see me. I might be able to help, I might not. But I surely can listen. You are not alone.

Reach Out for Success

University students encounter setbacks from time to time. If you encounter difficulties and need assistance, it's important to reach out. Consider discussing the situation with me or an academic advisor. Learn about resources that assist with wellness and academic success at http://oregonstate.edu/ReachOut. If you are in immediate crisis, please contact the Crisis Text Line by texting OREGON to 741-741 or call the National Suicide Prevention Lifeline at 1-800-273-TALK (8255)

Basic Needs

Any student who has difficulty affording groceries or accessing sufficient food to eat every day, or who lacks a safe and stable place to live, is urged to contact the Human Services Resource Center (HSRC) for support: hsrc@oregonstate.edu, 541-737-3747. The HSRC has a food pantry, a textbook lending program, and other resources to help. Furthermore, if you are comfortable doing so, please come talk with me. I will do everything I can do to help you.

University Housing & Dining Services has been piloting a meal program called Food for Thought. Using the extra food generated by campus dining locations, they create pre-packaged, balanced meal options available at no cost to Oregon State students who meet eligibility criteria determined by the Human Services Resource Center. For others, these packages are available for purchase at a reduced price.

Other Notes You Might Enjoy!

University Classes
Intro to Computer Graphics
Scientific Visualization
Parallel Programming
CS Skills for Simulation and Game Programming

Grades 2-12 Outreach

Other Useful Online Graphics and Shader Information