Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Computer Graphics

Similar presentations


Presentation on theme: "Advanced Computer Graphics"— Presentation transcript:

1 Advanced Computer Graphics
and Virtual Environments LIGHTING

2 Lecture overview Introduction to the lighting problem Ray tracing
Radiosity Ronald: introduction lighting problem + basic principles of ray tracing Romke: ray tracing optimization Ralf/Maarten: radiosity

3 I – The lighting problem

4 complexity of interaction between light and objects in a scene
The lighting problem Lighting scenes: the major and central conceptual and practical problem of computer graphics Reason: complexity of interaction between light and objects in a scene The lightning problem

5 Light: the fundamental equation
Input: Emission (Φe) In-scattering (Φi) Output: Streaming (Φs) Out-scattering (Φo) Absorption (Φa) Input == output Φe + Φi == Φs + Φo + Φa Radiance equation: Φ(p,ω) = emitted radiance + total reflected radiance - Radiance equation can be derived from fundamental light equation (after some simplifications and introduction of terms) - The problem in CG boils down to solving Φ(p,ω) for all points and directions Illustration of radiance equation

6 Four classes of solutions of radiance equation
LOCAL GLOBAL View dependent “real-time” graphics Ray tracing Monte Carlo path tracing View independent “flat-shaded” graphics Radiosity Monte Carlo photo tracing - (a) shows local illumination model for ray tracing - (d) shows local illumination model for radiosity - Local: no recursion; only look at light coming directly from light source (and ambient light) The lighting problem

7 Rendered or real? As pointed out, there are local and global solutions of the radiance equation. Global solutions can account for a much higher degree of ‘photo-reality’ than local solutions can. However, global solutions also take a lot more time to compute. The figures seen here are all computer-rendered (with rendering times of several hours).

8 II – Local Illumination

9 Local illumination model
We are looking for the intensity (Ir) radiating from an object (i.e. Φ(p,ω)) Three components Ir : Ambient lighting Specular lighting Diffuse lighting Ir = ambient + specular + diffuse NB: Formally, we should split Ir into Ir,red, Ir,green and Ir,blue - The total intensity radiating from an object consists of R,G and B component; for the sake of simplicity we ignore this fact for the moment Local Illumination

10 Component 1: ambient lighting
Ambient light models global illumination Each object is illuminated to a certain extent by “stray” light Assumed constant across a whole scene (Ia) Often used simply to make sure everything is lit, just in case something isn’t struck by light directly from a light source Ir = kaIa (ka : proportion of light reflected rather than absorbed by the material) Actually we should distinguish between I[r,red], I[r,green] and I[r,blue]. Local illumination

11 Component 2: specular lighting
Perfect specular reflection Light Glossy specular reflection ‘Shininess’ parameter m defines the degree of glossiness (Phong exponent) Local illumination

12 Component 2: specular lighting
Imperfect specularity (Phong) E N H L surface N: surface normal E: direction to eye L: direction to light H: bisects E and L (halfway vector) Ir = ksIi (h.n)m ks : proportion of light reflected rather than absorbed by the material m : Phong exponent(‘shininess’) Local illumination

13 Component 3: diffuse lighting
Lambert’s Law Diffuse reflector scatters light Assume equality in all direction Called Lambertian surface Angle of incoming light is still critical Local illumination

14 Component 3: diffuse lighting
L is the direction to the light N is the surface normal Incoming intensity of light is proportional to d d is proportional to cos  = N.L Ir = kdIi (n.l) Local illumination

15 Local Illumination model - summary
Ir = ambient + diffuse + specular = Ir,a + Ir,d + Ir,s Putting things together gives the following local illumination model: Ir = kaIa + kdIi(n.l) + ksIi (h.n)m An analogous model applies for multiple light sources This model does however not yet account for global effects and shadows Local Illumination

16 III – Ray Tracing

17 Ray Tracing Basic principles Accounts for: Local illumination effects Object inter-reflection (for specular surfaces only) Transparency / ray transmission Occlusion/shadows Follows the rays in reverse (start at pixel in view plane)

18 Correct for non-visible lights
E: direction to eye N: surface normal L: direction to light H: bisects E and L E L surface - Basically this is an extension to the local illumination model; - Adjustment of the formula is quite straighforward (addition of S). Detecting object interference, however, can be quite hard/computational expensive Ir = kaIa + S * Ii(kd(n.l)+ks(h.n)m (S is a ‘shadow feeler’: 0 if light source not visible, 1 otherwise) Ray Tracing

19 Adding reflection to the model
N: surface normal E: direction to eye L: direction to light H: bisects E and L E L surface Ir = Ilocal + krIr Ray Tracing

20 Adding transparency to the model
α T β transparent object Snell’s Law N: surface normal E: direction to eye L: direction to light H: bisects E and L R: direction of reflection T: transmitted ray η: index of refraction Ray tracing

21 Putting everything together
Illustration of the basic ray tracing model Ray tracing

22 Summary Recursive ray tracing is a good simulation of specular reflections We’ve seen how the ray-casting can be extended to include shadows, reflections and transparent surfaces Next: Ray Tracing optimization Radiosity ( ) Ray tracing


Download ppt "Advanced Computer Graphics"

Similar presentations


Ads by Google