Graphics Surface Rendering Methods cgvr korea ac kr

  • Slides: 49
Download presentation
Graphics Surface Rendering Methods 고려대학교 그래픽스 연구실 cgvr. korea. ac. kr 1 Graphics Lab

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

Surface Rendering: Shading CGVR Determine a Color for Each Filled Pixel n How to

Surface Rendering: Shading CGVR Determine a Color for Each Filled Pixel n How to Choose a Color for Each Filled Pixel n n Each illumination calculation for a ray from the eyepoint through the view plane provides a radiance sample cgvr. korea. ac. kr 2 Graphics Lab @ Korea University

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity cgvr. korea. ac. kr 3 Graphics Lab @ Korea University

Ray Casting n CGVR Simplest Shading Approach n Perform independent lighting calculation for every

Ray Casting n CGVR Simplest Shading Approach n Perform independent lighting calculation for every pixel cgvr. korea. ac. kr 4 Graphics Lab @ Korea University

Polygon Shading n CGVR Can Take Advantage of Spatial Coherence n Illumination calculations for

Polygon Shading n CGVR Can Take Advantage of Spatial Coherence n Illumination calculations for pixels covered by same primitive are related to each other cgvr. korea. ac. kr 5 Graphics Lab @ Korea University

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea.

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea. ac. kr 6 CGVR Graphics Lab @ Korea University

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea.

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea. ac. kr 7 CGVR Graphics Lab @ Korea University

Flat Shading n CGVR Illuminated only by directional light sources n Diffuse or viewed

Flat Shading n CGVR Illuminated only by directional light sources n Diffuse or viewed from infinitely far away cgvr. korea. ac. kr 8 Graphics Lab @ Korea University

Flat Shading n CGVR One Illumination Calculation per Polygon n Assign all pixels inside

Flat Shading n CGVR One Illumination Calculation per Polygon n Assign all pixels inside each polygon the same color cgvr. korea. ac. kr 9 Graphics Lab @ Korea University

Flat Shading n CGVR Objects Look Like They are Composed of Polygons OK for

Flat Shading n CGVR Objects Look Like They are Composed of Polygons OK for polyhedral objects n Not so good for ones with smooth surfaces n cgvr. korea. ac. kr 10 Graphics Lab @ Korea University

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea.

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea. ac. kr 11 CGVR Graphics Lab @ Korea University

Gouraud Shading n CGVR Smooth Surface n Represented by polygonal mesh with a normal

Gouraud Shading n CGVR Smooth Surface n Represented by polygonal mesh with a normal at each vertex cgvr. korea. ac. kr 12 Graphics Lab @ Korea University

Gouraud Shading n CGVR One Lighting Calculation per Vertex n Assign pixels inside polygon

Gouraud Shading n CGVR One Lighting Calculation per Vertex n Assign pixels inside polygon by interpolating colors computed at vertices N 1 Viewer L 1 V 1 N 2 Light N 3 Polygon cgvr. korea. ac. kr 13 Graphics Lab @ Korea University

Gouraud Shading n CGVR Bilinearly Interpolate Colors at Vertices Down and Across Scan Lines

Gouraud Shading n CGVR Bilinearly Interpolate Colors at Vertices Down and Across Scan Lines I 1 I 2 cgvr. korea. ac. kr I 3 14 Graphics Lab @ Korea University

Gouraud Shading n CGVR Smooth Shading over Adjacent Polygons Curved surfaces n Illumination highlights

Gouraud Shading n CGVR Smooth Shading over Adjacent Polygons Curved surfaces n Illumination highlights n Soft shadows n Mesh with shared normals at vertices cgvr. korea. ac. kr 15 Graphics Lab @ Korea University

Gouraud Shading n CGVR Produces Smoothly Shaded Polygonal Mesh Piecewise linear approximation n Need

Gouraud Shading n CGVR Produces Smoothly Shaded Polygonal Mesh Piecewise linear approximation n Need fine mesh to capture subtle lighting effects n Flat Shading cgvr. korea. ac. kr 16 Gouraud Shading Graphics Lab @ Korea University

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea.

Polygon Shading Algorithms n Flat Shading n Gouraud Shading n Phong Shading cgvr. korea. ac. kr 17 CGVR Graphics Lab @ Korea University

Phong Shading n CGVR What if Polygonal Mesh is too Coarse to Capture Illumination

Phong Shading n CGVR What if Polygonal Mesh is too Coarse to Capture Illumination Effects in Polygon Interiors? N 1 Viewer L 1 V 1 N 2 Light N 3 Polygon cgvr. korea. ac. kr 18 Graphics Lab @ Korea University

Phong Shading n CGVR One Lighting Calculation per Pixel n Approximate surface normals for

Phong Shading n CGVR One Lighting Calculation per Pixel n Approximate surface normals for points inside polygons by bilinear interpolation of normals from N 1 vertices Viewer Light N V N 2 L N 3 Polygon cgvr. korea. ac. kr 19 Graphics Lab @ Korea University

Phong Shading n CGVR Bilinearly Interpolate Normals at Vertices Down and Across Scan Lines

Phong Shading n CGVR Bilinearly Interpolate Normals at Vertices Down and Across Scan Lines N 1 α N 2 cgvr. korea. ac. kr 20 γ β N 3 Graphics Lab @ Korea University

Phong Shading cgvr. korea. ac. kr CGVR Wireframe Flat Gouraud Phong 21 Graphics Lab

Phong Shading cgvr. korea. ac. kr CGVR Wireframe Flat Gouraud Phong 21 Graphics Lab @ Korea University

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity cgvr. korea. ac. kr 22 Graphics Lab @ Korea University

Ray Tracing n CGVR Extension of Ray Casting Look for the visible surface for

Ray Tracing n CGVR Extension of Ray Casting Look for the visible surface for each pixel n Continue to bounce the ray around the scene n cgvr. korea. ac. kr 23 Graphics Lab @ Korea University

Ray Tracing n CGVR Global Illumination Shadows n Refractions n Inter-object reflections n Highly

Ray Tracing n CGVR Global Illumination Shadows n Refractions n Inter-object reflections n Highly Realistic vs. Computation Time 24 Reflectance Shadow cgvr. korea. ac. kr Transparency n Graphics Lab @ Korea University

Basic Ray Tracing Algorithm n CGVR For Each Pixel Ray n Primary ray o

Basic Ray Tracing Algorithm n CGVR For Each Pixel Ray n Primary ray o n Test each surface if it is intersected Intersected: Secondary ray Reflection ray o Transparent – Refraction ray o cgvr. korea. ac. kr 25 Graphics Lab @ Korea University

Basic Ray Tracing Algorithm n CGVR For Each Pixel Ray n Primary ray o

Basic Ray Tracing Algorithm n CGVR For Each Pixel Ray n Primary ray o n Test each surface if it is intersected Intersected: Secondary ray Reflection ray o Transparent – Refraction ray o cgvr. korea. ac. kr 26 Graphics Lab @ Korea University

Ray Tracing Tree n CGVR Ray tree represents illumination computation One branch reflection n

Ray Tracing Tree n CGVR Ray tree represents illumination computation One branch reflection n The other branch transmission n Terminated reach the preset maximum or strike a light source n Scene cgvr. korea. ac. kr Ray Tree 27 Graphics Lab @ Korea University

Ray Tracing Tree n CGVR Pixel intensity Sum of intensities at root node n

Ray Tracing Tree n CGVR Pixel intensity Sum of intensities at root node n Start at terminal node n If no surfaces are intersected, the intensity of background n Scene Ray Tree Ipixel Iback cgvr. korea. ac. kr 28 Graphics Lab @ Korea University

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity

Shading Methods n CGVR Ray Casting n Polygon Shading n Ray Tracing n Radiosity cgvr. korea. ac. kr 29 Graphics Lab @ Korea University

Radiosity n CGVR Goal n Simulate diffuse inter-object reflections and shadows cgvr. korea. ac.

Radiosity n CGVR Goal n Simulate diffuse inter-object reflections and shadows cgvr. korea. ac. kr 30 Graphics Lab @ Korea University

Radiosity n CGVR Basic Idea n Treat every polygon as light source cgvr. korea.

Radiosity n CGVR Basic Idea n Treat every polygon as light source cgvr. korea. ac. kr 31 Graphics Lab @ Korea University

Radiosity n CGVR Advantages Physically models shadows and indirect diffuse illumination n Independent of

Radiosity n CGVR Advantages Physically models shadows and indirect diffuse illumination n Independent of any viewpoint n n Equation Bi = Radiosity of patch i Ei = Emission of patch i ρi = Reflectivity of patch i Fi = Form-factor between patches i and j cgvr. korea. ac. kr 32 Graphics Lab @ Korea University

Form Factors n Definition n n CGVR Fraction of energy leaving patch j that

Form Factors n Definition n n CGVR Fraction of energy leaving patch j that arrives at patch i Computation Project onto unit hemisphere n Project onto unit circle base n Divide by area of circle n Project scene onto hemi-cube n Project onto unit hemisphere cgvr. korea. ac. kr 33 Project onto Hemi-cube Graphics Lab @ Korea University

Matrix Solution Methods n Matrix Formulation n Progressive Refinement CGVR Iterate shoot radiosity from

Matrix Solution Methods n Matrix Formulation n Progressive Refinement CGVR Iterate shoot radiosity from patches n O(n 2) computation, but get pretty good solutions more quickly n cgvr. korea. ac. kr 34 Graphics Lab @ Korea University

Matrix Solution Methods CGVR 1 iteration 2 iterations 24 iterations 100 iterations cgvr. korea.

Matrix Solution Methods CGVR 1 iteration 2 iterations 24 iterations 100 iterations cgvr. korea. ac. kr 35 Graphics Lab @ Korea University

Hierarchical Radiosity n CGVR Multiresolution Computation Substructure patches into quad-tree n Transfer energy using

Hierarchical Radiosity n CGVR Multiresolution Computation Substructure patches into quad-tree n Transfer energy using lower resolution mesh elements if can do so within error tolerance n O(n) computation n cgvr. korea. ac. kr 36 Graphics Lab @ Korea University

Ray Tracing & Radiosity n CGVR Dilemma: Radiosity is good at diffuse inter-object reflection

Ray Tracing & Radiosity n CGVR Dilemma: Radiosity is good at diffuse inter-object reflection n Ray tracing is good at specular inter-object reflection n n Combine them Example: compute diffuse inter-object reflections in a ray tracer n Monte Carlo methods n cgvr. korea. ac. kr 37 Graphics Lab @ Korea University

Summary n CGVR Ray Casting Flat n Gouraud n Phong n n Less Expensive

Summary n CGVR Ray Casting Flat n Gouraud n Phong n n Less Expensive Ray Tracing More Accurate n Radiosity cgvr. korea. ac. kr 38 Graphics Lab @ Korea University

Visible-line determination cgvr. korea. ac. kr 39 CGVR Graphics Lab @ Korea University

Visible-line determination cgvr. korea. ac. kr 39 CGVR Graphics Lab @ Korea University

Visible-surface determination with ambient illumination only cgvr. korea. ac. kr 40 CGVR Graphics Lab

Visible-surface determination with ambient illumination only cgvr. korea. ac. kr 40 CGVR Graphics Lab @ Korea University

Individually shaded polygons with diffuse reflection cgvr. korea. ac. kr 41 CGVR Graphics Lab

Individually shaded polygons with diffuse reflection cgvr. korea. ac. kr 41 CGVR Graphics Lab @ Korea University

Gouraud shaded polygons with diffuse reflection cgvr. korea. ac. kr 42 CGVR Graphics Lab

Gouraud shaded polygons with diffuse reflection cgvr. korea. ac. kr 42 CGVR Graphics Lab @ Korea University

Gouraud shaded polygons with specular reflection cgvr. korea. ac. kr 43 CGVR Graphics Lab

Gouraud shaded polygons with specular reflection cgvr. korea. ac. kr 43 CGVR Graphics Lab @ Korea University

Phong shaded polygons with specular reflection cgvr. korea. ac. kr 44 CGVR Graphics Lab

Phong shaded polygons with specular reflection cgvr. korea. ac. kr 44 CGVR Graphics Lab @ Korea University

Curved surfaces with specular reflection cgvr. korea. ac. kr 45 CGVR Graphics Lab @

Curved surfaces with specular reflection cgvr. korea. ac. kr 45 CGVR Graphics Lab @ Korea University

Improved illumination model and multiple lights cgvr. korea. ac. kr 46 CGVR Graphics Lab

Improved illumination model and multiple lights cgvr. korea. ac. kr 46 CGVR Graphics Lab @ Korea University

Texture mapping cgvr. korea. ac. kr 47 CGVR Graphics Lab @ Korea University

Texture mapping cgvr. korea. ac. kr 47 CGVR Graphics Lab @ Korea University

Displacement mapping cgvr. korea. ac. kr 48 CGVR Graphics Lab @ Korea University

Displacement mapping cgvr. korea. ac. kr 48 CGVR Graphics Lab @ Korea University

Reflection mapping cgvr. korea. ac. kr 49 CGVR Graphics Lab @ Korea University

Reflection mapping cgvr. korea. ac. kr 49 CGVR Graphics Lab @ Korea University