Week 4 - Models and Illumination Flashcards
How are continuous objects modelled?
Using polygonal approximations - a number of connected polygons (faces): a mesh
When rendering opaque objects, why is only the outer boundary/surface important?
Since only the outer boundary/surface interacts with light
What is a mesh?
A number of connected polygons/faces
What are the two main types of mesh?
Triangle mesh and quadrangle mesh
What does a polygon mesh consist of?
A set of vertices (3D points described by (x, y, z) coordinates)
A set of edges (line segments connecting two vertices)
A set of faces (polygons)
When are two edges chained?
If they share one vertex
What are surface normals?
Vectors perpendicular to the surface
What 3 conditions must a polygon mesh satisfy?
The intersection of two faces is either empty or a vertex or an edge
Manifold meshes - every edge must be shared by exactly two faces (except for the border edges)
The faces must have consistent normals (defining the same outward direction)
What is a Mobius strip?
A shape with inconsistent normals
How are smooth surfaces approximated?
By a discrete set of points, connected by edges
Typically meshes have more polygons in high curvature areas
What methods can you use to define a triangle mesh using OpenGL?
glBegin/glEnd and glVertex, using one of GL_TRIANGLES (plots each triangle separately), GL_TRIANGLE_STRIP (plots in a line, avoids repeating vertices), or GL_TRIANGLE_FAN (plots in a circle, avoids repeating vertices)
What does explicit representation of a triangle mesh mean?
Each triangle is encoded by its three vertices
What does redundant representation of a triangle mesh mean?
Each vertex is shared by three triangles
How many float variables are required for redundant triangle mesh representation?
3 x 3 x n = 9n floats for n faces
What are VBOs?
Vertex Buffer Objects - arrays for object models that can remain in GPU memory
What is shared vertex/indexed face set representation?
Array of coordinates of all vertices (3m floats for m vertices) and an array of triangles with indices into the vertex list (3n integers for n faces)
It gives less redundancy than explicit representation
Name 3 properties of polygon models per-vertex.
Coordinate (x, y, z)
Colour (r, g, b)
Normal (nx, ny, nz)
Name 4 light and material properties.
Light source
Colour
Reflectivity
Transparency
How can meshes be made to look solid?
By filling the triangles with colour
How can you get rid of the polygonal edges when filling a mesh with colour?
Interpolate the colour across every face
Name 4 types of light sources.
Point lights (very small candle flame)
Directed lights (sun, assumed at infinite distance)
Spot lights (torch etc)
Distributed lights
What attenuation does directed light have?
No attenuation
What is light attenuation?
The reduction in its intensity as it travels through a medium due to absorption or scattering of photons
What attenuation does a point light source have and why?
Quadratic attenuation -> 1/d^2 because it is a sphere (A = 4pid^2)
When a ray of light hits a surface, what 4 things can happen?
Absorption, reflection, refraction and fluorescence
What does global illumination consider?
All interactions of light within the scene, such as lighting directly from light sources, and indirect lighting
What does Lambert’s cosine law describe?
Light reflected with equal intensity in all directions
What is perfect specular reflection?
Reflection from a perfect mirror. Incident and reflected light make equal and opposite angles with surface normal
What is imperfect specular reflection?
Some light is scattered away from principal reflected direction
Give 2 examples of a specular reflection model.
The Phong Model and the Blinn-Phong Model
Name the light source options for the Phong reflection model
Point light at a given position
Spot light at a given position with a limited set of light directions
How do you do flat shading of polygon surfaces?
A single intensity is calculated for each polygon
Shade is determined by polygon normal and colour at “centre”
A triangular face’s normal is given by the cross product
How does Gouraud shading work?
Calculate vertex normals by (possibly weighted) averaging of adjacent polygons
(Bi)linerarly interpolate intensity between vertices
How does Phong shading work?
Calculate vertex normals by averaging (possibly weighted) adjacent polygons
(Bi)linearly interpolate normals between vertices
How does scanline interpolation work?
Uses Z-buffer algorithm to determine screen locations of vertices
Intensities or normals interpolated from vertices along vertices
Interpolate along scanline from edges
Name 3 methods and give a brief explanation of how to shade polygons in screen space.
Flat shading - shade determined by polygon normal and colour at “centre”
Gouraud shading - calculate shades at vertices and interpolate to interior pixels
Phong shading - interpolate normal direction to interior pixels and then calculate shade
Name a positive and a negative of using flat shading.
Fast and avoids interpolation
Doesn’t look great
Name a positive and a negative of using Gouraud shading.
Basic shading, good for diffuse reflections
Poor rendering of highlights and specular reflections
Name a positive and a negative of Phong shading.
Highest quality without volumetric rendering
4-5 times slower than Gouraud
How can you use Phong shading and Gouraud shading together?
Use Phong for surfaces with specular reflection
Use Gouraud for diffuse surfaces