380 likes | 573 Views
Computer Graphics. Lecture Notes #15 Illumination III View Independent Rendering. We’ll look at two methods. Bidirectional ray tracing In addition to backward ray tracing (last lecture) we perform forward ray tracing, from light sources – often identical code for each direction.
E N D
Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering
We’ll look at two methods • Bidirectional ray tracing • In addition to backward ray tracing (last lecture) we perform forward ray tracing, from light sources – often identical code for each direction. • Problem is to match up rays for full transport of light. • Radiosity • Models diffuse interactions between surfaces. • Considers whole scene at once, each polygon a source. • Both do not require the ambient intensity hack. Lecture Notes #15
A * E L B * * - these transports would be missed by conventional RT. C 1. Bidirectional Ray Tracing Lecture Notes #15
Bidirectional Ray Tracing Forward ray tracing – source to surfaces, illuminates surfaces. Backward (conventional) ray tracing – eye to surfaces, sees lit surfaces. Accumulate photon hits for surface intensity – render from eye pt. Lecture Notes #15
Bidirectional Ray Tracing • Computationally expensive. • Much more accurate model though. • Real problem is number of photons to trace. • Can use refinement methods: • Trace so many photons, render and check… • and so on until rendering acceptable. • Area sampling techniques can be used. Lecture Notes #15
Bidirectional example Single Pass (Conventional RT) Two Pass (Bidirectional) Note : caustic due to red transparent ball Lecture Notes #15
Bidirectional example 200 rays used in lighting pass 400 rays used in lighting pass Lecture Notes #15
Bidirectional example • 800 rays used in lighting pass. • Note: • - improved caustic definition, • - lighting effect of mirror, • reflection of caustic, • shadowing due to mirror • lighting. Lecture Notes #15
Summary of bidirectional RT • Trace rays from light source to surfaces. • Gives secondary lighting and caustics that conventional ray tracing misses. • Accumulate surface hits – may require large number of hits for adequate intensity. • Code for both ray trace directions can be identical. Lecture Notes #15
2. Radiosity method. • Calculates diffuse terms by considering scene as a whole and accounting for inter-object reflections. • View independent method. • Ray tracing represents light as rays shot from one point to another. • Radiosity considers how the total light energy in the scene is distributed among the surfaces. • Light sources are not treated differently in radiosity – every surface is a light source. Lecture Notes #15
Radiosity method. Radiosity = amount of energy leaving a surface per unit area, per unit time ( W / m2 ). Form factorij = ratio of energy leaving surface j that arrives at surface i. The Radiosity problem : - Estimate the form factors - Solve for the entire scene. Lecture Notes #15
Example form factors. Lecture Notes #15
Estimation of form factor by projection of the object onto a hemicube Lecture Notes #15
Comparison of Illumination techniques • Using a grammar to define the path of light (due to Heckbert): • L (source); D (diffuse refl.); S (specular refl.); E (eye/view point). • Ray tracing handles: • LE; LS*E; LDS*E • Radiosity handles: • LE; LD*E • Polygon renderers handle: • LE; LDE • Bidirectional ray tracing handles: • LE; LS*E; LDS*E; LD*E; and LS*DS*E • and, in general, L(S|D)*E, but D* not so interesting. Lecture Notes #15
Summary of Global illumination. • Simulate interactions between objects. • Shadows. • Reflections. • Refraction. • Diffuse inter-reflections. • Need good object material information. • Non real-time, non interactive…but, as ever in computer graphics, we can cheat! Lecture Notes #15
How to cheat ! • Can use texture mapping to replicate global illumination effects in a scanline renderer. • Reflections : • Environment maps • Shadows : • Shadow buffer method. • Diffuse effects : • Light maps. • Surface details • Bump maps. Lecture Notes #15
Environment maps. Escher’s gazing ball • Capture, or render an image corresponding to the reflection of the scene in a sphere centered at the object. • Calculate texture coordinates corresponding to a reflective mapping. • Image indexed by surface normal. • Maps entire field of view to circle. • Resolution depends upon orientation. Lecture Notes #15
Environment mapping. • Calculate texture coordinates mapping reflection image to model • Need to re-calculate with viewer motion. • Very much an approximation to reflection • Object doesn’t reflect itself • No change in reflection with position change. Lecture Notes #15
Cubical environment map. • Produce from 6 perspective images. • Possible to produce using standard renderer, or from photographs. • More uniform resolution than spherical map. • Easy texture coordinate calculation. Lecture Notes #15
Illumination maps. • Simulate diffuse radiosity-type effects. • For a fraction of the cost ! • Popular in games. reflectance illuminance radiosity Lecture Notes #15
Light maps in Quake. Can use much lower resolution for light map. Lecture Notes #15
Shadow maps. • Calculate shadows by rendering scene from the point of view of the light source. • Test each face with the z-buffer to see if it is the closest object and hence not in shadow. • If not closest – no light contribution. • Accumulate result into texture map, multiply by surface colour. Lecture Notes #15
Shadow maps. Lecture Notes #15
= + Bump maps. • Instead of rendering small scale surface detail, use a texture map to perturb the surface normal. Lecture Notes #15