CS 457 / 557 -- Computer Graphics Shaders

Winter Quarter 2019


Classes Projects Handouts Grades VHR Piazza

This page was last updated: December 13, 2018

Under Construction:
This content is not final until you see this message go away!

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


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 also a place to get access to the OpenGL Shading Language (GLSL), although you probably have it if you've bought a good graphics card in the last 3-4 years.

Access to the CGEL is by the card-reader 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 ModelOpenGLDirectXSupporting
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, 419/553, or 554 are acceptable preparation. CS 491 is adequate preparation if you looked at and understood the graphics programs we used.

It will be really helpful if you have some GLSL shader experience, perhaps from CS 450/550.

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 surface, displacement, vertex, fragment, geometry, tessellation, and compute shaders fit into the graphics pipeline
  4. Describe the difference between uniform, 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 and 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:

    or, anytime my office door is open
    or, by appointment -- send email


The TA for this course is Braxton Cuneo. We are fortunate to have him!

Braxton's Office Hours

Braxton Cuneo Prof. Bailey
cuneob@oregonstate.edu mjb@cs.oregonstate.edu
CGEL (Batcheller 244) Kelley 2117

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", but chained to a bookshelf is a tough way to read a book.

A Third Edition of this book will be coming out in the summer of 2018.

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


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
Morphing 1pp 2pp 4pp
Noise 1pp 2pp 4pp 6pp
Noise With Glman PDF      
Timer 1pp 2pp 4pp 6pp
Dome Projection 1pp 2pp   6pp
Hyperbolic Geometry 1pp 2pp   6pp
Cube Mapping 1pp 2pp 4pp 6pp
Lighting 1pp 2pp 4pp 6pp
Bump 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
Scientific Visualization using Shaders 1pp 2pp 4pp 6pp
Compute Shaders 1pp 2pp 4pp 6pp
Vulkan 1pp 2pp 4pp 6pp
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 4-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 Wenniger 153.

  Date Topics
1 Jan 7 Introductions. General course information. Project #1.
The graphics pipeline -- how it really works.
Homogeneous coordinates.
Coordinate systems: Model, World, Eye, NDC, Clip, Screen.
2 Jan 9 Introduction to the OpenGL Shading Language (GLSL)
Attribute, Uniform, and Varying variables GLSL built-in functions and variables
Vertex shaders
3 Jan 11 Grab the file Jan11.zip and unzip it into its own folder.
Stripes in model vs. world coordinates
The smoothstep( ) function
Z-buffer pollution
4 Jan 14 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 16 More noise.
6 Jan 18 Prof. Bailey out of the office -- no class today -- sorry.
7 Jan 21 Martin Luther King holiday -- no class today
8 Jan 23 Noise stripes
9 Jan 25 More fun with vertex shaders: Dome projection,
10 Jan 28 More fun with vertex shaders: Hyperbolic geometry. Fragment Shaders, I
11 Jan 30 Fragment Shaders, II
Groundhogs Day is in 3 days!
12 Feb 1 Cube mapping. Reflection, Refraction.
13 Feb 4 Test #1 review.
Cube mapping, continued.
14 Feb 6 Bump mapping, I
15 Feb 8 Test #1
16 Feb 11 Discuss the Final Project.
Image Manipulation, I
Don't forget that Valentine's Day is in three days!
17 Feb 13 Go over test answers
Image Manipulation, II
Don't forget that Valentine's Day is tomorrow!
18 Feb 15 The optics of rainbows
The optics of diffraction
The optics of lenses
19 Feb 18 Geometry Shaders, I
20 Feb 20 Geometry Shaders, II
The Winter Quarter Career Fair is today!
21 Feb 22 Written Final Project proposals due
Finish Geometry Shaders
22 Feb 25 The GLSL API. The glslprogram C++ class.
23 Feb 27 Tessellation shaders, I
24 March 1 Tessellation shaders, II
25 March 4 Scientific Visualization using shaders
26 March 6 Scientific Visualization using shaders
27 March 8 Compute Shaders
Click here to see the Compute Shader particle system from the class notes.
28 March 11 Compute Shaders
29 March 13 Class Evaluations
Test #2 review.
More Information
30 March 15 Help session. Review session.
* March 22 Test #2 ?????, March ?, ??? - ???.
You can confirm this for yourself by going here.


Project # Points Title Due Date
1 60 Sharp and smooth-edged Elliptical Dots January 18
2 100 Noisy Elliptical Dots January 28
3 100 Displacement Mapping, Bump Mapping, and Lighting February 6
4 100 Image Manipulation in a Magic Lens February 19
5 60 Pig Poster February 26
6 100 The Lego™ Project March 11
557 Paper 100 Paper Project (for those in CS 557) March 19, 23:59:59, no BDs
FP 100 Final Project March 21, 23:59:59, no BDs

Project Turn-In Procedures

Life Events

As {John Lennon? Allen Saunders?} has said: "Life is what happens to you while you're busy making other plans". We 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.

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.

Click here to get a copy of the Bonus Day Submission Form. Fill this out and turn it in within a week after turning in your project.


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 7 projects, 10 quizzes, and two tests. You get to keep all the points you earn.

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

Points Grade
1050 A- 
1030 B+
990 B- 
970 C+
930 C- 
910 D+
870 D- 

Notice that this grade scale is not 90%-80%-70%-60%. That is because I 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

The bvrman executable is not included here because it looks for a local copy of RenderMan in order to work. Unless you have RenderMan installed on your own computer, you will need to do the RenderMan work in the CGEL.

You might also need these dlls:

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

Class Rules

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 elig ible 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.

Other Useful Online Graphics and Shader Information