Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.

Similar presentations


Presentation on theme: "1 CSCE 441: Computer Graphics Lighting Jinxiang Chai."— Presentation transcript:

1 1 CSCE 441: Computer Graphics Lighting Jinxiang Chai

2 Scan conversion 3D Rendering pipeline Modeling transformation lighting Viewing transformation Project transformation Clipping Image Transform into 3D world system Illuminate according to lighting and reflectance Transform into 3D camera coordinate system Transform into 2D camera system Clip primitives outside camera’s view Draw pixels (includes texturing, hidden surface, etc.)

3 Scan conversion 3D Rendering pipeline Modeling transformation lighting Viewing transformation Project transformation Clipping Image Transform into 3D world system Illuminate according to lighting and reflectance Transform into 3D camera coordinate system Transform into 2D camera system Clip primitives outside camera’s view Draw pixels (includes texturing, hidden surface, etc.)

4 Outline Ambient, diffuse and specular light Light attenuation & spot lights Readings: HB 10-1,10- 2,10-3

5 Lighting/Illumination Color is a function of how light reflects from surfaces to the eye Global illumination accounts for light from all sources as it is transmitted throughout the environment Local illumination only accounts for light that directly hits a surface and is transmitted to the eye

6 Direct and Indirect Light

7 Global Illumination II

8

9 Lighting/Illumination Color is a function of how light reflects from surfaces to the eye Global illumination accounts for light from all sources as it is transmitted throughout the environment Local illumination only accounts for light that directly hits a surface and is transmitted to the eye

10 Reflection Models Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.

11 Reflection Models Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.

12 Reflection Models Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.

13 Reflection Models Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.

14 Types of Reflection Functions Ideal Specular  Reflection Law  Mirror

15 Types of Reflection Functions Ideal Specular  Reflection Law  Mirror Ideal Diffuse  Lambert’s Law  Matte

16 Types of Reflection Functions Ideal Specular  Reflection Law  Mirror Ideal Diffuse  Lambert’s Law  Matte Specular  Glossy  Directional diffuse

17 Materials PlasticMetalMatte From Apodaca and Gritz, Advanced RenderMan

18 Illumination Model Ambient Light  Uniform light caused by secondary reflections Diffuse Light  Light scattered equally in all directions Specular Light  Highlights on shiny surfaces

19 Ambient Light A =intensity of ambient light k a =ambient reflection coefficient Really 3 equations! (Red, Green, Blue) Accounts for indirect illumination Determines color of shadows

20 Total Illumination

21 Diffuse Light Assumes that light is reflected equally in all directions Handles both local and infinite light sources  Infinite distance: L doesn’t change  Finite distance: must calculate L for each point on surface Surface

22 Diffuse Light C = intensity of point light source k d = diffuse reflection coefficient = angle between normal and direction to light Surface

23 Lambert’s Law Surface Beam of Light

24 Lambert’s Law Surface Beam of Light

25 Lambert’s Law Surface

26 Lambert’s Law Surface Beam of Light

27 Lambert’s Law Surface Beam of Light

28 Diffuse Light Where is the light source?

29 Diffuse Light Where is the light source?

30 Total Illumination

31

32 Materials PlasticMetalMatte From Apodaca and Gritz, Advanced RenderMan

33 Specular Light Perfect, mirror-like reflection of light from surface Forms highlights on shiny objects (metal, plastic) Surface

34 Specular Light C =intensity of point light source k s =specular reflection coefficient =angle between reflected vector (R) and eye (E) n =specular coefficient Surface

35 Finding the Reflected Vector Surface

36 Finding the Reflected Vector Surface

37 Finding the Reflected Vector Surface

38 Finding the Reflected Vector Surface

39 Finding the Reflected Vector Surface

40 Finding the Reflected Vector Surface

41 Total Illumination

42

43

44

45 Multiple Light Sources Only one ambient term no matter how many lights Light is additive; add contribution of multiple lights (diffuse/specular components)

46 Total Illumination

47

48 Other Lights Attenuation caused by fog, smoke Spot lights

49 Attenuation Decrease intensity with distance from light

50 Attenuation Decrease intensity with distance from light d = distance to light r = radius of attenuation for light

51 Attenuation Decrease intensity with distance from light d = distance to light r = radius of attenuation for light

52 Attenuation

53

54 Spot Lights Eliminate light contribution outside of a cone How to create spot lights ?

55 Spot Lights Eliminate light contribution outside of a cone Surface

56 Spot Lights Eliminate light contribution outside of a cone Surface

57 Spot Lights Eliminate light contribution outside of a cone Surface

58 Attenuation

59 Spot Lights

60

61 Implementation Considerations Surface

62 Implementation Considerations Typically choose Clamp each color component to [0,1]

63 Opengl Functions See section 10-20 how to set up light sources (light source pos - light source position and type - light source colors - radial-intensity attenuation - spotlights how to specify global lighting parameters how to specify surface properties

64 Next Lecture Shading Texture mapping & others Readings: HB 10-10, 10-17, 10-18


Download ppt "1 CSCE 441: Computer Graphics Lighting Jinxiang Chai."

Similar presentations


Ads by Google