Introduction 3 D Computer Graphics part 1 Projective

  • Slides: 16
Download presentation
Introduction 3 D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based

Introduction 3 D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering IN 4151 Introduction 3 D graphics 1

Polygon models v 8 n v 5 v 4 z v 1 y x

Polygon models v 8 n v 5 v 4 z v 1 y x v 7 v 6 v 3 Vertices defined with respect to world coordinate system with x, y, z coordinates v 2 x d n o IN 4151 Introduction 3 D graphics 2

Viewing transformation t v w Eye point Center of Projection u Center of Interest

Viewing transformation t v w Eye point Center of Projection u Center of Interest z y IN 4151 Introduction 3 D graphics x 3

Perspective transformation p z y p’ q q’ COP z d x IN 4151

Perspective transformation p z y p’ q q’ COP z d x IN 4151 Introduction 3 D graphics d O x' x 4

Clipping • Clipping after perspective transformation • Take care of special cases (e. g.

Clipping • Clipping after perspective transformation • Take care of special cases (e. g. first remove points with negative z-coordinate) IN 4151 Introduction 3 D graphics 5

Viewport transformation ywmax zwmax ywmin yvmax zwmin xwmin Window For standard case: xwmax zdepthrange

Viewport transformation ywmax zwmax ywmin yvmax zwmin xwmin Window For standard case: xwmax zdepthrange yvmin xvmax Viewport / screen IN 4151 Introduction 3 D graphics 6

Rasterization dx/dy dz/dx IN 4151 Introduction 3 D graphics • Set-up increments along the

Rasterization dx/dy dz/dx IN 4151 Introduction 3 D graphics • Set-up increments along the edges • Interpolate along edges and along spans • Interpolate shading, normals, texture coordinates over span 7

Hidden-surface removal Wire frame Backface removal n view Backface: IN 4151 Introduction 3 D

Hidden-surface removal Wire frame Backface removal n view Backface: IN 4151 Introduction 3 D graphics Hidden surface framebuffer depthbuffer n If (z < zdepthbuffer ) then setpixel 8

Shading Light interaction with surface is complex: – – reflects diffusely-specularly is absorbed, and

Shading Light interaction with surface is complex: – – reflects diffusely-specularly is absorbed, and partly re-emitted, changes color is transmitted, and at different position re-emitted approximations are needed IN 4151 Introduction 3 D graphics 9

Phong model L f R f N L Diffuse reflection reflects light equally into

Phong model L f R f N L Diffuse reflection reflects light equally into all directions V Specular reflection reflects light around reflection direction Ambient term for indirect light IN 4151 Introduction 3 D graphics 10

Reflection parameters 0. 0 0. 1 0. 3 3 6 9 0. 5 0.

Reflection parameters 0. 0 0. 1 0. 3 3 6 9 0. 5 0. 7 25 200 0. 25 0. 0 0. 2 0. 4 0. 5 0. 75 0. 6 0. 8 1. 0 IN 4151 Introduction 3 D graphics 11

Gouraud shading normal at vertices are interpolated from normals of adjacent polygons faceted appearance

Gouraud shading normal at vertices are interpolated from normals of adjacent polygons faceted appearance To avoid faceted effect, calculate intensity at vertices and interpolate over facet smooth appearance I 1(x 1, y 1) Ia (xa , ys ) Is (xs , ys ) I 2 (x , y ) 2 2 Ib (xb , ys ) (x 4, y 4) I 4 I 3 (x 3, y 3) IN 4151 Introduction 3 D graphics 12

Texture mapping v y texture u object pixel screen • Texture mapping is a

Texture mapping v y texture u object pixel screen • Texture mapping is a composed 2 D perspective transformation • Perspective projection maps “pre-image” in texture space to image space • Filtering is required IN 4151 Introduction 3 D graphics x texture screen 13

Mipmap texture map polygon in perspective projection rasterized and textured u d Mipmap is

Mipmap texture map polygon in perspective projection rasterized and textured u d Mipmap is image pyramid with increasingly filtered/compressed images IN 4151 Introduction 3 D graphics v R G B G R B 14

Anti-aliasing Point sampling Area sampling Alpha blending / compositing + = d~a Special cases

Anti-aliasing Point sampling Area sampling Alpha blending / compositing + = d~a Special cases IN 4151 Introduction 3 D graphics 15

IN 4151 Introduction 3 D graphics 16

IN 4151 Introduction 3 D graphics 16