Presentation is loading. Please wait.

Presentation is loading. Please wait.

Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Radiosity K. H. Ko School of Mechatronics Gwangju Institute.

Similar presentations


Presentation on theme: "Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Radiosity K. H. Ko School of Mechatronics Gwangju Institute."— Presentation transcript:

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

2 2 Introduction Ray-tracing algorithms directly compute the intensity of light passing through the pixels of the virtual screen. In contrast, there exist methods that compute a so-called world space representation of the illumination in a three-dimensional scene. The main advantage of computing the illumination in object space is that generating new views of a model takes less work, compared to rendering from scratch.  Graphics hardware can be used for real-time rendering of an illuminated model with colors derived from the precomputed average diffuse illumination. Also path tracing can be augmented to exploit precomputed illumination in object space, allowing very high image quality.  It is called a two-pass method.

3 3 Introduction The most well-known algorithm for computing an object space representation of illumination is the classic radiosity method. Three classes of radiosity algorithms are discussed.  Stochastic relaxation methods It is based on stochastic adaptations of classic iterative solution methods for linear systems such as the Jacobi, Gauss-Seidel, or Southwell iterative methods.

4 4 Introduction Three classes of radiosity algorithms are discussed.  The solution of linear systems is one of the earliest applications of the Monte Carlo method. They are based on the notion of a discrete random walk.  The third class of Monte Carlo radiosity methods is very similar to the random walk methods for linear systems but solves the radiosity or rendering integral equation directly, rather than the radiosity linear system. The random walks of these methods are nothing but simulated photon trajectories.  The density of surface hit points of such trajectories is proportional to radiosity.

5 5 Introduction Such three classes of Monte Carlo radiosity methods can be made more efficient by applying variance-reduction techniques and low- discrepancy sampling. Monte Carlo radiosity methods all share one very important feature:  Unlike other radiosity algorithms, they do not require the computation and storage of so-called form factors.  This is possible because form factors can be interpreted as probabilities that can be sampled efficiently. Because the problems of accurate form factor computation and their storage are avoided, Monte Carlo radiosity methods can handle much larger models in a reliable way.  They are also significantly easier to implement and use than other radiosity methods.  They provide visual feedback very early on and converge gracefully.  They are much faster.

6 6 Classic Radiosity The basic idea of the classic radiosity method is to compute the average radiosity B i on each surface element or patch i of a three-dimensional model.

7 7 Classic Radiosity The input of the classic radiosity method consists of a list of patches (triangles, for example) with their average self-emitted radiosity B i (left) and reflectivity ρ i (middle) given. These data suffice in order to compute the average total radiosities Bi (right), including the effect of light bouncing around. The computed radiosities are converted to display colors for each patch. The resulting illuminated model can be rendered from any viewpoint, at interactive rates using graphics hardware.

8 8 Classic Radiosity The input consists of a list of such patches.  Most often the patches are triangles or convex quadrilaterals.  Or quadratic surface patches have been explored as well. With each patch i, the self-emitted radiosity B i e (dimensions: [W/m 2 ]) and reflectivity ρ i (dimensionless) are given. The self-emitted radiosity is the radiosity that a patch emits on its own, even if there were no other patches in the model or all other patches were perfectly black. The reflectivity is a number between 0 and 1.  It indicates what fraction of the power incident on the patch gets reflected.  The rest gets absorbed.

9 9 Classic Radiosity Such data suffice in order to compute the total emitted radiosity B i (dfimensions:[W/m 2 ]) by each patch, containing the radiosity received via any number of bounces from other patches in the scene as well as the self-emitted radiosity. Visualization from an arbitrary viewpoint can be done using graphics hardware, allowing interactive walks through an illuminated model. The classic radiosity method is an instance of a larger class of numerical methods called finite element methods. There exist many advanced techniques based on the classic radiosity method but in this class only a concise derivation of the underlying equations are presented.

10 10 Classic Radiosity There are three different ways to describe the classic radiosity method.  By the general rendering equation.  By a simplification of it for purely diffuse environments  By a discretized version of the latter.

11 11 Classic Radiosity The General Rendering Equation  Light transport in a three-dimensional environment is described by the rendering equation.  The average radiosity B i emitted by a surface patch i with area A i is therefore given by where

12 12 Classic Radiosity The Radiosity Integral Equation  On purely diffuse surfaces, self-emitted radiance L e (x) and the BRDF f r (x) do not depend on directions Θ and Θ’. The rendering equation then becomes  The incident radiance L(x<-Θ’) still depends on incident direction.

13 13 Classic Radiosity The Radiosity Integral Equation  The integral over the hemisphere can be transformed into an integral over all surfaces S in the scene.  The result is an integral equation in which no directions appear anymore.

14 14 Classic Radiosity The Radiosity Integral Equation  In a diffuse environment, radiosity and radiance are related as B(x) = πL e (x).  Multiplication by π of the left-and right-hand sides of the equation yields the radiosity integral equation:

15 15 Classic Radiosity The Radiosity Integral Equation  The kernel of the integral equation is  Θ xy is the direction pointing from x to y.  R 2 xy is the square distance between x and y.  V(x,y) is the visibility predicate.

16 16 Classic Radiosity The Radiosity Integral Equation  B i becomes

17 17 Classic Radiosity The Radiosity System of Linear Equations  Often, integral equations are solved by reducing them to an approximate system of linear equations by means of a procedure known as Galerkin discretization.  Let’s assume the radiosity B(x) is constant on each patch i, B(x) = B’ i, x ∈ S i.

18 18 Classic Radiosity The Radiosity System of Linear Equations  The equation B(x) can be converted into a linear system

19 19 Classic Radiosity The Radiosity System of Linear Equations  If we now also assume that the reflectivity is constant over each patch, ρ(x) = ρ i, x ∈ S i, the following classical radiosity system of equations results:

20 20 Classic Radiosity The Radiosity System of Linear Equations  The radiosities B’I that result after solving the system of linear equations are only an approximation for the average radiosities.  The true radiosity B(y), which was replaced by B’j in the equation is in practice only very rarely piecewise constant. For this reason, we will denote both the average radiosity and the radiosity coefficients by B i.

21 21 Classic Radiosity The steps of the classic radiosity method.  Discretization of the input geometry into patches i. For each resulting patch I, a radiosity value (per considered wavelength) B i will be computed.  Computation of form factors F ij for every pair of patches i and j.  Numerical solution of the radiosity system of linear equations.  Display of the solution, including the transformation of the resulting radiosity values Bi (one for each patch and considered wavelength) to display colors.  This involves tone mapping and gamma correction.

22 22 Classic Radiosity In practice these steps are interwined.  Form factors are only computed when they are needed.  Intermediate results are displayed during system solution.  In adaptive and hierarchical radiosity, discretization is performed during system solution.

23 23 Classic Radiosity Each step of the classic radiosity method is nontrivial. Problems  Solving the linear systems It could be very large. However, the radiosity system of linear equations is very well-behaved. So simple iterative methods such as Jacobi or Gauss- Seidel iterations converge after relatively few iterations.

24 24 Classic Radiosity Problems  Scene discretization The patches should be small enough to capture illumination variations such as near shadow boundaries.  The radiosity B(x) across each patch needs to be approximately constant. The number of patches shouldn’t be too large.  This would result in exaggerated storage requirements and computation times.

25 25 Classic Radiosity Problems  Scene discretization The image artifacts that may result from an improper discretization.

26 26 Classic Radiosity Meshing artifacts in radiosity with constant approximations (left) include undesired shading discontinuities along patch edges. Gouraud shading can be used to blur these discontinuities. Wherever the radiosity varies smoothly, a higher-order approximation of radiosity on each patch results in a more accurate image on the same mesh.  However, artifacts remain near discontinuities such as shadow boundaries.

27 27 Classic Radiosity Problems  Form factor computation Even simple objects in a scene may have to be tessellated into thousands of small patches each, on which the radiosity can be assumed to be constant.  For this reason, scenes with hundreds of thousands of patches are quite normal. Between each pair of patches, a form factor needs to be computed.  The number of form factors can thus be huge so that the mere storage of form factors in computer memory is a major problem.

28 28 Classic Radiosity Problems  Form factor computation Each form factor requires the solution of a nontrivial, four-dimensional integral.  The integral will be singular for abutting patches, where the distance r xy in the denominator vanishes.  The integrand can also exhibit discontinuities of various degrees due to changing visibility.

29 29 Classic Radiosity The form factor integral contains the square distance between points in the denominator.  This causes a singularity for abutting patches (left).  Changing visibility introduces discontinuities of various degrees in the form factor integrand (right). Due to this problem, reliable form factor integration is a difficult task.

30 30 Classic Radiosity To handle such problems,  Custom algorithms form factor integration: hemicube algorithm, shaft culling ray- tracing acceleration, etc.  Discontinuity meshing  Adaptive and hierarchical subdivision,  Clustering  Form factor caching strategies  Use of view importance  Higher-order radiosity approximations

31 31 The Form Factors The robust and efficient computation of the form factors F ij, between each pair of input patches is a major problem with the classic radiosity method.  The form factors can be viewed as probabilities. The fact that form factors are probabilities that can be sampled efficiently leads to algorithms that allow us to solve the radiosity system of equations without the need to ever compute the value of a form factor.

32 32 The Form Factors The form factor F ij is given by the following four-dimensional integral:

33 33 The Form Factors Properties  The form factors are all positive or zero in a scene consisting of closed, opaque objects. They cannot be negative because the integrand is positive or zero. They will be equal to zero for a pair of patches i and j that are mutually invisible.

34 34 The Form Factors Properties  The form factors F ij between a patch i and all other patches j in a scene sum to at most one. If the scene is closed, then

35 35 The Form Factors Properties  The form factors F ij between a patch i and all other patches j in a scene sum to at most one. If the scene is not closed, the sum of the form factors is less than 1.

36 36 The Form Factors Properties  The form factors satisfy the following reciprocity relation:

37 37 The Form Factors  The second contribution is the fraction of the irradiance Σ j F ij B j at i that gets reflected. The form factor F ij indicates what fraction of the irradiance on i originates at j. Radiosities and fluxes are related as P i = A i B i and P ei = A i B ei.

38 38 The Form Factors By multiplying both sides by A i and using the reciprocity relation for the form factors, we get a system of linear equations relating the power P i emitted by the patches in a scene.

39 39 The Form Factors This system states that the power P i emitted by patch i also consists of two parts:  The self-emitted power P ei  The power received and reflected from other patches j. The form factor F ji indicates the fraction of power emitted by j that lands on i, or conversely, F ij indicates the fraction of power emitted by i that lands on j.

40 40 The Form Factors Since there is conservation of radiance, the total amount of power emitted by i and received on other patches j must equal P i in a closed scene. In a nonclosed scene, some part of the power P i will disappear into the background, explaining why the sum of the form factors F ij will be less than 1 in that case.

41 41 The Form Factors Form Factor Sampling Using Local Lines  Let i be the source of a number of N i of virtual particles that behave like photons originating on a diffuse surface.  The number N ij of these particles that land on the second patch j yields an estimate for the form factor: N ij /N i ≈F ij.

42 42 The Form Factors Form Factor Sampling Using Local Lines  Consider a particle originating at a uniformly chosen location x on S i and being shot into a cosine-distributed direction Θ with regard to the surface normal N x at x. The probability density p(x,Θ) associated with such a particle is

43 43 The Form Factors Form Factor Sampling Using Local Lines  The PDF is properly normalized:

44 44 The Form Factors Form Factor Sampling Using Local Lines  Let χ j (x,Θ) be a predicate taking value 1 or 0 depending on whether or not the ray shot from x into Θ hits a second patch j.  The probability P ij that such a ray lands on a second patch j then is 

45 45 The Form Factors Form Factor Sampling Using Local Lines  When shooting N i such particles from i, the expected number of this on patch j will be N i F ij.  The more particles shot from i (greater N i ), the better the ratio N ij /N i will approximate F ij.  We will not need to compute form factors explicitly. The important thing for us is that the probability that a single such particle hits a patch j equals the form factor F ij. If we are given a patch i, we can select a subsequent patch j among all patches in the scene, with probability equal to the form factor F ij by shooting a ray from i.


Download ppt "Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Radiosity K. H. Ko School of Mechatronics Gwangju Institute."

Similar presentations


Ads by Google