1 / 56

K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology

Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms. K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology. Hybrid Algorithms. There are two of the most popular global illumination algorithms: ray tracing and radiosity.

ruby
Télécharger la présentation

K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology

  2. Hybrid Algorithms • There are two of the most popular global illumination algorithms: ray tracing and radiosity. • A ray-tracing algorithm computes radiance values for every pixel in the final image by generating paths between the pixel and the light sources. • A radiosity algorithm computes a radiance value for every mesh element in the scene, after which this solution is displayed using any method that can project polygons to the screen. • There are algorithms which try to combine the best of both worlds.

  3. Final Gathering • Once a radiosity solution is computed and an image of the scene is generated, Gouraud shading is often used to interpolate between radiance values at vertices of the mesh, thus obtaining a smoothly shaded image. • This technique can miss significant shading features. • It is often difficult to generate accurate shadows. • Shadows may creep under surfaces. • Mach band effects may occur. • Other secondary illumination effects containing features with a frequency higher than that which the mesh can represent are also possible. • One way of solving this is to consider the radiosity solution to be a coarse precomputed solution of the light distribution in the scene.

  4. Final Gathering • During a second phase, when the image is actually generated, a more accurate per-pixel illumination value is computed, which is based on the ray-tracing algorithm. • The ray-tracing set-up for computing the radiance for a pixel is given by

  5. Final Gathering • L(p->eye) equals L(x->Θ) with x being the visible point in the scene and Θ the direction from x towards the eye. • Suppose we have a precomputed radiance solution in a diffuse scene, given by L(y) for every surface point y. • We can then acquire the value of L(x->Θ) by writing the rendering equation, approximating the radiance distribution in the kernel of the transport equation by L(y).

  6. Final Gathering • This integral can now be evaluated using Monte Carlo integration. • The main difference with the stochastic ray-tracing algorithm is that there is no recursive evaluation of the radiance distribution, since it is substituted by the precomputed radiosity solution. • Thus one gains the advantage of using an accurate per-pixel method, using a fast precomputed finite element method.

  7. Final Gathering • Various sampling strategies can be used to evaluate either of the two integrals. • In a diffuse scene, with a constant radiance value Lj for each surface element j, the equation can also be rewritten as

  8. Final Gathering • Sampling Strategy • Simple Hemisphere Sampling • The most straightforward approach is to sample random directions over the hemisphere and evaluate L at the nearest intersection point. • It is very similar to simple stochastic ray tracing and will result in a lot of noise in the final image. • Light sources will be missed by just randomly sampling the hemisphere. • Splitting the integral into a direct and indirect term is a good approach for increasing the accuracy.

  9. Final Gathering • Sampling Strategy • Importance Sampling • This approach can be used to evaluate • Construct a probability density function that matches the kernel of the integral as closely as possible. • Since we have a precomputed solution, it can be used to sample surface elements and directions to bright areas in the scene.

  10. Final Gathering • Sampling Strategy • Importance Sampling • Depending on the radiosity algorithm used, the following data may be available to construct a PDF: • Average radiance value for each surface element j. • The form factors Fi->j between surface elements i and j. This is only the case in classic radiosity, in which links between surface elements are stored explicitly.

  11. Final Gathering • Importance Sampling • An importance sampling procedure can be constructed by first selecting a surface element, and then sampling a surface point within that surface element. • The probability of picking surface element j should be proportional to with surface element i containing point x.

  12. Final Gathering • Importance Sampling • An importance sampling procedure can be constructed by first selecting a surface element, and then sampling a surface point within that surface element. • Thus, each surface element j is assigned a probability

  13. Final Gathering • Importance Sampling • The second step then involves the evaluation of For the surface element j selected in Step 1.

  14. Final Gathering • Importance Sampling • Several methods for evaluating this integral are possible. • Choosing a sample point y with uniform probability 1/Aj on surface element j. The total estimator is then given by

  15. Final Gathering • Importance Sampling • Several methods for evaluating this integral are possible. • An algorithm is available to sample a random direction with uniform probability 1/Ωj on a spherical triangle Ωj. This sampling procedure can be used to sample a surface point y by first selecting a direction Θx ∈ Ωj ; y is the point on surface element j along Θx. The total estimator is then

  16. Final Gathering • Importance Sampling • Several methods for evaluating this integral are possible. • The cosine factor cos(Nx,Θx) can be taken into account as well by using rejection sampling. • A direction is sampled on a bounding region on the hemisphere. • The bounding region needs to be chosen such that sampling according to a cosine distribution is possible. • If the sampled direction falls outside Ωj, the estimator evaluates to 0. • Alternatively, one can also generate samples until a nonrejected sample is generated.

  17. Final Gathering • Importance Sampling • Several methods for evaluating this integral are possible. • When surface element j is fully visible from point x, the point-to-surface form factor can be computed analytically, and thus no Monte Carlo sampling is needed.

  18. Final Gathering • Results • Left: the precomputed radiosity solution. • Meshing artifacts in the shading and shadows are clearly visible. • Right: the solution using final gathering. • All illumination features are much more smooth.

  19. Final Gathering • Final gathering techniques can also be extended for scenes with nondiffuse surfaces. • In this case, the nondiffuse BRDF should be included in the integral evaluation.

  20. Multipass Methods • A multipass method uses various algorithms (finite-element-based, image-based) and combines them into a single image-generation algorithm. • Care has to be taken that light transport components are not counted twice since this would introduce errors in the image. • At the same time, all possible light transport modes need to be covered by at least one pass. • A good multipass algorithm tries to exploit the various advantages of the different individual passes.

  21. Multipass Methods • Regular Expressions • Regular expressions are often used to express which light transport modes are covered by which pass. • Notations • L: One of the light sources in the scene. • D: A diffuse reflection component of the BRDF. • G: A semidiffuse or glossy reflection component of the BRDF. • S: A perfect specular component of the BRDF. • E: The eye or virtual camera. • LD+E. • A light transport path between a light source and the camera, only reflecting at diffuse surfaces • D+ indicates the path bounces off of at least one diffuse surface.

  22. Multipass Methods • Regular Expressions • LDSE • A diffuse surface, reflected in a visible specular material, would be described by the path of type LDSE. • L(D|G|S)*E • All possible paths in the scene. • * indicates zero or more reflections.

  23. Multipass Methods • Algorithms can now be characterized by describing what light transport paths they cover. • Radiosity algorithms cover all paths of type LD*E, or all diffuse bounces. • A classic ray-tracing algorithm, stopping the recursion of reflected rays at nonspecular surfaces, covers all paths of type LD0…1(G|S)E, with D0…1 indicating 0 to 1 reflections at a diffuse surface.

  24. Multipass Methods • Construction of a Multipass Algorithm • A multipass algorithm usually starts with one or more object-space methods, which store a partial approximation of the light transport in the scene. • A radiosity method might only store the diffuse light interactions and might ignore all other types of light transport. • The image-space algorithms compute radiance values per pixel, but they rely on the partially computed and stored light transport approximations of the previous passes. • To access these stored solutions, they need a read-out strategy.

  25. Multipass Methods • Construction of a Multipass Algorithm • This read-out strategy might itself include some computations or interpolations. • It is determined by the nature of the stored partial solution. • It also determines the nature of the paths that are covered by the image-space pass.

  26. Multipass Methods • Construction of a Multipass Algorithm • Some typical read-out strategies include: • Direct visualization of the stored solution • For each pixel, the stored light transport solution is accessed directly and the resulting value attributed to the pixel. • Radiosity solutions are often displayed this way. • The covered light transport paths are exactly the same as those covered by the object-space pass.

  27. Multipass Methods • Construction of a Multipass Algorithm • Some typical read-out strategies include: • Final gathering • The final gathering method reconstructs the incoming radiance values over the hemisphere for each point visible through the pixel. • These radiance values are read from the stored radiance solution. • Suppose the stored radiance solution only covers paths of type LD*. • Because the final gathering takes into account the full BRDF at the visible point through the pixel, the paths covered by this multipass algorithm are of type LD*(D|G|S)E, and LE when the light sources are directly visible.

  28. Multipass Methods • Construction of a Multipass Algorithm • Some typical read-out strategies include: • Recursive stochastic ray tracing • A recursive ray-tracing algorithm is used as a read-out strategy, but paths are only reflected at those surfaces; use only those reflection components that are not covered by the object-space pass. • Ex: If the first pass stores a radiosity solution, covering all paths of type LD*, then the recursive ray-tracing pass would only reflect rays at G or S surfaces. • At each D surface, the stored value in the precomputed solution is read out and incorporated in the estimator at that reflection point. • Thus, the covered paths are of type LD*(G|S)*E.

  29. Multipass Methods • Most multipass strategies make sure that the light transport paths covered in the different passes do not overlap. • Otherwise, some light transport might be counted twice and the resulting image will look too bright in some parts of the scene. • Every pass of the multipass algorithm covers distinct, separate types of light transport.

  30. Multipass Methods • Weighted Multipass Algorithms • An alternative approach is to have some overlap between the different passes, but weigh them appropriately. • The correct image is still obtained. • The problem is now to find the right weighting heuristics such that the strengths of each individual pass are used in the optimal way. • A very good strategy assigns weights to the different types of paths in each pass based on the respective probability density functions for generating these paths. • Thus, caustic effects might predominantly use their results from a bidirectional ray-tracing pass, while direct illumination effects might originate mostly from a ray-tracing or radiosity pass.

  31. Multipass Methods • A total of three passes are used. • First, a radiosity solution is computed, which is subsequently enhanced by a stochastic ray tracer. • This specific example covers only paths of type LD(G|S)(D|G|S)*E.

  32. Multipass Methods • A total of three passes are used. • A third pass involves a bidirectional ray tracer, which generates paths of the same type but with different probabilities due to the nature of the sampling process.

  33. Multipass Methods • The sum of the two weighted images yields the final image.

  34. Multipass Methods • When applying the weighting heuristic, one can see that the caustic on the floor (due to refraction through the glass sphere) is mostly assigned to bidirectional path tracing, while the direct illumination is mostly assigned to the radiosity and stochastic ray-tracing solution.

  35. Multipass Methods • Some difficult effects, which are not well covered by either method, are weighted more equally, such as the reflection in the right wall of the white panel above the light source.

  36. Global Reflectance Distribution Function (GRDF) • Given the transport equation of L->,it is obvious that each single radiance value in the scene is dependent on the initial distribution given by L e ->. • Such dependency is expressed by the importance function W<-. • A direct function, not a recursive one, is introduced which expresses the relation between a single L(x->θ) value at an arbitrary chosen point, and the initial L e -> distribution. • This function is called global reflectance distribution function or GRDF.

  37. Global Reflectance Distribution Function (GRDF) • The GRDF is a four-dimensional transfer function that describes the entire light transport in a three-dimensional scene between two pairs (x,θ) and (y,ψ). • It has the characteristics of both an incident and an exitant function, since the transfer can happen in both directions. • The GRDF is written as Gr(x<- θ,y->ψ).

  38. Global Reflectance Distribution Function (GRDF) • The Gr(x<- θ,y->ψ) describes some sort of global transport between two point-direction pairs and can be thought of as the contribution one pair makes, if it would act as a differential source of transport quantity, to the transport quantity measured at the other pair. • Namely, the GRDF is given by

  39. Global Reflectance Distribution Function (GRDF) • Gr(x<- θ,y->ψ) expresses the influence of the total power leaving dAx through a solid angle dωθ on the final value of the radiance measured at y in direction ψ , through any number of reflections on intermediate surfaces. • Therefore, it can be considered as some kind of response function in the three-dimensional environment. • In mathematical physics, a function like the GRDF is called the Green’s function of a problem.

  40. Global Reflectance Distribution Function (GRDF) • Since the transport is reciprocal, a similar equation for the importance is obtained: • Differentiating the given equations yields

  41. Global Reflectance Distribution Function (GRDF) • The expression is very similar to the definition of the common BRDF, which describes a similar property for exitant radiance and incident irradiance at a single surface point. • The GRDF extends this concept and describes the relationship between any two radiance or importance values, taking into account all possible reflections in the scene. • The BRDF can be considered as a special case of the GRDF.

  42. Global Reflectance Distribution Function (GRDF) • The GRDF allows us to describe the global illumination problem in a very short and elegant format, independent of any initial distributions for self-emitted radiance or importance. • The GRDF is only dependent on the geometry of the scene and the reflective properties of the surfaces. • No positioning of light sources is assumed, nor is it assumed that we know where we will place the sources of importance for which flux values need to be computed.

  43. Global Reflectance Distribution Function (GRDF) • If the GRDF would be known, it is possible to compute various fluxes for a number of light sources and importance distributions. • It suffices to evaluate Which is a nonrecursive integral. • In practice, this may be difficult to achieve, since the GRDF has as arguments two positions and two directions. • Storing the GRDF is memory intensive.

  44. Bidirectional Tracing • Ray tracing traces paths through the scene starting at the surface points, which eventually end at the light sources. • Light tracing, another path-tracing algorithm, does the opposite: paths start at the light sources and end up in any relevant pixels. • Bidirectional ray tracing combines both approaches in a single algorithm and can be viewed as a two-pass algorithm in which both passes are tightly intertwined. • Bidirectional ray tracing generates paths starting at the light sources and at the surface point simultaneously and connects both paths in the middle to find a contribution to the light transport between the light source and the piont for which a radiance value needs to be computed.

  45. Bidirectional Tracing • Bidirectional tracing combines the specific advantages of ray tracing as well as light tracing. • Bidirectional path tracing is one of the few algorithms that start from the formulation of the global reflection distribution function (GRDF). • The flux Ф(S) is given by

  46. Bidirectional Tracing • The core idea of the algorithm is that one has the availability of two different path generators when computing a Monte Carlo estimate for the flux through a certain pixel: • An eye path is traced starting at a sampled surface point y0 visible through the pixel. • By generating a path of length k, the path consists of a series of surface points y0, y1, …, yk. • The length of the path is controlled by Russian roulette. • The probability of generating this path can be composed of the individual PDF values of generating each successive point along the path. • Similarly, a light path of length l is generated starting at the light source. This path, x0, x1, …, xl, also has its own probability density distribution.

  47. Bidirectional Tracing • By connecting the endpoint yk of the eye path with the endpoint xl of the light path, a total path of length k+l+1 between the importance source S and the light sources is obtained. • The probability density function for this path is the product of the individual PDFs of the light and eye paths. • An estimator for the Ф(S) using this single path is given by

  48. Bidirectional Tracing • Paths of a certain length can now be generated by using different combinations. • Example • A path of length 3 could be generated by a light path of length 2 and an eye path of length 0. • Or by a light path of length 1 and an eye path of length 1 • Or by a light path of length 0 and an eye path of length 2.

  49. Bidirectional Tracing • Stochastic ray tracing and light tracing are special cases of bidirectional ray tracing. • When tracing a shadow ray in stochastic ray tracing, we actually generate a light path of length 0, which is connected to an eye path.

  50. Bidirectional Tracing

More Related