Two Major Rendering Methods: Rasterization and Ray Tracing Sung-Eui - - PowerPoint PPT Presentation

two major rendering methods rasterization and ray tracing
SMART_READER_LITE
LIVE PREVIEW

Two Major Rendering Methods: Rasterization and Ray Tracing Sung-Eui - - PowerPoint PPT Presentation

Two Major Rendering Methods: Rasterization and Ray Tracing Sung-Eui Yoon ( ) Course URL: http://jupiter.kaist.ac.kr/~sungeui/SGA/ At the Previous Class The overview of the course Main theme: designing scalable graphics/


slide-1
SLIDE 1

Two Major Rendering Methods: Rasterization and Ray Tracing

Sung-Eui Yoon (윤성의)

Course URL: http://jupiter.kaist.ac.kr/~sungeui/SGA/

slide-2
SLIDE 2

2

At the Previous Class

  • The overview of the course
  • Main theme: designing scalable

graphics/ geometric algorithms

  • Course policy: student presentations and a

report at a chosen topic

slide-3
SLIDE 3

3

What is Rendering?

  • A process that draws an image from model

descriptions

Modelling Simulation & Rendering Image Computer vision inverts the process

slide-4
SLIDE 4

4

Physically-based Rendering

  • Generate photo-realistic images based on

reality, more precisely, physics

hof.povray.org

slide-5
SLIDE 5

5

Two Major Rendering Techniques

  • Ray tracing
  • Main engine for global illumination
  • Used for high quality image generations for

movies, architectures, etc.

  • Rasterization
  • Simplified rendering method based on local

illumination

  • Used for interactive rendering for games
  • Accelerated with hardware due to the

simplicity of the method

slide-6
SLIDE 6

6

Local illumination

  • Compute the colors of points on surfaces by

considering only local properties

  • Position of the point
  • Surface properties
  • Properties of any light sources

that affect it

  • No other objects in the scene

are considered neither as light blockers nor as reflectors

  • Used in OpenGL and DirectX
slide-7
SLIDE 7

7

Global Illumination

  • I n the real world, light takes indirect paths
  • Light reflects off of other materials

(possibly multiple objects)

  • Light is blocked by other objects
  • Light can be scattered
  • Light can bend
  • Harder to model
  • At each point we must

consider not only every light source, but and other point that might have reflected light toward it

slide-8
SLIDE 8

8

Basic Ray Tracing

  • Basic I dea [Whitted 80]
  • Cast a ray into the scene from eye through

pixels

  • Computer a first-intersection and recursively

construct reflected/ shadow/ refracted rays

  • I sn’t this backwards?
  • Light goes from the light sources to the eye
  • Why go the other way?
  • Ray tracing minus secondary rays usually

called “ray casting”

slide-9
SLIDE 9

9

Ray Tree

eye s0 b a d c f e s1 s2 eye a b s0 e f s2 c b s1 R T R R T T

slide-10
SLIDE 10

10

Acceleration Methods

  • Render time for a ray tracer depends on the

number of ray intersection tests per pixel

  • Roughly dependent on the number of primitives in the scene

times the number of pixels

  • Early efforts focused on accelerating the ray-
  • bject intersection tests
  • More advanced methods required to make ray

tracing practical

  • Bounding volume hierarchy
  • Spatial partitioning hierarchy
slide-11
SLIDE 11

11

Bounding Volumes

  • Enclose complex objects within a simple-to-

intersect object

  • I f the ray does not intersect the simple object then its contents

can be ignored

  • The likelihood that it will strike the object depends on how

tightly the volume surrounds the object.

  • Spheres are simple, but not tight
  • Axis-aligned bounding boxes often better
slide-12
SLIDE 12

12

Bounding Volumes

  • Sphere [Whitted80]
  • Cheap to compute
  • Cheap test
  • Potentially very bad fit
  • Axis-aligned bounding box
  • Very cheap to compute
  • Cheap test
  • Tighter than sphere
slide-13
SLIDE 13

13

Bounding Volumes

  • Oriented Bounding Box
  • Fairly cheap to compute
  • Fairly cheap test
  • Generally fairly tight
  • Slabs / K-dops
  • More expensive

to compute

  • Fairly cheap test
  • Can be tighter than OBB
slide-14
SLIDE 14

14

Bounding Volume Hierarchy

  • Organize bounding volumes as a tree
  • Each ray starts with the scene BV and

traverses down through the hierarchy

r

slide-15
SLIDE 15

15

Spatial Partitioning Hierarchy

Idea: Divide space to sub-regions

  • Place objects within a sub-region into a list
  • Only traverse the lists of sub-regions that the ray

passes through

  • “Mail-boxing” used to avoid multiple test with
  • bjects in multiple regions
  • Many types
  • Regular grid
  • Octree
  • BSP tree
  • kd-tree
slide-16
SLIDE 16

16

kd-trees: overview

  • Binary spatial subdivision

(special case of BSP tree)

  • Split planes aligned on main axes
  • I nner nodes: subdivision planes
  • Leaf nodes: triangle(s)
slide-17
SLIDE 17

17

kd-trees: example

slide-18
SLIDE 18

18

kd-trees: example

slide-19
SLIDE 19

19

kd-trees: example

slide-20
SLIDE 20

20

kd-trees: example

slide-21
SLIDE 21

21

kd-trees: example

What about triangles overlapping the split?

slide-22
SLIDE 22

22

kd-trees: example

slide-23
SLIDE 23

23

kd-tree: split planes

  • How to select axis & split plane?
  • Largest dimension, subdivide in middle
  • More advanced: surface area heuristic

[Goldsmith and Salmon 87] and other improvements [Reshetov05]

  • Makes large difference
  • 50% -100% higher overall speedup [Wald04]
slide-24
SLIDE 24

24

kd-tree: median vs. SAH

(from [Wald04])

slide-25
SLIDE 25

25

Ray Tracing with the kd-tree

  • Goal: find closest hit with scene
  • Traverse tree front to back

(starting from root)

  • At each node:
  • I f leaf: intersect with triangles
  • I f inner: traverse deeper
slide-26
SLIDE 26

26

Rasterization

  • Standard method for rendering
  • Draw all triangles on a raster:

T

slide-27
SLIDE 27

27

Rasterization: Rendering Pipeline

Vertex Transforms Project & Clip Rasterize Fragment Processing Per- Fragment Operations Frame Buffer Operations Frame Buffer Texture Memory

Display

Host Commands

slide-28
SLIDE 28

28

Rasterization

  • Advantage:
  • Use graphics hardware / GPUs

(fast, growing even above Moore’s Law)

  • 1-2 orders of magnitude faster than ray tracing
  • Disadvantages:
  • Local illumination
  • Performance ~ linear to # triangles: can we do

better?

slide-29
SLIDE 29

29

Data Access Pattern

  • Streaming or sequential accesses for

rasterization

  • Object-driven
  • Random access for ray tracing
  • I mage-driven
  • Can we make ray tracing to have streaming

data access pattern?

slide-30
SLIDE 30

30

What are Issues?

  • Massive models
  • Hierarchy can take very large (memory and

disk) space

  • Many lights
  • Performance can linearly grow as the number
  • f lights
  • Dynamic models
  • Need to update hierarchy
  • Which one is better between BVH or SPH?
  • Controllability
  • Can we trade the quality and performance?
slide-31
SLIDE 31

31

Homework

  • Start choosing a topic that is most

interesting to you!

  • You can bring your own research to the course
  • Reference
  • Course homepage
  • SI GGRAPH and other papers
  • Refer paper collections in the homepage
  • Google scholar
slide-32
SLIDE 32

32

Next Time..

  • Study culling techniques
  • E.g., visibility culling