graphics primer
play

Graphics Primer Lecture 2 January 14, 2020 Introduction Computer - PowerPoint PPT Presentation

CS530 - Spring 2020 Introduction to Scientific Visualization Graphics Primer Lecture 2 January 14, 2020 Introduction Computer Graphics vs. Visualization Visualization methods transform data into primitives that are rendered using CG


  1. CS530 - Spring 2020 Introduction to Scientific Visualization Graphics Primer Lecture 2 January 14, 2020

  2. Introduction Computer Graphics vs. Visualization “Visualization methods transform data into primitives that are rendered using CG techniques” Today’s objective: understand basic concepts of CG necessary to use a visualization library like VTK CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 2

  3. Outline Graphics Primitives Colors Shading Rasterization Cameras Fundamental Techniques CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 3

  4. Graphics Primitives Points Positions in space 2D( x,y ), 3D( x,y,z ) coordinates “ 0-dimensional” objects CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 4

  5. Graphics Primitives Lines 1-dimensional objects Polygonal description ( ”polyline” ) piecewise linear CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 5

  6. Graphics Primitives Lines 1-dimensional objects Parametric description P : t 2 I 7! P ( t ) 2 I R n ( e.g., splines) P ( t ) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 6

  7. Graphics Primitives Surfaces 2-dimensional objects (in 3D) Polygonal description Triangle mesh (piecewise linear) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 7

  8. Graphics Primitives Surfaces 2-dimensional objects Parametric description P : ( u, v ) ⇤ I � J ⌅⇥ P ( u, v ) ⇤ I R n bi-quadratic, bi-cubic, Bezier, splines, NURBS... CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 8

  9. Primitive Attributes Color Normal Opacity Texture coordinates CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 9

  10. Outline Graphics Primitives Colors Shading Rasterization Cameras Fundamental Techniques CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 10

  11. Colors RGB system Black 0,0,0 White 1,1,1 Red 1,0,0 Green 0,1,0 Blue 0,0,1 Yellow 1,1,0 Cyan 0,1,1 Magenta 1,0,1 Sky Blue 1/2,1/2, 1 CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 11

  12. Colors RGB system encodes colors with 3 scalars Simplified models of human color perception More on the topic next week! CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 12

  13. Outline Graphics Primitives Colors Shading Rasterization Cameras Fundamental Techniques CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 13

  14. Shading Shading reveals the shape of 3D objects through their interaction with light Shading creates colors as a function of: surface properties surface normals lights Only covering basics here Surfaces show information, lights show surfaces, shading controls how CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 14

  15. Shading Phong lighting model (1975): Light reflected by surface is combination of: Specular reflection Diffuse reflection Ambient reflection CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 15

  16. Shading Phong lighting model (1975): Light reflected by surface is combination of: Specular reflection Diffuse reflection Ambient reflection CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 15

  17. Shading Phong lighting model (1975): Light reflected by surface is combination of: Specular reflection Diffuse reflection Ambient reflection CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 15

  18. Shading Phong lighting model (1975): Light reflected by surface is combination of: Specular reflection Diffuse reflection Ambient reflection http://en.wikipedia.org/wiki/Phong_shading CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 15

  19. Shading Phong lighting model: Ambient reflection CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 16

  20. Shading Phong lighting model: Ambient reflection Light intensity per light source and per color channel I = k s I s + k d I d + k a I a CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 16

  21. Shading Phong lighting model: Ambient reflection Light intensity per light source and per color channel I = k s I s + k d I d + k a I a relative contributions (material specific) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 16

  22. Shading Phong lighting model: Ambient reflection Light intensity per light source and per color channel I = k s I s + k d I d + k a I a relative contributions (material specific) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 16

  23. Shading Phong lighting model: Specular Reflection mirror-like surfaces Specular reflection depends on position of the observer relative to light source and surface normal ⇥ n ⇥ r ⇥ l ⇥ θ v θ γ CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 17

  24. Shading Phong lighting model: Specular Reflection • I s = I i cos n � = I i cos n < � r, � v > ⇥ n ⇥ r ⇥ l ⇥ θ v θ γ CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 18

  25. Shading Phong lighting model: Diffuse Reflection Non-shiny surfaces Diffuse reflection depends only on relative position of light source and surface normal. ⇥ n ⇥ l θ CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 19

  26. Shading Phong lighting model: Diffuse Reflection I d = I i cos ✓ = I i ( ~ n ) l · ~ I d = I i cos � = I i cos < � l, � n > ⇥ n ⇥ l θ CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 20

  27. Shading Phong lighting model per color channel N X I i ( k d cos( θ ) + k s cos n ( γ )) I = k a I a + i =1 diffuse ambient light specular sum over all light sources ⇥ n ⇥ r ⇥ l ⇥ θ v θ γ CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 21

  28. Outline Graphics Primitives Colors Shading Rasterization Cameras Fundamental Techniques CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 22

  29. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels Lowest level: scan conversion Bresenham, midpoint algorithms CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 23

  30. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels Lowest level: scan conversion Bresenham, midpoint algorithms CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 23

  31. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels Lowest level: scan conversion Bresenham, midpoint algorithms CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 23

  32. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels Lowest level: scan conversion Bresenham, midpoint algorithms CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 23

  33. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels Lowest level: scan conversion Bresenham, midpoint algorithms CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 23

  34. Rasterization Putting shaded polygons on screen Transform geometric primitives into pixels OpenGL (graphics library) takes care of such operations (under the hood in VTK) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 24

  35. Back to Shading Flat shading (Color constant per polygon) CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 25

  36. Back to Shading Gouraud shading (1971) Shade vertices first, then interpolate * colors (*) More on interpolation in the coming weeks... CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 26

  37. Back to Shading Phong shading Interpolate normals and shade every pixel separately Note: Phong lighting model ≠ Phong shading CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 27

  38. Outline Graphics Primitives Colors Shading Rasterization Cameras Fundamental Techniques CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 28

  39. Projections Perspective projection parallel lines do not necessarily remain parallel objects get larger as they get closer fly-through realism CS530 / Spring 2020 : Introduction to Scientific Visualization. 01/14/2020 Graphics Primer 29

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend