Pre-Midterm Course Review
CS 481 Lecture, Dr. Lawlor
You should understand these graphics concepts:
- Vectors, dot products, cross products, and vector equations
- Overall structure of an OpenGL/GLUT program
- glutInit, glutCreateWindow, glutDisplayFunc, glutMainLoop
- Rendering in an OpenGL/GLUT program
- glClearColor, glClear, glBegin, glVertex3f, glEnd, glutSwapBuffers
- Programmable graphics hardware
- glewInit, glUseProgramObjectARB, glUniform3fvARB, glGetUniformLocationARB
- Camera setup and field-of-view
- Camera orientation control via mouse
- General coordinate system setup
- glMatrixMode, glLoadIdentity, gluPerspective, gluLookAt
- glTranslatef, glScalef, glMultMatrixf
- Diffuse and specular lighting
- Procedural texturing: computing color from location via an equation
- 2D textures, texture coordinates
- glGenTextures, glActiveTexture, glBindTexture, glTexImage2D
- Texture wrapping and clamping
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
- Nearest-neighbor, linear filtering, mipmapping, and anisotropic filtering
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
-
glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,32);
- Multiple texture layers: reflected, refracted, etc
- Volume rendering: stepping through a 3D texture, summing up image brightness
- Copying rendered data back to a texture for further processing: blurring, shadowing, fractals, etc
- The depth buffer
- Shadow maps
- Alpha blending, and using alpha blending to antialias object edges
- glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- Raytracing planes, spheres, and arbitrary objects
- Recursive raytracing (for shadows and reflections)
You should also understand these OpenGL GLSL commands and concepts:
- Builtin functions like dot, cross, length, fract, clamp, min, max, step, etc.
- uniform float overallBrightness;
- uniform vec3 cameraLoc;
- uniform mat4 shadowMat;
- uniform sampler2D myTex; ... vec4 c = texture2D(myTex,vec2(worldCoords));
- varying vec3 worldCoords; ... worldCoords = vec3(gl_ModelViewMatrix * gl_Position);
- varying vec3 worldNormal; ... worldNormal = gl_NormalMatrix * gl_Normal;
- When to use a "uniform" (constant for a whole block of geometry),
when a "varying" (linear across each piece of geometry), and when a
per-pixel value (changing quickly/nonlinearly).
- gl_FragColor = worldCoords;
- gl_FragColor = worldNormal;
- gl_FragColor = (a+d)*reflectance + vec4(s);