CS 457 / 557 -- Computer Graphics Shaders

Winter Quarter 2018

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


Classes Projects Handouts Grades VHR Piazza


This page was last updated: March 15, 2018


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

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 11:00 - 1:00 Kelley 2117
Tuesdays 12:00 - 2:00 Kelley 2117
Thursdays 12:00 - 2:00 Kelley 2117
    or, anytime my office door is open
    or, by appointment -- send email

TA

The TA for the course is Ali Alsalehy. We are fortunate to have gotten him -- he took this course a year ago and knocked it out of the park.


alsaleha@oregonstate.edu.

Ali's Office Hours:
Mondays 8:00 - 10:00, 11:00 - 1:00 CGEL (Bat 244)
Tuesdays 8:00 - 1:00 CGEL (Bat 244)
Wednesdays 8:00 - 10:00, 11:00 - 1:00 CGEL (Bat 244)
Thursdays 8:00 - 1:00 CGEL (Bat 244)
Fridays 8:00 - 10:00 CGEL (Bat 244)

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

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      
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
WebGL 1pp 2pp 4pp 6pp
More Information PDF      
Creating a Video Demo of a Graphics Project 1pp 2pp 4pp 6pp

Class Schedule

To see an Academic Year calendar, click here.

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

Be sure to check the class room in the table below to see what days we will be in Weniger 149 and what days we will be in the Computer Graphics Education Lab (CGEL -- Batcheller Hall room 244).

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

Projects

Project # Points Title Due Date
1 60 Sharp and smooth-edged Elliptical Dots January 19
2 100 Noisy Elliptical Dots January 29
3 100 Displacement Mapping, Bump Mapping, and Lighting February 7
4 100 Image Manipulation in a Magic Lens February 20
5 60 Giraffe Poster February 27
6 100 The Lego™ Project March 12
7 100 Tessellation Shaders March 15
557 Paper 100 Paper Project (for those in CS 557) March 20, 23:59:59, no BDs
FP 100 Final Project March 22, 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.

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 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
1070
1050 A- 
1030 B+
1010
990 B- 
970 C+
950
930 C- 
910 D+
890
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:
    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.

Other Useful Online Graphics and Shader Information