Top Banner
Graphics cgvr.korea.ac.kr 1 Graphics Lab @ Korea University Graphics Lab @ Korea University Surface Rendering Methods 고고고고고 고고고 고고고고 고고고
50

Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

Jan 17, 2016

Download

Documents

Angel Ramsey
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

Graphics

cgvr.korea.ac.kr 1 Graphics Lab @ Korea University Graphics Lab @ Korea University

Surface Rendering Methods

고려대학교 컴퓨터 그래픽스 연구실

Page 2: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

2 Graphics Lab @ Korea University Graphics Lab @ Korea University

Surface Rendering: Shading

Determine a Color for Each Filled Pixel How to Choose a Color for Each Filled Pixel

Each illumination calculation for a ray from the eyepoint through the view plane provides a radiance sample

Page 3: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

3 Graphics Lab @ Korea University Graphics Lab @ Korea University

Shading Methods

Ray Casting Polygon Shading

Ray Tracing

Radiosity

Page 4: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

4 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Casting

Simplest Shading Approach Perform independent lighting calculation for every

pixel

i i

niSiiDALAE IKILNKIKII )RV(

i in

iSiiDALAE IKILNKIKII )RV(

Page 5: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

5 Graphics Lab @ Korea University Graphics Lab @ Korea University

Polygon Shading

Can Take Advantage of Spatial Coherence Illumination calculations for pixels covered by same

primitive are related to each other

i i

niSiiDALAE IKILNKIKII )RV(

i in

iSiiDALAE IKILNKIKII )RV(

Page 6: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

6 Graphics Lab @ Korea University Graphics Lab @ Korea University

Polygon Shading Algorithms

Flat Shading

Gouraud Shading

Phong Shading

Page 7: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

7 Graphics Lab @ Korea University Graphics Lab @ Korea University

Polygon Shading Algorithms

Flat Shading

Gouraud Shading

Phong Shading

Page 8: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

8 Graphics Lab @ Korea University Graphics Lab @ Korea University

Flat Shading

Illuminated only by directional light sources Diffuse or viewed from infinitely far away

i i

niSiiDALAE IKILNKIKII )RV(

i in

iSiiDALAE IKILNKIKII )RV(

Page 9: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

9 Graphics Lab @ Korea University Graphics Lab @ Korea University

Flat Shading

One Illumination Calculation per Polygon Assign all pixels inside each polygon the same color

Page 10: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

10 Graphics Lab @ Korea University Graphics Lab @ Korea University

Flat Shading

Objects Look Like They are Composed of Polygons OK for polyhedral objects Not so good for ones with smooth surfaces

Page 11: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

11 Graphics Lab @ Korea University Graphics Lab @ Korea University

Polygon Shading Algorithms

Flat Shading

Gouraud Shading

Phong Shading

Page 12: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

12 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shading

Smooth Surface Represented by polygonal mesh with a normal at

each vertex

i i

niSiiDALAE IKILNKIKII )RV(

i in

iSiiDALAE IKILNKIKII )RV(

Page 13: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

13 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shading

One Lighting Calculation per Vertex Assign pixels inside polygon by interpolating colors

computed at vertices

Viewer Light

N1

N3N2

V1 L1

Polygon

Page 14: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

14 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shading

Bilinearly Interpolate Colors at Vertices Down and Across Scan Lines

I1

I2I3

21 I1IA 31 I1IB

BA1I BA1I

Page 15: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

15 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shading

Smooth Shading over Adjacent Polygons Curved surfaces Illumination highlights Soft shadows

Mesh with shared normals at vertices

Page 16: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

16 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shading

Produces Smoothly Shaded Polygonal Mesh Piecewise linear approximation Need fine mesh to capture subtle lighting effects

Flat Shading Gouraud Shading

Page 17: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

17 Graphics Lab @ Korea University Graphics Lab @ Korea University

Polygon Shading Algorithms

Flat Shading

Gouraud Shading

Phong Shading

Page 18: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

18 Graphics Lab @ Korea University Graphics Lab @ Korea University

Phong Shading

What if Polygonal Mesh is too Coarse to Capture Illumination Effects in Polygon Interiors?

Viewer Light

N1

N3N2

V1 L1

Polygon

i i

niSiiDALAE IKILNKIKII )RV(

i in

iSiiDALAE IKILNKIKII )RV(

Page 19: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

19 Graphics Lab @ Korea University Graphics Lab @ Korea University

Phong Shading

One Lighting Calculation per Pixel Approximate surface normals for points inside

polygons by bilinear interpolation of normals from vertices

Viewer Light

N1

N3N2

V L

Polygon

N

Page 20: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

20 Graphics Lab @ Korea University Graphics Lab @ Korea University

Phong Shading

Bilinearly Interpolate Normals at Vertices Down and Across Scan Lines

α β

21 N1NA 31 N1NB

γ

BA1N BA1N

N1

N2 N3

Page 21: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

21 Graphics Lab @ Korea University Graphics Lab @ Korea University

Phong Shading

Gouraud

Wireframe

Phong

Flat

Page 22: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

22 Graphics Lab @ Korea University Graphics Lab @ Korea University

Shading & Subdivision

Gouraud PhongFlat

Loop SubdivisionLevel 1

Level 2

Control Mesh

Page 23: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

23 Graphics Lab @ Korea University Graphics Lab @ Korea University

Shading Methods

Ray Casting Polygon Shading

Ray Tracing

Radiosity

Page 24: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

24 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Tracing

Extension of Ray Casting Look for the visible surface for each pixel Continue to bounce the ray around the scene

TTRSL LLn

SDAAE IKIKISKLNKIKII )RV( TTRSL LLn

SDAAE IKIKISKLNKIKII )RV(

Page 25: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

25 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Tracing

Global Illumination Shadows Refractions Inter-object reflections

Highly Realistic vs. Computation Time

TTRSL LLn

SDAAE IKIKISKLNKIKII )RV( TTRSL LLn

SDAAE IKIKISKLNKIKII )RV(

Transparenc

y

Reflectanc

e

Shadow

Page 26: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

26 Graphics Lab @ Korea University Graphics Lab @ Korea University

Basic Ray Tracing Algorithm

For Each Pixel Ray Primary ray

Test each surface if it is intersected

Intersected: Secondary ray Reflection ray Transparent – Refraction ray

Page 27: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

27 Graphics Lab @ Korea University Graphics Lab @ Korea University

Basic Ray Tracing Algorithm

For Each Pixel Ray Primary ray

Test each surface if it is intersected

Intersected: Secondary ray Reflection ray Transparent – Refraction ray

Page 28: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

28 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Tracing Tree

Ray tree represents illumination computation One branch reflection The other branch transmission Terminated reach the preset maximum or strike a light

sourceScene Ray Tree

Page 29: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

29 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Tracing Tree

Pixel intensity Sum of intensities at root node Start at terminal node If no surfaces are intersected, the intensity of background

Scene Ray Tree

Iback

Iback Iback

Ipixel

Page 30: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

30 Graphics Lab @ Korea University Graphics Lab @ Korea University

Shading Methods

Ray Casting Polygon Shading

Ray Tracing

Radiosity

Page 31: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

31 Graphics Lab @ Korea University Graphics Lab @ Korea University

Radiosity

Goal Simulate diffuse inter-object reflections and shadows

Page 32: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

32 Graphics Lab @ Korea University Graphics Lab @ Korea University

Radiosity

Basic Idea Treat every polygon as light source

Page 33: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

33 Graphics Lab @ Korea University Graphics Lab @ Korea University

Radiosity

Advantages Physically models shadows and indirect diffuse

illumination Independent of any viewpoint

Equation

ijjiii FBρEB ijjiii FBρEB

Bi = Radiosity of patch iEi = Emission of patch iρi = Reflectivity of patch iFi = Form-factor between patches i and j

Page 34: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

34 Graphics Lab @ Korea University Graphics Lab @ Korea University

Form Factors

Definition Fraction of energy leaving patch j

that arrives at patch i

Computation Project onto unit hemisphere Project onto unit circle base Divide by area of circle Project scene onto hemi-cube

Project ontounit hemisphere

Project ontoHemi-cube

Page 35: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

35 Graphics Lab @ Korea University Graphics Lab @ Korea University

Matrix Solution Methods

Matrix Formulation

Progressive Refinement Iterate shoot radiosity from patches O(n2) computation, but get pretty good solutions

more quickly

nnnnnnnnn

n

n

n

E

E

E

E

B

B

B

B

Fρ1FρFρ

FρFρFρ

FρFρ1Fρ

FρFρFρ1

3

2

1

3

2

1

21

33323313

22222212

11121111

nnnnnnnnn

n

n

n

E

E

E

E

B

B

B

B

Fρ1FρFρ

FρFρFρ

FρFρ1Fρ

FρFρFρ1

3

2

1

3

2

1

21

33323313

22222212

11121111

Page 36: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

36 Graphics Lab @ Korea University Graphics Lab @ Korea University

Matrix Solution Methods

24 iterations

1 iteration

100 iterations

2 iterations

Page 37: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

37 Graphics Lab @ Korea University Graphics Lab @ Korea University

Hierarchical Radiosity

Multiresolution Computation Substructure patches into quad-tree Transfer energy using lower resolution mesh

elements if can do so within error tolerance O(n) computation

Page 38: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

38 Graphics Lab @ Korea University Graphics Lab @ Korea University

Ray Tracing & Radiosity

Dilemma: Radiosity is good at diffuse inter-object reflection Ray tracing is good at specular inter-object reflection

Combine them Example: compute diffuse inter-object reflections in a

ray tracer Monte Carlo methods

Page 39: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

39 Graphics Lab @ Korea University Graphics Lab @ Korea University

Summary

Ray Casting Flat Gouraud Phong

Ray Tracing

Radiosity

Less Expensive

More Accurate

Page 40: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

40 Graphics Lab @ Korea University Graphics Lab @ Korea University

Visible-Line Determination

Page 41: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

41 Graphics Lab @ Korea University Graphics Lab @ Korea University

Visible-Surface Determination with Ambient Illumination only

Page 42: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

42 Graphics Lab @ Korea University Graphics Lab @ Korea University

Individually Shaded Polygons with Diffuse Reflection

Page 43: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

43 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shaded Polygons with Diffuse Reflection

Page 44: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

44 Graphics Lab @ Korea University Graphics Lab @ Korea University

Gouraud Shaded Polygons with Specular Reflection

Page 45: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

45 Graphics Lab @ Korea University Graphics Lab @ Korea University

Phong Shaded Polygons with Specular Reflection

Page 46: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

46 Graphics Lab @ Korea University Graphics Lab @ Korea University

Curved Surfaces with Specular Reflection

Page 47: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

47 Graphics Lab @ Korea University Graphics Lab @ Korea University

Improved Illumination Model and Multiple Lights

Page 48: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

48 Graphics Lab @ Korea University Graphics Lab @ Korea University

Texture Mapping

Page 49: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

49 Graphics Lab @ Korea University Graphics Lab @ Korea University

Displacement Mapping

Page 50: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.

cgvr.korea.ac.kr

CGVR

50 Graphics Lab @ Korea University Graphics Lab @ Korea University

Reflection Mapping