SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Downloaden Sie, um offline zu lesen
A Short Introduction to Computer Graphics

                 Frédo Durand

      MIT Laboratory for Computer Science
Chapter I: Basics
1 Introduction
   Although computer graphics is a vast field that encompasses almost any graphical aspect, we are mainly
interested in the generation of images of 3-dimensional scenes. Computer imagery has applications for film
special effects, simulation and training, games, medical imagery, flying logos, etc.
   Computer graphics relies on an internal model of the scene, that is, a mathematical representation
suitable for graphical computations (see Chapter II). The model describes the 3D shapes, layout and
materials of the scene.
   This 3D representation then has to be projected to compute a 2D image from a given viewpoint, this is
the rendering step (see Chapter III). Rendering involves projecting the objects (perspective), handling
visibility (which parts of objects are hidden) and computing their appearance and lighting interactions.
   Finally, for animated sequence, the motion of objects has to be specified. We will not discuss animation
in this document.

2 Pixels
   A computer image is usually represented as a discrete grid of picture elements a.k.a. pixels. The number
of pixels determines the resolution of the image. Typical resolutions range from 320*200 to 2000*1500.
   For a black and white image, a number describes the intensity of each pixel. It can be expressed between
0.0 (black) and 1.0 (white). However, for internal binary representation reasons, it is usually stored as an
integer between 0 (black) and 255 (white)




            A low-resolution digital image. Left: Black and white. Right: Color. (Image © Pixar).

For a color image, each pixel is described by a triple of numbers representing the intensity of red, green and
blue. For example, pure red is (255, 0, 0) and purple is (255, 0, 255).

   Because the image is represented by a discrete array of pixels, aliasing problems may occur. The most
classical form of aliasing is the jaggy aspect of lines (see figure below). Antialiasing techniques are thus
required. In the case of the line, it consists in using intermediate gray levels to “smooth” the appearance of
the line. Another form of aliasing can be observed on television when people wear shirts with a fine
stripped texture. A flickering pattern is observed because the size of the pattern is on the same order of
magnitude as the pixel size.




                                    A line without and with antialiasing.
Chapter II: Geometric Model
  We introduce how the geometry of the scene is represented in the memory of the computer.

1 Polygons
  The most classical method for modeling 3D geometry is the use of polygons. An object is approximated
by a polygonal mesh, that is a set of connected polygons (see below). Most of the time, triangles are used
for simplicity and generality.



                                       4

                                       3                                y
                                       2

                                       1

                                                                                     x
                                 Left: A cow modeled as a mesh of triangles.
      Right: This triangle can be stored using the coordinates of its vertices as [(2,4,2), (3,1,0), (1,1,2)].

   Each polygon or triangle can be described by the 3D coordinates of its list of vertices (see figure above).
   The obvious limitation of triangles is that they produce a flat and geometric appearance. However,
techniques called smoothing or interpolation can greatly improve this.

2 Primitives
  The most classical geometric entities can be directly used as primitives, e.g. cubes, cylinders, spheres and
cones. A sphere for example can be simply described by the coordinates of its center and its radius.

3 Smooth patches
   More complex mathematical entities permit the representation of complex smooth objects. Spline
patches and NURBS are the most popular. They are however harder to manipulate since one does not
directly control the surface but so called control points that are only indirectly related to the final shape.
Moreover, obtaining smooth junctions between different patches can be problematic. However, the recently
popular subdivision surfaces overcome this limitation. They offer the best of both worlds and provide the
simplicity of polygons and the smoothness of patches.
Chapter III:                                     Rendering
1 Projection and rasterization
  The image projection of the 3D objects is computed using linear perspective. Given the position of the
viewpoint and some camera parameters (e.g. field of view), it is very easy to compute the projection of a
3D point onto the 2D image. For mathematics enthusiasts, this can be simply expressed using a 4*4 matrix.
  In most methods, the geometric entities are then rasterized. It consists in drawing all the pixels covered
by the entity.
  In the example below, the projections of the 3 red points have been computed using linear perspective,
and the triangle has then been rasterized by filling the pixels in black. For richer rendering, the color of
each rasterized pixel must take into account the optical properties of the object, as we will discuss below.
                                                         3D Triangle

                               Image




                              Projected (2D)
                                 Triangle

             Viewpoint

                            Projection (left) and rasterization (right) of a triangle.

2 Visibility
   If the scene contains more than one object, occlusions may occur. That is, some objects may be hidden
by others. Only visible objects should be represented. Visibility techniques deal with this issue.
   One classical algorithm that solves the visibility problem is the so-called painter’s algorithm. It consists
in sorting the objects or polygons from back to front and rasterizing them in this order. This way, front-
most polygons cover the more distant polygons that they hide.

                                                                              1
                                                 Image
                                                                        2




                                 Viewpoint


  The Painter’s algorithm. Triangle 1 is drawn first because it is more distant. Triangle 2 is drawn next and
                             covers Triangle 1, which yields correct occlusion.
The ray-tracing algorithm does not use a rasterization phase. It sends one ray from the eye and through
each pixel of the image. The intersection between this ray and the objects of the scene is computed, and
only the closest intersection is considered.


                                                                         1

                                                                2

                                               Pixel




                         Viewpoint

  Ray-tracing. A ray is sent from the eye and through the pixel. Since the intersection with 2 is closer than
                                   the intersection with 1, the pixel is black.

   The z-buffer method is the most common nowadays (e.g. for computer graphics cards). It stores the depth
(z) of each pixel. When a new polygon is rasterized, for each pixel, the algorithm compares the depth of the
current polygon and the depth of the pixel. If the new polygon has a closer depth, the color and depth of the
pixel are updated. Otherwise, it means that for this pixel, a formerly drawn polygon hides the current
polygon.

3 Shading and materials
  Augmenting the scene with light sources allows for better rendering. The objects can be shaded
according to their interaction with light. Various shading models have been proposed in the literature. They
describe how light is reflected by object, depending on the relative orientation of the surface, light source
and viewpoint (see figure below).




                                                                incoming light



                                                                    ?1

                                         outgoing light


                                               ?2

Light reflection model. The ratio of light bouncing off the surface in the direction of the eye depends on the
                                                 two angles.
Sphere rendered using various material models. Note in particular the different highlights. Image from the
                         Columbia-Utrecht Reflectance and Texture Database.

  Texture mapping uses 2D images that are mapped on the 3D models to improve their appearance (see
examples in section 5).

4 Shadows and lighting simulation
  Shading and material models only take into account the local interaction of surfaces and light. They doe
not simulate shadows that are harder to handle because they imply long-range interactions. A shadow is
caused by the occlusion of light by one object.
  Ray-tracing, for example, can handle shadows, but requires a shadow computation for each pixel and
each light source. A shadow ray is sent from the visible point to the light source. If the ray intersects an
object, then the visible point is in shadow.




                                                        shadow ray




                                                                      Visible point



                                                    Pixel




                                Viewpoint


                                   Shadow computation using ray-tracing.
            The visible point is in shadow because the black triangle occludes the light source.

   More complex lighting interactions can then be simulated. In particular, objects that are illuminated by a
primary light source reflect light and produce indirect lighting. This is particularly important for inddor
scenes. Global lighting methods take into account all light inter-reflections within the scene.
5 Example




     Polygonal model rendered in wire-frame                              With visibility.
                 (no vis ibility)




Shaded rendering. Note how the faces of the cube       Smooth patches and shading including highlights.
and cone have different intensities depending on
   their orientation relative to the light source.




  Texture-Mapping improves the appearance of                                  Shadows.
     surfaces (a better lighting is used too).

                               Various rendering qualities (Images © Pixar)

Weitere ähnliche Inhalte

Was ist angesagt?

Feature detection and matching
Feature detection and matchingFeature detection and matching
Feature detection and matchingKuppusamy P
 
Image segmentation
Image segmentationImage segmentation
Image segmentationDeepak Kumar
 
Copy of 3 d report
Copy of 3 d reportCopy of 3 d report
Copy of 3 d reportVirajjha
 
Features image processing and Extaction
Features image processing and ExtactionFeatures image processing and Extaction
Features image processing and ExtactionAli A Jalil
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Improvement of the Recognition Rate by Random Forest
Improvement of the Recognition Rate by Random ForestImprovement of the Recognition Rate by Random Forest
Improvement of the Recognition Rate by Random ForestIJERA Editor
 
Improvement oh the recognition rate by random forest
Improvement oh the recognition rate by random forestImprovement oh the recognition rate by random forest
Improvement oh the recognition rate by random forestYoussef Rachidi
 
Image segmentation ajal
Image segmentation ajalImage segmentation ajal
Image segmentation ajalAJAL A J
 
Shadow Detection and Removal in Still Images by using Hue Properties of Color...
Shadow Detection and Removal in Still Images by using Hue Properties of Color...Shadow Detection and Removal in Still Images by using Hue Properties of Color...
Shadow Detection and Removal in Still Images by using Hue Properties of Color...ijsrd.com
 
Image segmentation
Image segmentationImage segmentation
Image segmentationRania H
 
Shadow Detection and Removal Techniques A Perspective View
Shadow Detection and Removal Techniques A Perspective ViewShadow Detection and Removal Techniques A Perspective View
Shadow Detection and Removal Techniques A Perspective Viewijtsrd
 

Was ist angesagt? (20)

Visual realism
Visual realismVisual realism
Visual realism
 
Feature detection and matching
Feature detection and matchingFeature detection and matching
Feature detection and matching
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Ijcatr04041016
Ijcatr04041016Ijcatr04041016
Ijcatr04041016
 
PPT s08-machine vision-s2
PPT s08-machine vision-s2PPT s08-machine vision-s2
PPT s08-machine vision-s2
 
PPT s03-machine vision-s2
PPT s03-machine vision-s2PPT s03-machine vision-s2
PPT s03-machine vision-s2
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Copy of 3 d report
Copy of 3 d reportCopy of 3 d report
Copy of 3 d report
 
Cj36511514
Cj36511514Cj36511514
Cj36511514
 
Features image processing and Extaction
Features image processing and ExtactionFeatures image processing and Extaction
Features image processing and Extaction
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Improvement of the Recognition Rate by Random Forest
Improvement of the Recognition Rate by Random ForestImprovement of the Recognition Rate by Random Forest
Improvement of the Recognition Rate by Random Forest
 
Improvement oh the recognition rate by random forest
Improvement oh the recognition rate by random forestImprovement oh the recognition rate by random forest
Improvement oh the recognition rate by random forest
 
Image segmentation ajal
Image segmentation ajalImage segmentation ajal
Image segmentation ajal
 
Shadow Detection and Removal in Still Images by using Hue Properties of Color...
Shadow Detection and Removal in Still Images by using Hue Properties of Color...Shadow Detection and Removal in Still Images by using Hue Properties of Color...
Shadow Detection and Removal in Still Images by using Hue Properties of Color...
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image Segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Data structures
Data structuresData structures
Data structures
 
Shadow Detection and Removal Techniques A Perspective View
Shadow Detection and Removal Techniques A Perspective ViewShadow Detection and Removal Techniques A Perspective View
Shadow Detection and Removal Techniques A Perspective View
 

Andere mochten auch

Open quiz prelims answers
Open quiz prelims answersOpen quiz prelims answers
Open quiz prelims answersDaipayan Roy
 
La nutricó humana
La nutricó humanaLa nutricó humana
La nutricó humanamaria566
 
ลาวเวียง ลาวกลาง
ลาวเวียง ลาวกลางลาวเวียง ลาวกลาง
ลาวเวียง ลาวกลาง0806703901
 
Hf radio propagation
Hf radio propagationHf radio propagation
Hf radio propagationLax Koirala
 
Geometric isomers ( cis trans )
Geometric isomers ( cis trans )Geometric isomers ( cis trans )
Geometric isomers ( cis trans )goodemc
 
Breast Thermography /Digital Infrared Analysis of the Breast
Breast Thermography /Digital Infrared Analysis of the BreastBreast Thermography /Digital Infrared Analysis of the Breast
Breast Thermography /Digital Infrared Analysis of the BreastEnrique Martín del Campo Mena
 
Makalah manajemen logistik
Makalah manajemen logistikMakalah manajemen logistik
Makalah manajemen logistikAgung Widarman
 

Andere mochten auch (14)

Shailaja
ShailajaShailaja
Shailaja
 
Open quiz prelims answers
Open quiz prelims answersOpen quiz prelims answers
Open quiz prelims answers
 
Africities
AfricitiesAfricities
Africities
 
Lec1
Lec1Lec1
Lec1
 
La nutricó humana
La nutricó humanaLa nutricó humana
La nutricó humana
 
Petitorio pablo medina 2011
Petitorio pablo medina 2011Petitorio pablo medina 2011
Petitorio pablo medina 2011
 
Iwatch tech 1
Iwatch tech 1Iwatch tech 1
Iwatch tech 1
 
ลาวเวียง ลาวกลาง
ลาวเวียง ลาวกลางลาวเวียง ลาวกลาง
ลาวเวียง ลาวกลาง
 
Kljucevi za kreativnost
Kljucevi za kreativnostKljucevi za kreativnost
Kljucevi za kreativnost
 
Hf radio propagation
Hf radio propagationHf radio propagation
Hf radio propagation
 
Geometric isomers ( cis trans )
Geometric isomers ( cis trans )Geometric isomers ( cis trans )
Geometric isomers ( cis trans )
 
Breast Thermography /Digital Infrared Analysis of the Breast
Breast Thermography /Digital Infrared Analysis of the BreastBreast Thermography /Digital Infrared Analysis of the Breast
Breast Thermography /Digital Infrared Analysis of the Breast
 
Remote Sensing
Remote SensingRemote Sensing
Remote Sensing
 
Makalah manajemen logistik
Makalah manajemen logistikMakalah manajemen logistik
Makalah manajemen logistik
 

Ähnlich wie Graphics

visual realism in geometric modeling
visual realism in geometric modelingvisual realism in geometric modeling
visual realism in geometric modelingsabiha khathun
 
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSAPPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSijcga
 
iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)Moniroth Suon
 
Advance image processing
Advance image processingAdvance image processing
Advance image processingAAKANKSHA JAIN
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - TexturesMichael Heron
 
Rendering Algorithms.pptx
Rendering Algorithms.pptxRendering Algorithms.pptx
Rendering Algorithms.pptxSherinRappai
 
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...CSCJournals
 
From Polygons to Quadratics.pptx
From Polygons to Quadratics.pptxFrom Polygons to Quadratics.pptx
From Polygons to Quadratics.pptxyaswanthnaik27
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfAdam Hill
 
Computer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptxComputer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptxAmmarahMajeed
 
Computer Vision - Image Formation.pdf
Computer Vision - Image Formation.pdfComputer Vision - Image Formation.pdf
Computer Vision - Image Formation.pdfAmmarahMajeed
 

Ähnlich wie Graphics (20)

visual realism in geometric modeling
visual realism in geometric modelingvisual realism in geometric modeling
visual realism in geometric modeling
 
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWSAPPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
APPEARANCE-BASED REPRESENTATION AND RENDERING OF CAST SHADOWS
 
iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)iCAMPResearchPaper_ObjectRecognition (2)
iCAMPResearchPaper_ObjectRecognition (2)
 
DIP-Questions.pdf
DIP-Questions.pdfDIP-Questions.pdf
DIP-Questions.pdf
 
Lecture1
Lecture1Lecture1
Lecture1
 
06 robot vision
06 robot vision06 robot vision
06 robot vision
 
Advance image processing
Advance image processingAdvance image processing
Advance image processing
 
Illumination Model
Illumination ModelIllumination Model
Illumination Model
 
Extended fuzzy c means clustering algorithm in segmentation of noisy images
Extended fuzzy c means clustering algorithm in segmentation of noisy imagesExtended fuzzy c means clustering algorithm in segmentation of noisy images
Extended fuzzy c means clustering algorithm in segmentation of noisy images
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
 
Rendering Algorithms.pptx
Rendering Algorithms.pptxRendering Algorithms.pptx
Rendering Algorithms.pptx
 
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...
Stereo Correspondence Algorithms for Robotic Applications Under Ideal And Non...
 
From Polygons to Quadratics.pptx
From Polygons to Quadratics.pptxFrom Polygons to Quadratics.pptx
From Polygons to Quadratics.pptx
 
It 603
It 603It 603
It 603
 
J017426467
J017426467J017426467
J017426467
 
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdfPapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
PapersWeLove - Rendering Synthetic Objects Into Real Scenes - Paul Debevec.pdf
 
Computer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptxComputer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptx
 
regions
regionsregions
regions
 
Computer Vision - Image Formation.pdf
Computer Vision - Image Formation.pdfComputer Vision - Image Formation.pdf
Computer Vision - Image Formation.pdf
 
Segmentation
SegmentationSegmentation
Segmentation
 

Kürzlich hochgeladen

Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 

Kürzlich hochgeladen (20)

Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 

Graphics

  • 1. A Short Introduction to Computer Graphics Frédo Durand MIT Laboratory for Computer Science
  • 2. Chapter I: Basics 1 Introduction Although computer graphics is a vast field that encompasses almost any graphical aspect, we are mainly interested in the generation of images of 3-dimensional scenes. Computer imagery has applications for film special effects, simulation and training, games, medical imagery, flying logos, etc. Computer graphics relies on an internal model of the scene, that is, a mathematical representation suitable for graphical computations (see Chapter II). The model describes the 3D shapes, layout and materials of the scene. This 3D representation then has to be projected to compute a 2D image from a given viewpoint, this is the rendering step (see Chapter III). Rendering involves projecting the objects (perspective), handling visibility (which parts of objects are hidden) and computing their appearance and lighting interactions. Finally, for animated sequence, the motion of objects has to be specified. We will not discuss animation in this document. 2 Pixels A computer image is usually represented as a discrete grid of picture elements a.k.a. pixels. The number of pixels determines the resolution of the image. Typical resolutions range from 320*200 to 2000*1500. For a black and white image, a number describes the intensity of each pixel. It can be expressed between 0.0 (black) and 1.0 (white). However, for internal binary representation reasons, it is usually stored as an integer between 0 (black) and 255 (white) A low-resolution digital image. Left: Black and white. Right: Color. (Image © Pixar). For a color image, each pixel is described by a triple of numbers representing the intensity of red, green and blue. For example, pure red is (255, 0, 0) and purple is (255, 0, 255). Because the image is represented by a discrete array of pixels, aliasing problems may occur. The most classical form of aliasing is the jaggy aspect of lines (see figure below). Antialiasing techniques are thus required. In the case of the line, it consists in using intermediate gray levels to “smooth” the appearance of the line. Another form of aliasing can be observed on television when people wear shirts with a fine stripped texture. A flickering pattern is observed because the size of the pattern is on the same order of magnitude as the pixel size. A line without and with antialiasing.
  • 3. Chapter II: Geometric Model We introduce how the geometry of the scene is represented in the memory of the computer. 1 Polygons The most classical method for modeling 3D geometry is the use of polygons. An object is approximated by a polygonal mesh, that is a set of connected polygons (see below). Most of the time, triangles are used for simplicity and generality. 4 3 y 2 1 x Left: A cow modeled as a mesh of triangles. Right: This triangle can be stored using the coordinates of its vertices as [(2,4,2), (3,1,0), (1,1,2)]. Each polygon or triangle can be described by the 3D coordinates of its list of vertices (see figure above). The obvious limitation of triangles is that they produce a flat and geometric appearance. However, techniques called smoothing or interpolation can greatly improve this. 2 Primitives The most classical geometric entities can be directly used as primitives, e.g. cubes, cylinders, spheres and cones. A sphere for example can be simply described by the coordinates of its center and its radius. 3 Smooth patches More complex mathematical entities permit the representation of complex smooth objects. Spline patches and NURBS are the most popular. They are however harder to manipulate since one does not directly control the surface but so called control points that are only indirectly related to the final shape. Moreover, obtaining smooth junctions between different patches can be problematic. However, the recently popular subdivision surfaces overcome this limitation. They offer the best of both worlds and provide the simplicity of polygons and the smoothness of patches.
  • 4. Chapter III: Rendering 1 Projection and rasterization The image projection of the 3D objects is computed using linear perspective. Given the position of the viewpoint and some camera parameters (e.g. field of view), it is very easy to compute the projection of a 3D point onto the 2D image. For mathematics enthusiasts, this can be simply expressed using a 4*4 matrix. In most methods, the geometric entities are then rasterized. It consists in drawing all the pixels covered by the entity. In the example below, the projections of the 3 red points have been computed using linear perspective, and the triangle has then been rasterized by filling the pixels in black. For richer rendering, the color of each rasterized pixel must take into account the optical properties of the object, as we will discuss below. 3D Triangle Image Projected (2D) Triangle Viewpoint Projection (left) and rasterization (right) of a triangle. 2 Visibility If the scene contains more than one object, occlusions may occur. That is, some objects may be hidden by others. Only visible objects should be represented. Visibility techniques deal with this issue. One classical algorithm that solves the visibility problem is the so-called painter’s algorithm. It consists in sorting the objects or polygons from back to front and rasterizing them in this order. This way, front- most polygons cover the more distant polygons that they hide. 1 Image 2 Viewpoint The Painter’s algorithm. Triangle 1 is drawn first because it is more distant. Triangle 2 is drawn next and covers Triangle 1, which yields correct occlusion.
  • 5. The ray-tracing algorithm does not use a rasterization phase. It sends one ray from the eye and through each pixel of the image. The intersection between this ray and the objects of the scene is computed, and only the closest intersection is considered. 1 2 Pixel Viewpoint Ray-tracing. A ray is sent from the eye and through the pixel. Since the intersection with 2 is closer than the intersection with 1, the pixel is black. The z-buffer method is the most common nowadays (e.g. for computer graphics cards). It stores the depth (z) of each pixel. When a new polygon is rasterized, for each pixel, the algorithm compares the depth of the current polygon and the depth of the pixel. If the new polygon has a closer depth, the color and depth of the pixel are updated. Otherwise, it means that for this pixel, a formerly drawn polygon hides the current polygon. 3 Shading and materials Augmenting the scene with light sources allows for better rendering. The objects can be shaded according to their interaction with light. Various shading models have been proposed in the literature. They describe how light is reflected by object, depending on the relative orientation of the surface, light source and viewpoint (see figure below). incoming light ?1 outgoing light ?2 Light reflection model. The ratio of light bouncing off the surface in the direction of the eye depends on the two angles.
  • 6. Sphere rendered using various material models. Note in particular the different highlights. Image from the Columbia-Utrecht Reflectance and Texture Database. Texture mapping uses 2D images that are mapped on the 3D models to improve their appearance (see examples in section 5). 4 Shadows and lighting simulation Shading and material models only take into account the local interaction of surfaces and light. They doe not simulate shadows that are harder to handle because they imply long-range interactions. A shadow is caused by the occlusion of light by one object. Ray-tracing, for example, can handle shadows, but requires a shadow computation for each pixel and each light source. A shadow ray is sent from the visible point to the light source. If the ray intersects an object, then the visible point is in shadow. shadow ray Visible point Pixel Viewpoint Shadow computation using ray-tracing. The visible point is in shadow because the black triangle occludes the light source. More complex lighting interactions can then be simulated. In particular, objects that are illuminated by a primary light source reflect light and produce indirect lighting. This is particularly important for inddor scenes. Global lighting methods take into account all light inter-reflections within the scene.
  • 7. 5 Example Polygonal model rendered in wire-frame With visibility. (no vis ibility) Shaded rendering. Note how the faces of the cube Smooth patches and shading including highlights. and cone have different intensities depending on their orientation relative to the light source. Texture-Mapping improves the appearance of Shadows. surfaces (a better lighting is used too). Various rendering qualities (Images © Pixar)