Presentation is loading. Please wait.

Presentation is loading. Please wait.

COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 1 Global illumination algorithms Graphics.

Similar presentations


Presentation on theme: "COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 1 Global illumination algorithms Graphics."— Presentation transcript:

1 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 1 Global illumination algorithms Graphics Systems / Computer Graphics and Interfaces

2 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 2 Global illumination algorithms Objective: calculating the color of each point from the direct illumination of a light source, plus the sum of all reflections from nearby surfaces. In models local lightingAs seen above, the color of each point is defined by the light intensity that reaches directly by one or more light sources. Global illumination with respect to Equation Rendering: Global illumination algorithms to study: Ray Tracing Radiosity I (x, x ') Lighting x 'over x g (x, x ') Geometric term: = 0 If x and x ' not mutually come = 1 / r 2 If x and x ' have come ( r : Dist. between them) Ɛ (x, x ') Light emission from x 'to x ρ(X, x ', x'') Perc. Lighting coming from x'' and that is reflected in x ' toward x

3 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 3 Global illumination algorithms Ray Tracing Ray Tracing The algorithm is an extension to the Algorithm Ray-Casting previously seen. The algorithm depends on the position of the observer (view dependent algorithm). The viewing plane is discretized at sampling points (pixels or...); It is passed by each sampling point, a light ray that the observer toward the inside of the scene. The track (tracing) each beam will allow to consider the contributions of reflection between nearby faces. R 1 is the vector of maximum reflection: R 1 = V - 2 (V.N) N The initial light intensity is: I = I local K = the I the + K d (N.L) pixels observer R1R1 Light Shadow ray V

4 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 4 Global illumination algorithms Ray Tracing The interception of the reflected beam with the remaining objects are registered for the contributions of these in spot lighting. The attenuation due to the distance of the face may be considered. The process is recursive. pixels observer light The light intensity is now: I = I local + K r * I reflection I reflection is recursively calculated k r is a coefficient of reflection (similar to k s ) Note: In each interception is necessary to determine what the closest object.

5 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 5 Global illumination algorithms Ray Tracing If objects are transparent or semitransparent is necessary to consider the rays transmitted into the interior of the object (or outside). For example, the radius T 1 and T 2. pixels observer light T2T2 The calculation of the intensity is now: I = I local + K r * I reflected + K t * I transmitted I reflected and R transmitted are calculated recursively T1T1

6 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 6 Global illumination algorithms Ray Tracing For each pixel builds up a tree of intersections. The final pixel color is determined by traversing the tree from the leaves to the root and calculating the contributions of each branch according to the model of reflection. In opaque objects there is the transmitted beam. The branch of the tree ends when the beam hits a reflector or not the branch object reaches a certain predetermined depth

7 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 7 Global illumination algorithms Ray Tracing The Ray Tracing algorithm is advantageous because: shadows, reflections and refractions are easily incorporated simulates reasonably well the specular effects The Ray Tracing algorithm has high computational costs because: the cost of calculating the intersections is high does not simulate well the effects of diffuse lighting (Need for other variants, more complex) The optimization is done in two areas: 1.Decreased number of rays to be processed. 2.Decreased number of intersections testing Software Freeware Ray-Tracing: http://www.povray.org

8 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 8 Global illumination algorithms Ray Tracing Decreased number of rays to be processed –"Item Buffers" - Are determined which areas of the screen where are the objects (pre-process /, ZBuffer) –"Adaptive Tree-Depth Control" - No need to carry all the branches of the tree shading to its maximum depth (importance of a light beam on a pixel belonging, diminishing reflection or transmission) –"Light-Buffers" - Each light source lists are associated with the objects that surround it (in each direction and order of removal); processing an intersection rays are generated by reflection, and transmission for the light sources; the latter, since its direction defined, have limited the chances of intersection with the objects that are in the respective list.

9 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 9 Global illumination algorithms Ray Tracing Decreased number of intersections testing –Volumes Surrounds - Before making the intersection of a ray with an object test, tries to its intersection with a simple volume (usually a box) surrounding the object. This pretest is very fast (the box is lined faces with three axles) and immediately excludes many complex intersection tests. –Hierarchical Organization of Volumes Surrounds - The use of encircling volumes of other surrounding volumes saves many tests of intersection: if a ray does not intersect a volume, then also does not intersect the packages therein. –Space division dimensional Grids - Each cell resulting from this division knows the objects it contains, wholly or partially. According to the position and direction of the ray in question, only certain cells are visited and thus only the objects contained therein are tested. Because the order of progression in cells is defined by the direction of the ray, the first cell where an intersection Sense ends the process of visiting the radius to the cells.

10 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 10 Global illumination algorithms Ray-Tracing

11 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 11 Global illumination algorithms Radiosity The algorithm is independent of the observation point. The algorithm performs only really calculate lighting; works in the object space. It is complemented by an algorithm of visibility for the production of the final image. Processing phases: 1. Modelling the interactions between objects and light sources, without considering the position of the observer. 2. Creates the image considering the observer performs the calculation of visibility (eg Z- buffering) polygons and shading (Gouraud). In previous models, the light sources were treated differently from surfaces illuminating way. On the contrary, radiosity methods consider that all surfaces are (self-) emit light. Thus, the light sources are modeled as normal surfaces to a given area. The method assumes that the processes of emission and reflection are ideal diffuse. Need the discretized faces patches to ensure that the area corresponding to a Patch the radiosity is constant.

12 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 12 Global illumination algorithms Radiosity The radiosity (B i ) Is defined as the energy expelled per unit of time and area by a PatchAnd consists of two parts: B i The i = E i The i + ρ i  j (F j-i B j The j ) B i = E i + ρ i  j (F j-i B j The j / A i ) energy expelled energy issued energy reflected Per unit area: B i - radiosity expelled energy Patch in watts / m 2 E i - light emission (self-issued) by Patch i ρ i - reflectivity percentage of incident energy that is reflected by Patch i F j-i - form factor, percentage of energy that leaves the patch j and reaches i

13 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 13 Global illumination algorithms Radiosity In pervasive environments, there is the following relationship of reciprocity between form factors: The i. F i-j = A j. F j-i Thus, the interaction of light between patches can be represented by a linear system of equations: That applied in the previous expression of radiosity results in: B i = E i + ρ i  j B j F i-j Or: B i - ρ i  j B j F i-j = E i

14 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 14 Global illumination algorithms Radiosity Image creation: 1.Solving the system of equations for Gaussian elimination is obtained for each radiosity Patch. 2.Set the position of the observer. 3.Applying an algorithm for visibility, for example, Z-buffer. 4.Calculate the radiosity of the vertices of each polygon. 5.Apply color interpolation (Gouraud). The same solution of the system is used for any position of the observer. It is necessary to solve the system of equations again if there is a change of relative positions of objects, because it alters the form factors, or if we change the value E each Patch. Factors Shape? The complexity of the method is the calculation of radiosity form factors.

15 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 15 Global illumination algorithms Radiosity Form Factors The form factor Fij represents the fraction (percentage) of the total energy expelled by patch "i" that reaches the patch "j"Taking into account the shape, orientation and relative distance between the two patches, as well as obstacles that obstruct the path. The form factor of the differential area dA i for the differential area dA j is given by: H ij is 1 or 0, depending on dA j be visible or not from dA i.

16 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 16 Global illumination algorithms Radiosity To determine F di-j, The form factor of differential area dA i for the finite area The j,integrated area of patch j: Finally the form factor of area The i for the area The j is given by: It is found that the calculation of the Form Factor F di-j corresponds to design the parts of The j visible from dA i a hemisphere centered dA i,designing then this projection orthographic form the base of the hemisphere and dividing by the area of ​​ the circle. (Analogy Nusselt) The calculation is complex.

17 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 17 Global illumination algorithms Radiosity Simplification of Cohen and Greenberg: Method hemicube Instead of using the projection in a hemisphere projected on top of a cube centered at dA i, With the top of the cube parallel to the surface. Each face of the hemicube is divided into a number of square cells of equal size (ie 50 by 50)

18 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 18 Global illumination algorithms Radiosity The i NiNi The j Project The j in hemicube, noting the square (mini-patch) that are covered. To register which every square patches The j and its distance. Saving only the closest since they will be invisible other: an algorithm for visibility in the image space, eventually (usually...) Z-Buffer!

19 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 19 Global illumination algorithms Radiosity The i NiNi The j Are calculated form factors for each elementary cell of hemicube, F q for square q. The form factor F i-j is then obtained by summing all contributions from squares covered by the patch j. F i-j =  F q Problems radiosity algorithm: - Algorithm computationally heavy processing and memory utilization. - For precisely the division of objects is required patches small (N> 1000). Implies N 2 form factors to calculate.

20 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 20 Radiosity

21 COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 21 Radiosity Progressive Refinement Radiosity –Solving the system of linear equations... Iterative methods with convergence to the final solution Use of the intermediate results as "provisional" –Image is displayed from the beginning of the calculations Quality of the results will improve with processing time Binding Ray-tracing radiosity + –Exploration of what each better processes... Ray-Tracing: specular reflection Radiosity: diffuse reflection


Download ppt "COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 2003 1 Global illumination algorithms Graphics."

Similar presentations


Ads by Google