32
Introduc)on to Computer Graphics 4/11/13

Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Introduc)on  to  Computer  Graphics  

4/11/13

Page 2: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Agenda  

•  Mo)va)on  /  Applica)ons  •  Graphics  Pipeline  •  Shading  &  Aliasing  •  Other  interes)ng  topics  •  Conclusion  

4/11/13 2

Page 3: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Computer  Graphics  is  about  anima)on  (films)  

4/11/13 3

Major driving force now

Page 4: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Games  are  very  important  in  Computer  Graphics  

4/11/13 4

Page 5: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Medical  Imaging  is  another  driving  force  

4/11/13 5

Page 6: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Computer  Aided  Design  

4/11/13 6

Page 7: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Scien)fic  Visualisa)on  

4/11/13 7

To view below and above our visual range

Page 8: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Graphics  /  Rendering  Pipeline  •  Graphics  processes  generally  execute  sequen)ally  

•  Pipelining  the  process  means  dividing  it  into  stages    

•  Especially  when  rendering  in  real-­‐)me,  different  hardware  resources  are  assigned  for  each  stage      

4/11/13 8

Page 9: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Graphics  /  Rendering  Pipeline  •  There  are  three  stages    

– Applica)on  Stage  – Geometry  Stage    – Rasteriza)on  Stage    

4/11/13 9

Page 10: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Applica)on  stage  •  En)rely  done  in  soPware  by  the  CPU  •  Read  Data    

–  the  world  geometry  database,  –  User’s  input  by  mice,  trackballs,  trackers,  or  sensing  gloves  

•  In  response  to  the  user’s  input,  the  applica)on  stage  change  the  view  or  scene  

4/11/13 10

Page 11: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Geometry  Stage  

4/11/13 11

Model Transformation

Modeling: shapes

Shading: reflection and lighting

Transformation: viewing

Hidden Surface Elimination Rasterization Stage

Page 12: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

An  example  through  the  pipeline…  

4/11/13 12

The scene we are trying to represent:

Images courtesy of Picture Inc.

Page 13: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Preparing  Shape  Models  

4/11/13 13

Designed by polygons, parametric curves/surfaces, implicit surfaces and etc.

Defined in its own coordinate system

Page 14: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Model  Transforma)on    

4/11/13 14

l Objects put into the scene by applying translation, scaling and rotation

l Linear transformation called homogeneous transformation is used

l The location of all the vertices are updated by this transformation

Page 15: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Perspec)ve  Projec)on  

4/11/13 15

l We want to create a picture of the scene viewed from the camera

l We apply a perspective transformation to convert the 3D coordinates to 2D coordinates of the screen

l Objects far away appear smaller, closer objects appear bigger

Page 16: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Hidden  Surface  Removal    

4/11/13 16

l Objects occluded by other objects must not be drawn

Page 17: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Shading    

4/11/13 17

l Now we need to decide the colour of each pixels taking into account the object’s colour, lighting condition and the camera position

Object

point light source

Page 18: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Shading  :  Constant  Shading  -­‐  Ambient  

4/11/13 18

l Objects colours by its own colour

Page 19: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Shading  –  Flat  Shading    

4/11/13 19

l Objects coloured based on its own colour and the lighting condition

l One colour for one face

Page 20: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Gouraud  shading,  no  specular  highlights  

4/11/13 20

l Lighting calculation per vertex

Page 21: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Shapes    by  Polynomial  Surfaces  

4/11/13 21

Page 22: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Specular  highlights  added  

4/11/13 22

l Light perfectly reflected in a mirror-like way

Page 23: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Phong  shading    

4/11/13 23

Page 24: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Rasteriza)on  Stage  

4/11/13 24

Rasterization and Sampling

Texture Mapping

Image Composition

Intensity and Color Quantization

Geometry Stage

Framebuffer/Display

Page 25: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Rasteriza)on  •  Converts  the  vertex  informa)on  output  by  the  geometry  pipeline  into  pixel  informa)on  needed  by  the  video  display  

•  Aliasing:    distor)on  ar)facts  produced  when  represen)ng  a  high-­‐resolu)on  signal  at  a  lower  resolu)on.  

•  An)-­‐aliasing  :  technique  to  remove  aliasing  

4/11/13 25

Page 26: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

An)-­‐aliasing  

4/11/13 26

Aliased polygons (jagged edges)‏ Anti-aliased polygons

Page 27: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

4/11/13 27

ü How is anti-aliasing done? Each pixel is subdivided (sub-sampled) in n regions, and each sub-pixel has a color; ü Compute the average color value

Page 28: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Texture  mapping  

4/11/13 28

Page 29: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Other  topics:    Reflec)ons,  shadows  &  Bump  mapping  

4/11/13 29

Page 30: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Other  topics:    Global  Illumina)on  

4/11/13 30

Page 31: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Conclusion  

•  Wide  range  of  applica)ons  •  Op)mized  in  hardware  •  Classic  approach  gives  good  results  •  Open  Research  Topics  

– Photorealism  – Constrained  devices  – Real-­‐)me  

Page 32: Introduc)on*to* Computer*Graphics*csce.uark.edu/~cwt/COURSES/2013-01--CSCE-5053--Adv... · Computer*Graphics*is*aboutanimaon*(films)* 4/11/13 3 Major driving force now . Games*are*very*importantin*Computer*Graphics*

Ques)ons  

?