CS 457 / 557 -- Computer Graphics Shaders

Winter Quarter 2020


Classes Projects Handouts Grades VHR Piazza

This page was last updated: March 20, 2020

"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! While I am in no way trying to contribute to panic, I do want all of you to have ready-access to the latest information:

I have also taken precautions like having tissues, wipes, and sanitizer available for you anytime you come into my office, and there are now tissues and wipes in the CGEL so you can wipe down the keyboards and mice. (The CGEL will also have sanitizer as soon as I can actually find some more.)

Benny Beaver's advice.


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.

You will have access to the graphics systems in OSU's Computer Graphics Education Lab (CGEL) in Batcheller Hall 244. It is a place to get access to the OpenGL Shading Language (GLSL), although you probably already have it if you've bought a good graphics card in the last 5 years.

Access to the CGEL is by the RFID chip in your OSU ID. I will be submitting a class roster to EECS so that you can all be enabled.

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.


You should come in having some graphics programming experience. This is not a good time to learn computer graphics and OpenGL for the first time.

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

Learning Objectives

On completion of the course, students will have demonstrated the ability to:

  1. Describe the difference between Model Coordinates, World Coordinates, Eye Coordinates, Clip Coordinates, Normalized Device Coordinates, and Screen Coordinates.
  2. Describe the ModelView and Projection matrices, and what operations belong in each, and why.
  3. Describe where vertex, fragment, geometry, tessellation, and compute shaders fit into the graphics pipeline
  4. Describe the difference between uniform, out/in (varying), and attribute variables.
  5. Apply the concept of octave noise to shader effects.
  6. Describe the difference between bump-mapping and displacement-mapping.
  7. Demontrate how to use cube mapping to achieve a good approximation to reflection and refraction. Explain what is different about reflection and refraction done this way versus real reflection and refraction.
  8. Apply shaders to visualization problems
  9. Use textures in shaders for image processing.
  10. Demonstrate how to avoid the aliasing effects of sharp transitions.
  11. Demonstrate how shaders can be used to simulate various optics effects.


The class is being taught by Professor Mike Bailey.

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

Prof. Bailey's Office Hours:

Mondays 1:00 - 3:00 Kelley 2117
Tuesdays 10:00 - 12:00 Kelley 2117
Wednesdays 1:00 - 3:00 Kelley 2117
Fridays 1:00 - 3:00 Kelley 2117
    or, anytime my office door is open
    or, by appointment -- send email


The TAs for this course are Jian Tang and Yeajin Kim.

Office Hours

  Yeajin Kim Jian Tang Prof. Bailey
  kimyea@oregonstate.edu tangjian@oregonstate.edu . mjb@cs.oregonstate.edu
Mondays   12:00 - 5:00 (CGEL) 1:00 - 3:00 (office)
Tuesdays 1:00 - 2:00 (Kelley atrium) 1:00 - 5:00 (CGEL) 10:00 - 12:00 (office)
Wednesdays 2:00 - 4:00 (Kelley atrium)   1:00 - 3:00 (office)
Thursdays 2:00 - 4:00 (Kelley atrium)    
Fridays 1:00 - 2:00 (Kelley atrium) 12:00 - 3:00 (CGEL) 1:00 - 3:00 (office)

The Virtual Hand Raise (VHR)

It takes courage to ask a question in class. But, the worst thing of all is to not ask! So, this class also has the Virtual Hand Raise. Click here to get into it. It will allow you to send me a question or comment, completely anonymously. I will answer questions submitted this way by email to the class or in class.

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".


History of Shaders 1pp 2pp 4pp 6pp
Graphics Pipeline 1pp 2pp 4pp 6pp
Homogeneous Coordinates 1pp 2pp 4pp 6pp
Shaders Notes from CS 450/550 1pp 2pp 4pp 6pp
Glman Documentation PDF      
Stripes, Rings, and Dots 1pp 2pp 4pp 6pp
Mixing 1pp 2pp 4pp 6pp
Texturing 1pp 2pp 4pp 6pp
Morphing 1pp 2pp 4pp 6pp
Noise 1pp 2pp 4pp 6pp
Noise With Glman PDF      
Lighting 1pp 2pp 4pp 6pp
Bump Mapping 1pp 2pp 4pp 6pp
Timer 1pp 2pp 4pp 6pp
Dome Projection 1pp 2pp 4pp 6pp
Hyperbolic Geometry 1pp 2pp 4pp 6pp
Cube Mapping 1pp 2pp 4pp 6pp
Image Manipulation 1pp 2pp 4pp 6pp
Spectral Effects 1pp 2pp 4pp 6pp
Lens Effects 1pp 2pp 4pp 6pp
Geometry Shaders 1pp 2pp 4pp 6pp
Tessellation Shaders 1pp 2pp 4pp 6pp
GLSL API 1pp 2pp 4pp 6pp
The Science of Pixar 1pp 2pp 4pp 6pp
Scientific Visualization using Shaders 1pp 2pp 4pp 6pp
Compute Shaders 1pp 2pp 4pp 6pp
Advanced Bump Mapping: Surface Local Coordinates 1pp 2pp 4pp 6pp
Advanced Bump Mapping: Parallax Mapping 1pp 2pp 4pp 6pp
Algorithmic Art 1pp 2pp 4pp 6pp
Disco-ball Lighting 1pp 2pp 4pp 6pp
Vulkan and its GLSL Shaders 1pp 2pp 4pp 6pp
More Information PDF      
Creating a Video Demo of a Graphics Project 1pp 2pp 4pp 6pp

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

Class Schedule

To see an Academic Year calendar, click here.

Class time is: Monday, Wednesday, and Friday, 10:00 - 10:50.

Unless otherwise specified, all of our classes will be in Withycombe Hall 109.
Note the change!

No class on: January 20, January 24

  Date Topics
1 Jan 6 Introductions. General course information.
History of Shaders
The graphics pipeline -- how it really works.
Homogeneous coordinates.
Coordinate systems: Model, World, Eye, NDC, Clip, Screen.
2 Jan 8 Grab the file Jan08.zip and unzip it into its own folder.
Introduction to the OpenGL Shading Language (GLSL)
Attribute, Uniform, and Varying variables GLSL built-in functions and variables
Vertex shaders
3 Jan 10 Stripes in model vs. world coordinates
The smoothstep( ) function
Z-buffer pollution
4 Jan 13 Geometry Morphing
GLSL Textures: unsigned byte, floating point, 2D, 3D, parameters, binding, texture units, multitextures, sampler functions
Noise: Positional, Gradient. Cubic and quintic interpolation. Fractional Brownian Motion (FBM, 1/f), turbulence.
glman Noise
5 Jan 15 More noise.
6 Jan 17 Lighting
Bump mapping, I
7 Jan 20 Martin Luther King holiday -- no class today
8 Jan 22 Bump Mapping, II
9 Jan 24 Prof. Bailey out of the office -- no class today -- sorry.
10 Jan 27 Cube mapping, I: Reflection, Refraction.
11 Jan 29 Cube mapping, II: Reflection, Refraction.
More fun with vertex shaders: Dome projection, Hyperbolic geometry.
12 Jan 31 Groundhog Day and the Super Bowl are in 2 days!
The registration for the EECS Networking Night opens tomorrow. Do it right away to get the companies you most want to see!
Image Manipulation
13 Feb 3 Test #1 review.
Image Manipulation
14 Feb 5 Optional Review Session in Kelley 2114. Come ask questions about the test, projects, or anything. Feel free to come lurk.
15 Feb 7 Test #1
16 Feb 10 Go over test answers
Discuss the Final Project.
Image Manipulation: Render to Texture
17 Feb 12 The optics of rainbows
The optics of diffraction
Don't forget that Valentine's Day is in 2 days!
18 Feb 14 Happy Valentine's Day!
The optics of lenses
19 Feb 17 Geometry Shaders, I
The EECS Networking Night is tomorrow night.
20 Feb 19 Written Final Project proposals due
Geometry Shaders
The Career Fair is today, 11:00-4:00.
21 Feb 21 The GLSL API.
The glslprogram C++ class.
Tessellation shaders, I
22 Feb 24 Tessellation shaders, II
Scientific Visualization using shaders
23 Feb 26 Scientific Visualization using shaders
24 Feb 28 Compute Shaders
Click here to see the Compute Shader particle system from the class notes.
25 March 2 Advanced Bump Mapping: Surface Local Coordinates
26 March 4 Advanced Bump Mapping: Parallax Mapping
27 March 6 Algorithmic Art
Disco-ball Lighting
28 March 9 Vulkan and its GLSL Shaders
29 March 11 Class Evaluations
Test #2 review.
More Information
30 March 13 Optional Review Session in Kelley 2114. Come ask questions about the test, projects, or anything. Feel free to come lurk.
* March 17 Test #2 Tuesday, March 17, 9:30 - 11:00
You can confirm this for yourself by going here.


Project # Points Title Due Date
1 60 Step- and Blended-edged Elliptical Dots January 15
2 100 Noisy Elliptical Dots January 22
3 100 Displacement Mapping, Bump Mapping, and Lighting January 31
4 100 Cube Mapping Reflective and Refractive Bump-mapped Surfaces February 11
5 100 Image Manipulation in a "Magic Lens" February 18
6 60 The Rat Menagerie February 25
7 100 Geometry Shaders March 6
557 Paper 100 Paper Project (for those in CS 557) March 16, 23:59:59, no BDs
FP 100 Final Project March 16, 23:59:59, no BDs

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.


Grades will be posted through this web page. To protect your privacy, they will be posted by your alias that you give me in Project #1.

Click here to see the current grade posting.

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

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

... with the exception of Week #0:

Quiz #0 is due to me by 4:00 PM on Friday, January 10. Fortunately, it is not too hard:

  1. Get a 3"x5" index card (I'll give you one the first day of class).
  2. Print your name neatly at the top (holding the card horizontally).
  3. Print the course number you are taking this under (CS 457 or CS 557) neatly next to your name.
  4. Also, printing neatly, tell me why you are taking this class. What do you hope to get out of being here?
  5. Be honest -- no sucking up!
  6. Get the card back to me in class or in my office.

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

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

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

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


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.dll
  4. libcid.dll
  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 Useful Online Graphics and Shader Information