CSC418: Computer Graphics DAVID LEVIN Todays Topics 1. Texture - - PowerPoint PPT Presentation

csc418 computer graphics
SMART_READER_LITE
LIVE PREVIEW

CSC418: Computer Graphics DAVID LEVIN Todays Topics 1. Texture - - PowerPoint PPT Presentation

CSC418: Computer Graphics DAVID LEVIN Todays Topics 1. Texture mapping 2. Ray Tracing Some slides and figures courtesy of Wolfgang Hurst, Patricio Simari Some figures courtesy of Peter Shirley, Fundamentals of Computer Graphics,


slide-1
SLIDE 1

DAVID LEVIN

CSC418: Computer Graphics

slide-2
SLIDE 2

Today’s Topics

  • 1. Texture mapping
  • 2. Ray Tracing

Some slides and figures courtesy of Wolfgang Hürst, Patricio Simari Some figures courtesy of Peter Shirley, “Fundamentals of Computer Graphics”, 3rd Ed.

slide-3
SLIDE 3

Showtime

slide-4
SLIDE 4

But First … Logistical Things

  • You should all have your Assignment 1 and Midterm Grades
  • Assignment 2 is due this Friday
  • If you are still having troubles email the TAs
  • csc418tas@cs.toronto.edu
  • Karan is still away so email me if you have any issues
  • diwlevin@cs.toronto.edu (usually requires two emails)
slide-5
SLIDE 5

Phong Shading: Comparisons

Phong shading: 1. Interpolate to get at 2. Compute

slide-6
SLIDE 6

Phong Shading: Comparisons

Phong shading: 1. Interpolate to get at 2. Compute

Comparison to Gouraud shading + Smooth intensity variations as in Gouraud shading + Handles specular highlights correctly even for large triangles (Why?)

  • Computationally less efficient (but okay in today's

hardware!) (Must interpolate 3 vectors & evaluate Phong reflection model at each triangle pixel)

slide-7
SLIDE 7

Topic 1: Texture Mapping

  • Motivation
  • Sources of texture
  • Texture coordinates
  • {Bump, MIP, displacement, environmental}

mapping

slide-8
SLIDE 8

Motivation

  • Adding lots of detail to our models to realistically depict skin,

grass, bark, stone, etc., would increase rendering times dramatically, even for hardware-supported projective methods.

slide-9
SLIDE 9

Motivation

  • Adding lots of detail to our models to realistically depict skin,

grass, bark, stone, etc., would increase rendering times dramatically, even for hardware-supported projective methods.

slide-10
SLIDE 10

Motivation

slide-11
SLIDE 11

Motivation

slide-12
SLIDE 12
slide-13
SLIDE 13

Topic 1: Texture Mapping

  • Motivation
  • Sources of texture
  • Texture coordinates
  • {Bump, MIP, displacement, environmental}

mapping

slide-14
SLIDE 14

Texture sources: Photographs

slide-15
SLIDE 15

Texture sources: Solid textures

slide-16
SLIDE 16

Texture sources: Procedural

slide-17
SLIDE 17

Texture sources: Synthesized

slide-18
SLIDE 18

Original Synthesized Original Synthesized

slide-19
SLIDE 19

Topic 1: Texture Mapping

  • Motivation
  • Sources of texture
  • Texture coordinates
  • {Bump, MIP, displacement, environmental}

mapping

slide-20
SLIDE 20

Texture coordinates

How does one establish correspondence? (UV mapping)

slide-21
SLIDE 21

Texture coordinates

slide-22
SLIDE 22

Texture coordinates

slide-23
SLIDE 23

Texture coordinates

slide-24
SLIDE 24

Texture coordinates

slide-25
SLIDE 25

Texture coordinates

slide-26
SLIDE 26

Texture coordinates

slide-27
SLIDE 27

Texture coordinates

slide-28
SLIDE 28

Texture coordinates

slide-29
SLIDE 29

Texture coordinates

slide-30
SLIDE 30

Topic 1: Texture Mapping

  • Motivation
  • Sources of texture
  • Texture coordinates
  • {Bump, MIP, displacement, environmental}

mapping

slide-31
SLIDE 31

Mipmapping

slide-32
SLIDE 32

MIP-Mapping: Basic Idea

Given a polygon, use the texture image, where the projected polygon best matches the size of the polygon on screen.

slide-33
SLIDE 33

Mipmapping

slide-34
SLIDE 34

Mipmapping

slide-35
SLIDE 35

Environment mapping

slide-36
SLIDE 36

Environment mapping

slide-37
SLIDE 37

Environment mapping

slide-38
SLIDE 38

Environment mapping

slide-39
SLIDE 39

Bump mapping

slide-40
SLIDE 40

Bump mapping

slide-41
SLIDE 41

Bump mapping

slide-42
SLIDE 42
slide-43
SLIDE 43

Displacement mapping

slide-44
SLIDE 44

Displacement mapping

slide-45
SLIDE 45

Topic 2: Basic Ray Tracing

  • Introduction to ray tracing
  • Computing rays
  • Computing intersections
  • ray-triangle
  • ray-polygon
  • ray-quadric
  • the scene signature
  • Computing normals
  • Evaluating shading model
  • Spawning rays
  • Incorporating transmission
  • refraction
  • ray-spawning & refraction
slide-46
SLIDE 46

Local vs. Global Illumination

Local Illumination Models e.g. Phong

  • Model source from a light reflected once off a surface

towards the eye

  • Indirect light is included with an ad hoc “ambient” term

which is normally constant across the scene Global Illumination Models e.g. ray tracing or radiosity (both are incomplete)

  • Try to measure light propagation in the scene
  • Model interaction between objects and other objects,
  • bjects and their environment
slide-47
SLIDE 47

All surfaces are not created equal

Specular surfaces

  • e.g. mirrors, glass balls
  • An idealized model provides ‘perfect’ reflection

Incident ray is reflected back as a ray in a single direction Diffuse surfaces

  • e.g. flat paint, chalk
  • Lambertian surfaces
  • Incident light is scattered equally in all directions

General reflectance model: BRDF

slide-48
SLIDE 48

Categories of light transport

Specular-Specular Specular-Diffuse Diffuse-Diffuse Diffuse-Specular

slide-49
SLIDE 49

Ray Tracing

Traces path of specularly reflected or transmitted (refracted) rays through environment Rays are infinitely thin Don’t disperse Signature: shiny objects exhibiting sharp, multiple reflections Transport E - S – S – S – D – L.

slide-50
SLIDE 50

Ray Tracing

Unifies in one framework

  • Hidden surface removal
  • Shadow computation
  • Reflection of light
  • Refraction of light
  • Global specular interaction
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53

Rasterization vs. Ray Tracing

Rasterization:

  • project geometry onto image.
  • pixel color computed by local illumination

(direct lighting). Ray-Tracing:

  • project image pixels (backwards) onto scene.
  • pixel color determined based on direct light

as well indirectly by recursively following promising lights path of the ray.

slide-54
SLIDE 54

Projective methods

slide-55
SLIDE 55

Ray tracing / ray casting

slide-56
SLIDE 56

Ray tracing / ray casting

slide-57
SLIDE 57

Ray tracing / ray casting

slide-58
SLIDE 58

Ray tracing

slide-59
SLIDE 59

Ray tracing

slide-60
SLIDE 60

Ray tracing

slide-61
SLIDE 61

Ray tracing

slide-62
SLIDE 62

Ray tracing

slide-63
SLIDE 63

Projective methods vs. ray tracing

slide-64
SLIDE 64

Projective methods vs. ray tracing

slide-65
SLIDE 65

A basic ray tracing algorithm

slide-66
SLIDE 66

Lines and rays

slide-67
SLIDE 67

Lines and rays

slide-68
SLIDE 68

Lines and rays

slide-69
SLIDE 69

Coordinate system

slide-70
SLIDE 70

Coordinate system

slide-71
SLIDE 71

Coordinate system

slide-72
SLIDE 72

Coordinate system

slide-73
SLIDE 73

Coordinate system

slide-74
SLIDE 74

Viewing window

slide-75
SLIDE 75

Viewing window

slide-76
SLIDE 76

Viewing window

slide-77
SLIDE 77

Viewing rays

slide-78
SLIDE 78

Viewing rays

slide-79
SLIDE 79

Viewing rays compared

slide-80
SLIDE 80

A basic ray tracing algorithm

slide-81
SLIDE 81

Ray-object intersection (implicit surface)

slide-82
SLIDE 82

Spheres

slide-83
SLIDE 83

Intersections between rays and spheres

slide-84
SLIDE 84

Intersections between rays and spheres

slide-85
SLIDE 85

Intersections between rays and planes

slide-86
SLIDE 86

Ray-object intersection (parametric surface)

slide-87
SLIDE 87

Ray-object intersection (parametric surface)

slide-88
SLIDE 88

Ray-triangle intersection

slide-89
SLIDE 89

Plane specification

slide-90
SLIDE 90

Ray-plane specification

slide-91
SLIDE 91

Ray-plane specification

slide-92
SLIDE 92

Ray-plane specification

slide-93
SLIDE 93

Rays: parametric representation

slide-94
SLIDE 94

Computing Ray-Poly Intersections: Step b

slide-95
SLIDE 95

Computing Ray-Poly Intersections: Step b

slide-96
SLIDE 96

Computing Ray-Quadric Intersections

slide-97
SLIDE 97

Computing Ray-Quadric Intersections

slide-98
SLIDE 98

Computing Ray-Quadric Intersections: 3 Cases

slide-99
SLIDE 99

Ray-Quadric Intersections: Sub-cases for D>0

slide-100
SLIDE 100

Intersecting Rays & Composite Objects

  • Intersect ray with component objects
  • Process the intersections ordered by depth

to return intersection pairs with the object.

slide-101
SLIDE 101

Ray Intersection: Efficiency Considerations

Speed-up the intersection process.

  • Ignore object that clearly don’t intersect.
  • Use proxy geometry.
  • Subdivide and structure space hierarchically.
  • Project volume onto image to ignore entire

Sets of rays.