Lecture 13 Global Illumination 1: Ray Tracing And Radiosity

1y ago
4 Views
2 Downloads
1.76 MB
65 Pages
Last View : 21d ago
Last Download : 2m ago
Upload by : Maxton Kershaw
Transcription

Computer Graphics Lecture 13 Global Illumination 1: Ray Tracing and Radiosity Taku Komura 1

Background Rendering methods can be classified into Local Illumination techniques Global Illumination techniques

Local Illumination methods Considers light sources and surface properties only. Phong Illumination, Phong shading, Gouraud Shading Using techniques like Shadow maps, shadow volume, shadow texture for producing shadows Using techniques like mirroring and environment mapping for simulating reflections Very fast Used for real-time applications such as 3D computer games

Local Illumination : problems Images synthesized appear artificial No inter-surface reflections Ambient light is a very simplified model Requires the user to add the effects like shadows and mirrors one by one

Global Illumination Methods that simulate not only the direct illuminations but also the indirect illuminations Global illuminations can handle Reflection (one object in another) Refraction (Snell’s Law) Shadows color bleeding under a unified framework 5

Color bleeding

Global Illumination Methods Radiosity Monte-Carlo ray tracing, Photon Mapping Requires more computation and is slow 7

Today : Global Illumination Modules and Methods Ray Tracing Radiosity 8

Ray Tracing [Appel ’68] One of the most popular methods used in 3D computer graphics to render an image Different from the rasterization-based approach Good at simulating specular effects, producing shadows Also used as a function for other global illumination techniques 9

Ray Tracing [Appel ’68] Tracing the path taken by a ray of light through the scene Rays are cast to each pixel. They are reflected, refracted, or absorbed whenever they intersect objects Let’s look into an example 10

The ray misses objects the pixel is colored by the background color 11

When the ray hits an object: 12

Check if the fragment is shadowed A secondary ray, called a "shadow" ray, is shot towards the light sources 13

Shadow Ray If this shadow ray hits another object before it hits a light source, then the first intersection point is in the shadow of the second object. We only apply the ambient term for that light source. Otherwise do the local Phong Illumination 14

Example shadow 15

Reflected Ray Also, when a ray hits an object, a reflected ray is generated which is tested against all of the objects in the scene. 16

Contribution from the reflected ray If the reflected ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point. 17

Transmitted Ray If the intersected object is transparent, then a transmitted ray is generated and tested against all the objects in the scene The transmitted ray is produced towards the direction of refraction 18

Contribution from the transmitted ray As with the reflected ray, if the transmitted ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point. 19

Rays to be considered Shadow ray Reflection ray Transmitted ray Sum the color based on the three rays I Ilocal Kr * R Kt * T Ilocal : color by local illumination, R : color by reflection, T : color by transmission, and Kr, Kt are coefficients 20

Ray Tree [Whitted ‘80] The reflection rays and transmitted rays are recursively launched when they hit other surfaces And the light is brought back to the previous hit L3 N R L L1 T1 R3 V (Viewer direction) L2 R1 T221 T R2

Test Scene. Ray tree depth 1. Note only ambient shade on mirror and teapot 22

Test Scene. Ray tree depth 2. Note only ambient shade on reflection of mirror and teapot. 23

Test Scene. Ray tree depth 3. Note only ambient shade on reflection of mirror in teapot. 24

Test Scene. Ray tree depth 4. Note ambient shade on reflection of teapot in reflection of mirror in teapot. 25

Test Scene. Ray tree depth 5. 26

Test Scene. Ray tree depth 6. 27

Test Scene. Ray tree depth 7. 28

Ray Tree (2): Color of Specular Surfaces The color is computed per each ray Substituting them all into one equation, we get 29

When to stop ? When the a ray hits a perfectly diffusive surface For specular surface, we can define a fixed depth Or when the multiplication of the coefficients reach some threshold Hall, R. A. and Greenberg D.P. , "A Testbed for Realistic Image Synthesis", IEEE Computer Graphics and Applications, 3(8), Nov., 1983 30

Examples of Ray-traced images. 31

Accelerating Ray Tracers Ray Tracing is very time-consuming because of intersection calculations Solutions: Use perspective projection for the first ray Reduce the number of rays / polygon intersection check Bounding volumes 32

Reducing Ray-Object Intersections Bounding Volumes: – First test for intersection with the bounding volume – Then only if there is an intersection, against the objects enclosed by the volume. – Can save a lot of computation when the ray does not hit the bunny – Can use boxes, spheres 33

Using Hierarchical Structures – Enclose groups of objects in sets of hierarchical bounding volumes – Oct-tree, KD-tree (axis aligned boxes) – Bounding Volume Hierarchy (boxes, spheres) 34

Bounding Volume Hierarchy – Associate bounding volume with each object – The bounding volume does not partition – the bounding volumes can overlap each other. – If ray misses a node’s bounding volume, then no need to check any node beneath it – If ray hits a node’s BV, then check with its children 35

Producing the Bounding Volume Hierarchy Find bounding box of objects 36

Producing the Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups 37

Producing the Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse 38

Producing the Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse 39

Producing the Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse 40

Producing the Bounding Volume Hierarchy Find bounding box of objects Split objects into two groups Recurse 41

Where to split objects? At midpoint OR Sort, and put half of the objects on each side 42

Computing the Intersection 43

Ray Tracing : Drawbacks Can we produce soft shadows? Can we produce bleeding effects? Can we render caustics? Can we generate shadows of refractive objects? 44 03/11/11

Color Bleeding 45

Caustics 46

Light Transport Notations When describing a light path, it is sometimes necessary to distinguish the types of reflections L a light source E the eye S a specular reflection D a diffuse reflection 47 03/11/11

Light Transport Notations (2) We may also use regular expressions: (k) : one or more of k events (k)* : zero or more of k events (k)?: zero or one of k events (k k’) : k or k’ 48 03/11/11

Light Transport Notations LDD LSD 49

Tough Cases Caustics Light focuses through a specular surface onto a diffuse surface Which direction should secondary rays be cast to detect caustic? Bleeding Color of diffuse surface reflected in another diffuse surface Which direction should secondary rays be cast to detect bleeding? What is needed for simulating these phenomena? 50

Today : Global Illumination Modules and Methods Ray Tracing Radiosity 51

The Radiosity Method (85’-) Based on a method developed by researchers in heat transfer in 1950s Applied to computer graphics in the mid 1980s by Michael Cohen Tomoyuki Nishita

The Radiosity Method (85’-) Can simulate inter-surface reflection Can produce nice ambient effects Can simulate effects such as Soft shadows, color bleeding Can only handle diffuse color need to be combined with raytracing to handle specular light

The Radiosity Model At each surface in a model the amount of energy that is given off (Radiosity) is comprised of Bj the energy that the surface emits internally (E), plus the amount of energy that is reflected off the surface (ρH)

The Radiosity Model (2) The amount of incident light hitting the surface can be found by summing for all other surfaces the amount of energy that they contribute to this surface Form factor

Form Factor (Fij) The fraction of energy that leaves surface i and lands on surface j Between differential areas, it is The overall form factor between i and j is

Form Factor (2) Also need to take into account occlusions The form factor for those faces which are hidden from each other must be zero

The Radiosity Matrix The radiosity equation now looks like this: The derived radiosity equations form a set of N linear equations in N unknowns. This leads nicely to a matrix solution: Solve for Bi – Use methods like Gauss-Seidal

Radiosity Steps: 1. Generate Model 2. Compute Form Factors and set the Radiosity Matrix 3. Solve the linear system 4. Render the scene If objects are moved, start over from step 2. If the lighting is changed, start from step 3. If the reflectance parameters of the scene are modified, recompute the radiosity matrix If the view parameters are changed, the system must merely re-render the scene (step 4).

Radiosity Features: The faces must be subdivided into small patches to reduce the artefacts The computational cost for calculating the form factors is expensive Quadratic to the number of patches Solving for Bi is also very costly Cubic to the number of patches Cannot handle specular light

Hemicube: by Michael Cohen’85 Accelerates the computation of the form factor The form factor for the right four faces with respect to a small patch in the bottom is the same Then, we can project the patches onto a hemicube

Hemicube (2) Prepare a hemicube around the patch i Project those polygons you want to compute the form factor with patch i onto the hemicube Then, compute the form factor between them

Hemicube (3) This can be done by perspective projection We can use the Z-buffer algorithm to find the closest polygon Handling the occlusion Setting the form factor of the pairs that occlude each other to zero

Hemicube (4) The form factor between each pixel of the hemicube and the patch at the origin can be pre-computed and saved in a table Only need 1/8 of those in the top pixel ¼ of those in the side are needed, thanks to symmetry

Recommended Reading Foley at al. Chapter 16, sections 16.11, 16.12 and 16.12.5. Introductory text Chapter 14 sections 14.6 and 14.7. An Efficient Ray-Polygon Intersection by Didier Badouel from Graphics Gems I Most graphics texts cover recursive ray tracing. 65

Local Illumination methods Considers light sources and surface properties only. Phong Illumination, Phong shading, Gouraud Shading Using techniques like Shadow maps, shadow volume, shadow texture for producing shadows Using techniques like mirroring and environment mapping for simulating reflections Very fast Used for real-time applications such as 3D computer

Related Documents:

Introduction of Chemical Reaction Engineering Introduction about Chemical Engineering 0:31:15 0:31:09. Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Lecture 25 Lecture 26 Lecture 27 Lecture 28 Lecture

Course #16: Practical global illumination with irradiance caching - Intro & Stochastic ray tracing Direct and Global Illumination Direct Global Direct Indirect Our topic On the left is an image generated by taking into account only direct illumination. Shadows are completely black because, obviously, there is no direct illumination in

indirect illumination in a bottom-up fashion. The resulting hierarchical octree structure is then used by their voxel cone tracing technique to produce high quality indirect illumination that supports both diffuse and high glossy indirect illumination. 3 Our Algorithm Our lighting system is a deferred renderer, which supports illumination by mul-

body. Global illumination in Figure 1b disam-biguates the dendrites' relative depths at crossing points in the image. Global illumination is also useful for displaying depth in isosurfaces with complicated shapes. Fig-ure 2 shows an isosurface of the brain from magnetic resonance imaging (MRI) data. Global illumination

a) Classical illumination with a simple detector b) Quantum illumination with simple detectors Figure 1. Schematic showing LIDAR using classical illumination with a simple detector (a) and quantum illumination with simple detectors (b), where the signal and idler beam is photon number correlated. The presence of an object is de ned by object re

Lecture 1: A Beginner's Guide Lecture 2: Introduction to Programming Lecture 3: Introduction to C, structure of C programming Lecture 4: Elements of C Lecture 5: Variables, Statements, Expressions Lecture 6: Input-Output in C Lecture 7: Formatted Input-Output Lecture 8: Operators Lecture 9: Operators continued

46. Wrap the remaining piece of EPT sealer that you cut into three equal pieces around the interior illumination light connector. 47. Plug the interior illumination light connector into the interior illumination light harness 2-pin connector, and secure them to the interior illumination light

Computer vision algorithm are often sensitive to uneven illumination so correcting the illumination is a very important preprocessing step. This paper approaches illumination correction from a modeling perspective. We attempt to accurately model the camera, sea oor, lights and absorption of