Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS552: Computer Graphics Lecture 33: Illumination and Shading.

Similar presentations


Presentation on theme: "CS552: Computer Graphics Lecture 33: Illumination and Shading."— Presentation transcript:

1 CS552: Computer Graphics Lecture 33: Illumination and Shading

2 Recap Solid Modeling o Represent the solid object in a 3D space o B-Reps o Subdividing algorithms

3 Objective After completing this lecture, students will be able to o Explain the importance of VSDs o Solve the problem of backface culling

4 Surface Rendering Method Realistic displays of a scene are obtained by o Generating perspective projections of objects and o Applying natural lighting effects to the visible surfaces An illumination model is used to calculate the color of an illuminated position on the surface of an object. A surface-rendering method uses the color calculations from an illumination model to determine the pixel colors for all projected positions in a scene.

5 Global Illumination Direct illumination + Indirect illumination = Total illumination

6 Diffuse Inter-reflection Total illumination (normal image)

7 Diffuse Inter-reflection Direct illumination

8 Diffuse Interreflection Indirect illumination (diffuse interreflection)

9 Human face Total illumination (normal image)

10 Human face Direct illumination

11 Human face Indirect illumination

12 Illumination How do We Compute Radiance for a Sample Ray? o Must derive computer models for...  Emission at light sources  Scattering at surfaces  Reception at the camera WireframeWithout Illumination Direct Illumination

13 Overview Direct Illumination o Emission at light sources o Scattering at surfaces Global Illumination o Shadows o Refractions o Inter-object reflections Direct Illumination

14 Overview Direct Illumination o Emission at light sources o Scattering at surfaces Global Illumination o Shadows o Refractions o Inter-object reflections Direct Illumination

15 Modeling Light Source I L (x,y,z,  ) o Describes the intensity of energy, o Leaving a light source o Arriving at location(x,y,z) o From direction (  ) o With wavelength

16 Empirical Model Ideally Measure Irradiant Energy for “All” Situations o Too much storage o Difficult in practice

17 Light Source Model Simple Mathematical Models: o Point light o Directional light o Spot light

18 Point Light Source Models Omni-Directional Point Source (E.g., Bulb) o Intensity (I 0 ) o Position (px, py, pz) o Factors (k c, k l, k q ) for attenuation with distance (d)

19 Directional Light Source Models Point Light Source at Infinity (E.g., Sun) o Intensity (I 0 ) o Direction (dx,dy,dz) No attenuation with distance

20 Spot Light Source Models Point Light Source with Direction o Intensity (I 0 ), o Position (px, py, pz) o Direction (dx, dy, dz) o Attenuation

21 Directional Light Sources

22 Angular Intensity Attenuation Attenuate the light intensity o Angularly about the source o Radially out from the point-source position.

23 Overview Direct Illumination o Emission at light sources o Scattering at surfaces Global Illumination o Shadows o Refractions o Inter-object reflections Direct Illumination

24 Modeling Surface Reflection R s ( ,  ) o Describes the amount of incident energy o Arriving from direction (  ) o Leaving in direction ( ,  ) o With wavelength

25 Empirical Model Ideally Measure Radiant Energy for “All” Combinations of Incident Angles o Too much storage o Difficult in practice

26 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient” Based on model proposed by Phong Based on model proposed by Phong

27 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient” Based on model proposed by Phong Based on model proposed by Phong

28 Diffuse Reflection Assume Surface Reflects Equally in All Directions o Examples: chalk, clay

29 Diffuse Reflection How Much Light is Reflected? o Depends on angle of incident light o dL  dA  cos 

30 Diffuse Reflection Lambertian Model o Cosine law (dot product)

31 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient” Based on model proposed by Phong Based on model proposed by Phong

32 Specular Reflection Reflection is Strongest Near Mirror Angle o Examples: mirrors, metals

33 Specular Reflection How Much Light is Seen? o Depends on angle of incident light and angle to viewer

34 Specular Reflection Phong Model o {cos(  )} n

35 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient” Based on model proposed by Phong Based on model proposed by Phong

36 Emission Represents Light Emitting Directly From Polygon Emission ≠ 0

37 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient” Based on model proposed by Phong Based on model proposed by Phong

38 Ambient Term Represents Reflection of All Indirect Illumination

39 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient”

40 Reflectance Model Simple Analytic Model: o Diffuse reflection + o Specular reflection + o Emission + o “Ambient”

41 Reflectance Model Sum Diffuse, Specular, Emission, and Ambient

42 Surface Illumination Calculation Single Light Source:

43 Surface Illumination Calculation Multiple Light Sources:

44 Overview Direct Illumination o Emission at light sources o Scattering at surfaces Global Illumination o Shadows o Refractions o Inter-object reflections Global Illumination

45

46 Shadows Shadow Terms Tell Which Light Sources are Blocked o Cast ray towards each light source L i o S i = 0 if ray is blocked, S i = 1 otherwise Shadow Term

47 Ray Casting Trace Primary Rays from Camera o Direct illumination from unblocked lights only

48 Recursive Ray Tracing Also Trace Secondary Rays from Hit Surfaces o Global illumination from mirror reflection and transparency

49 Mirror Reflection Trace Secondary Ray in Direction of Mirror Reflection o Evaluate radiance along secondary ray and include it into illumination model Radiance for mirror reflection ray

50 Transparency Trace Secondary Ray in Direction of Refraction o Evaluate radiance along secondary ray and include it into illumination model Radiance for refraction ray

51 Transparency Transparency coefficient is fraction transmitted o K T = 1 if object is translucent, K T = 0 if object is opaque o 0 < K T < 1 if object is semi-translucent Transparency Coefficient

52 Refractive Transparency For Thin Surfaces, Can Ignore Change in Direction o Assume light travels straight through surface

53 Refractive Transparency For Solid Objects, Apply Snell’s Law: o  r sin  r  i  sin  i

54 Summary Direct Illumination o Ray casting o Usually use simple analytic approximations for light source emission and surface reflectance Global illumination o Recursive ray tracing o Incorporate shadows, mirror reflections, and pure refractions

55 Illumination Terminology Radiant power [flux] (Φ) o Rate at which light energy is transmitted (in Watts). Radiant Intensity (I) o Power radiated onto a unit solid angle in direction( in Watt/sr)  e.g.: energy distribution of a light source (inverse square law) Radiance (L) o Radiant intensity per unit projected surface area( in Watts/m 2 sr)  e.g.: light carried by a single ray (no inverse square law) Irradianc (E) o Incident flux density on a locally planar area (in Watts/m 2 ) Radiosity (B) o Exitant flux density from a locally planar area ( in Watts/m 2 )

56 Thank you Next Lecture: Rendering


Download ppt "CS552: Computer Graphics Lecture 33: Illumination and Shading."

Similar presentations


Ads by Google