CS 457/557 -- Winter Quarter 2023
Test #1 Review
This page was last updated: February 1, 2023
Test dates and times:
The test will open Wednesday, February 8, 12:01 PM and will close Sunday, February 12, 11:59 PM
This gives you 107 hours, 58 minutes to take a 1-hour test.
This will be a multiple choice test cast as a Canvas "Quiz".
There will be 40 questions, worth 2.5 points each.
You will have 60 minutes to complete it.
Once you start, you need to finish.
Canvas does not allow you to pause, leave, then come back and resume.
The test is open notes and closed friends.
Warning! "Open Notes" is not the same as "I don't need to study for it"!
You will run out of time if you have to look up in the notes every one of the questions.
Clearly, I cannot stop you from accessing information on the Internet.
However, the test has been written against our class notes.
If you miss a particular question, any protest of the form "But somethingsomething.com said that..." will be ignored.
You are responsible for
- what is in the handouts
- what was said in class and the videos, including the Live Lectures
- what was covered on the quizzes
- what you have done in the projects
The test can cover any of the following topics:
Project Turn-in procedures
[ History of Shaders won't be on the test ]
What that means
What are they good for?
What the projection matrices to besides projection
Coordinate systems: Model Coordinates (MC), World/Eye Coordinates (EC), Normalized Device Coordinates (NDC), Screen Coordinates (SC)
GLSL vertex and fragment shaders.
How they work.
Where they fit into the overall OpenGL pipeline.
What the vertex shader replaces. What it doesn't.
What the fragment shader replaces. What it doesn't.
Where the GLSL shader compiler lives (for us, in the driver)
Uniform, Out/In, and Per-vertex Attribute variables.
What they do.
In what circumstances they are used.
Built-in GLSL variables
Built-in GLSL functions.
[ You don't need to know all of them --
just the major ones we've been using in class and are
used in the projects. ]
Eye/World: gl_ModelViewMatrix * gl_Vertex
What effects you can get with each (stripes example)
Clip: gl_ModelViewProjectionMatrix * gl_Vertex
NDC: ( gl_ModelViewProjectionMatrix * gl_Vertex ) divided by the resulting w
Sent down to the rest of the pipeline: gl_Position
gl_NormalMatrix * gl_Normal
Deciding what to key off of
Stripes: keying off Cartesian (x,y,z) coordinates vs. keying off texture (s,t) coordinates
Stripes: keying off a quantity in Model Coordinates vs. a quantity in World/Eye Coordinates
The GLSL discard operator
What happens if you use gl_FragColor.a = 0. instead?
The GLSL API for using shaders:
Reading, creating, compiling, attaching, linking
Passing in uniform and attribute variables
Enabling (Use'ing) a shader program
Disabling all shader programs (and thus returning to Fixed-Function OpenGL)
The fact that OpenGL-ES (mobile, web) has no fixed-function pipeline
[You don't need to know the names of the OpenGL functions that are used to create the shader program.]
Our glslprogram C++ class
Mixing / Blending:
The step( ) and smoothstep( ) functions
Creating our own smoothpulse( ) from two smoothstep( ) functions
The mix( ) function
How to blur the ellipse boundaries,
Fun With One:
different ways to manipulate the path from 0. to 1.
[ The exact equations won't be on the test. ]
cow-to-sphere, cow-to-cube, sphere-to-disk
Why not cow-to-dino?
- Stripes, Rings, Dots:
Applying a sine wave to the stripes
Types (1D, 2D, 3D, Cube)
One overloaded texture( ) function
All types return a vec4. They are "typed" by what gets passed in to index into the texture.
Sampler variables (e.g., sampler2D, sampler3D, samplerCube)
Yes, you can read a texture from a vertex shader
That texture can be used to displace vertices
What does it mean that noise needs to be coherent?
What does it mean that noise needs to be repeatable?
Why it can't really be random
What's wrong with Positional noise?
How Gradient noise (also called Perlin noise) is produced
Noise amplitude, Noise frequency
Octaves (twice the frequency, half the amplitude)
How to use noise and why
"baked" into a look-up texture
[ The noise equations won't be on the test. ]
Using noise to create a terrain surface
Advantages of bump-mapping over displacement-mapping
Advantages of displacement-mapping over bump-mapping
Height Field Bump-Mapping (e.g., Oregon terrain):
What is a height field? (≈ A pin box.)
Storing and accessing the height field data
Computing the normal
Equation-based Bump-Mapping (e.g., ripples)
The calculus of Tangent Vectors (dzdx, dzdy)
Computing the normal
Nonlinear uses for the vertex shader:
Dome projection [you are not responsible for the equations]
Hyperbolic Geometry [you are not responsible for the equations]
Lighting: Ambient, Diffuse, Specular
Per-vertex vs. Per-fragment lighting -- what gets interpolated in each
Flat vs. Smooth lighting -- what each looks like
The flat GLSL keyword for in and out variables
How the disco ball lighting works and the fact that it only uses one light source
Cube-mapping texture consists of 6 images in one "texture"
How an (s,t,p) vec3 gets turned into an (r,g,b) from a cube map
Reflection. (reflect function)
How the cube-mapped version differs from "real" reflection (2 things)
Refraction. (refract function)
How the cube-mapped version differs from "real" refraction (3 things)
The test can cover any of the following Projects:
Elliptical Dots: ellipse equations, finding out what checker you are in, smoothstep( ) function, mix( ) function
Noisy Displaced Elliptical Dots: use of noise, glman's way of giving you noise, how apply noise to ellipse boundaries
Displacement Mapping, Bump-Mapping, and Lighting: computing derivatives, tangent vectors,
computing the normal, perturbing the normal