250 likes | 386 Views
A Short Introduction to Computer Graphics. Fredo Durand MIT Laboratory for Computer Science. Computer imagery has applications for film, special effects, simulation and training, games, medical imagery, flying logos, etc.
E N D
A Short Introduction to Computer Graphics Fredo Durand MIT Laboratory for Computer Science
Computer imagery has applications for film, special effects, simulation and training, games, medical imagery, flying logos, etc. • Computer Graphics relies on internal models of a scene…meaning a mathematical representation suitable for graphical computations. • Rendering-involves projecting the objects (perspective) handling visibility(which parts are hidden & computing their appearance & lighting interactions. Introduction
Pixels-Black & White/Color • Polygons • Primitives • Smooth Patches • Projection & Rasterization • Visibility • Shading & Materials • Shadows & Lighting Simulation Sections
Computer images are represented as a discrete grid of elements. Number of pixels determines the resolution of an image. Pixels
Black & White – 0.0 Black & 1.0 White the number describes the intensity of each pixel. • For Binary reasons they are stored as integers between 0 Black & 255 White Black & White
Each pixel is represented by a triple of numbers representing intensities of Red, Green, and Blue. ( 255,0,0) and (255,0, 255) • Examples: • Red (255,0,0) • Purple (255, 0, 255) Color
Aliasing issues can occur…such as jaggy aspect of lines. • When people wear shirts with fine stripped textures. • A flickering pattern is observed because the size of the pattern is on the same order of magnitude as the pixel size. • Antialiasing- a technique using intermediate gray levels to smooth the appearance. Antialiasing
Geometry of a scene is represented in the memory of the computer. • Triangles are used to create 3D geometric objects approximated by a polygonal mesh which is a set of connected polygons. • https://www.youtube.com/watch?v=-bZ7gstIWyI Polygons
Primitives: • Cubes, cylinders, spheres, and cones can be directly used. • Example: Spheres can simply be described by coordinates of their center and radius. • Smooth Patches: • Complex mathematical entities that permit the representation of complex smooth objects. • Spline patches and NURBS are the most popular but problematic for obtaining smooth junctions. • Subdivision Surfaces overcome limitations and give the best of both polygons and the smoothness of patches. Primitives/Smooth Patches
Projection of 3D objects is computed using linear perspective. • To compute the projection of a 3D point onto the 2D image by a 4x4 matrix and by use of view point and parameters of the cameras. • The entities are then rasterizedfilling the pixels in black and it consists of drawing all the pixels covered by the entity. Projection & Rasterization
Occlusions can occur meaning some objects are hidden by others. One visible object should be represented Visibility deals with this issue. Visibility
Sorting the objects or polygons from back to front and rasterizing them in order. The front most polygons cover the more distant polygons that they hide. Painter’s Algorithm
Sends a ray from the eye through each pixel of the image. The intersection between is computed and only the closest intersection is considered. Ray Tracing Algorithm
Most commonly used today. • Compares the depth of a current polygon and pixel. If the polygon has a closer depth, the color and depth of the pixel are updated. In other words for this pixel a formerly drawn polygon hides the current polygon. Z-Buffer Algorithm
Objects can be shaded by their interaction with light. Light is reflected by objects, based on it’s orientation of surface, light source, and viewpoint. • Spheres rendered with various material models and many different highlights Shading and Materials
A shadow ray sent from the visible point to the light source, intersects with an object then the visible point is in shadow. Shadows and Lighting Simulation