CS 457 / 557 -- Computer Graphics Shaders

Winter Quarter 2019

http://cs.oregonstate.edu/~mjb/cs557


Classes Projects Handouts Grades VHR Piazza


This page was last updated: February 13, 2019


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


Announcements:


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 ModelOpenGLDirectXSupports
3.02.x9Vertex, Fragment
4.03.x10Geometry
5.04.x11Tessellation, Compute

We will cover all of these different types of shaders.

Prerequisites

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 canned graphics programs we used.

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.

Professor

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 3:00 - 5:00 Kelley 2117
Wednesdays 1:00 - 3:00 CGEL (Bat 244)
Thursdays 12:30 - 2:30 Kelley 2117
    or, anytime my office door is open
    or, by appointment -- send email

TA

The TAs for this course are Braxton Cuneo and Wenbo Hou. We are fortunate to have them!

Office Hours

Braxton Cuneo Wenbo Hou Prof. Bailey
cuneob@oregonstate.edu houw@oregonstate.edu mjb@cs.oregonstate.edu
Mondays, 12:00 - 2:00, CGEL Mondays, 2:00 - 4:00, CGEL Mondays, 3:00 - 5:00, Kelley 2117
Tuesdays, 12:00 - 2:00, CGEL    
Wednesdays, 12:00 - 4:00, CGEL Wednesdays, 2:00 - 4:00, CGEL Wednesdays, 1:00 - 3:00, CGEL (Bat 244)
Thursdays, 12:00 - 2:00, CGEL   Thursdays, 12:30 - 2:30, Kelley 2117
Fridays, 12:00 - 2:00, CGEL Fridays, 2:00 - 4:00, CGEL  

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.

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

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      
Lighting 1pp 2pp 4pp 6pp
Bump Mapping 1pp 2pp 4pp 6pp
Timer 1pp 2pp 4pp 6pp
Dome Projection 1pp 2pp   6pp
Hyperbolic Geometry 1pp 2pp   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
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
Vulkan
Paraview

Grades 4-12 Outreach
Scratch
SketchUp
Blender
TinkerCad
Processing


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 Weniger 153.

Cancelled dates: January 18, January 21

  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 Grab the file Jan09.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
glman
Vertex shaders
3 Jan 11 Stripes in model vs. world coordinates
The smoothstep( ) function
Checkers
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 Lighting
Bump mapping, I
9 Jan 25 Bump Mapping, II
10 Jan 28 More fun with vertex shaders: Dome projection, Hyperbolic geometry.
11 Jan 30 Cube mapping, I: Reflection, Refraction.
12 Feb 1 Cube mapping, II: Reflection, Refraction.
Groundhog Day is tomorrow!
13 Feb 4 Test #1 review.
The registration for the EECS Networking Night opens tomorrow. Do it right away to get the companies you most want to see!
14 Feb 6 Optional Help Session. Come ask questions about the test, Project #4, or anything. Feel free to come lurk.
15 Feb 8 Test #1
16 Feb 11 Go over test answers
Discuss the Final Project.
Image Manipulation: Render to Texture
17 Feb 13 The optics of rainbows
The optics of diffraction
Don't forget that Valentine's Day is tomorrow!
18 Feb 15 The optics of lenses
19 Feb 18 Geometry Shaders, I
The EECS Networking Night is tomorrow night.
20 Feb 20 Geometry Shaders, II
The Winter Quarter Career Fair is today! You should go!
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
Vulkan
29 March 13 Class Evaluations
Test #2 review.
More Information
30 March 15 Help session. Review session.
* March 21 Test #2 Thursday, March 21, 12:00 - 1:30.
You can confirm this for yourself by going here.

Projects

Project # Points Title Due Date
1 60 Step- and Blended-edged Elliptical Dots January 16
2 100 Noisy Elliptical Dots January 23
3 100 Displacement Mapping, Bump Mapping, and Lighting February 1
4 100 Cube Mapping Reflective and Refractive Bump-mapped Surfaces February 12
5 100 Image Manipulation in a "Magic Lens" February 19
6 60 Pig Poster February 26
7 100 Geometry Shaders March 7
557 Paper 100 Paper Project (for those in CS 557) March 18, 23:59:59, no BDs
FP 100 Final Project March 20, 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.

Grading

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 11. 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. Bring the card to my office (Kelley 2117: second floor, south side) sometime when I am there. (Don't throw it under the door.)

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
1080
1060 A- 
1040 B+
1020
1000 B- 
980 C+
960
940 C- 
920 D+
900
880 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:
    kec.posx.bmp
    kec.negx.bmp
    kec.posy.bmp
    kec.negy.bmp
    kec.posz.bmp
    kec.negz.bmp

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

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.

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 notify me. I will do everything I can do to help you.

Other Useful Online Graphics and Shader Information