CSCE 641: Computer Graphics Lighting3D Rendering pipelineSlide 3OutlineLighting/IlluminationDirect and Indirect LightGlobal Illumination IISlide 8Slide 9Reflection ModelsSlide 11Slide 12Slide 13Types of Reflection FunctionsSlide 15Slide 16MaterialsIllumination ModelAmbient LightTotal IlluminationDiffuse LightSlide 22Slide 23Slide 24Slide 25Specular LightSlide 27Finding the Reflected VectorSlide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Multiple Light SourcesSlide 39Slide 40Other LightsAttenuationSlide 43Slide 44Spot LightsSlide 46Slide 47Slide 48Slide 49Implementation ConsiderationsSlide 51Opengl FunctionsNext Lecture1CSCE 641: Computer GraphicsLightingJinxiang ChaiScan conversion3D Rendering pipelineModeling transformationlightingViewing transformationProject transformationClippingImageTransform into 3D world systemIlluminate according to lighting and reflectanceTransform into 3D camera coordinate systemTransform into 2D camera systemClip primitives outside camera’s viewDraw pixels (includes texturing, hidden surface, etc.)Scan conversion3D Rendering pipelineModeling transformationlightingViewing transformationProject transformationClippingImageTransform into 3D world systemIlluminate according to lighting and reflectanceTransform into 3D camera coordinate systemTransform into 2D camera systemClip primitives outside camera’s viewDraw pixels (includes texturing, hidden surface, etc.)OutlineAmbient, diffuse and specular lightLight attenuation & spot lightsLighting/IlluminationColor is a function of how light reflects from surfaces to the eyeGlobal illumination accounts for light from all sources as it is transmitted throughout the environmentLocal illumination only accounts for light that directly hits a surface and is transmitted to the eyeDirect and Indirect LightGlobal Illumination IIGlobal Illumination IILighting/IlluminationColor is a function of how light reflects from surfaces to the eyeGlobal illumination accounts for light from all sources as it is transmitted throughout the environmentLocal illumination only accounts for light that directly hits a surface and is transmitted to the eyeReflection 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.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.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.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.Types of Reflection FunctionsIdeal SpecularReflection LawMirrorTypes of Reflection FunctionsIdeal SpecularReflection LawMirrorIdeal DiffuseLambert’s LawMatteTypes of Reflection FunctionsIdeal SpecularReflection LawMirrorIdeal DiffuseLambert’s LawMatteSpecularGlossyDirectional diffuseMaterialsPlastic Metal MatteFrom Apodaca and Gritz, Advanced RenderManIllumination ModelAmbient LightUniform light caused by secondary reflectionsDiffuse LightLight scattered equally in all directionsSpecular LightHighlights on shiny surfacesAmbient Light A =intensity of ambient lightka=ambient reflection coefficientReally 3 equations! (Red, Green, Blue)Accounts for indirect illuminationDetermines color of shadowsAkIaTotal IlluminationAkIaDiffuse LightAssumes that light is reflected equally in all directionsHandles both local and infinite light sourcesInfinite distance: L doesn’t changeFinite distance: must calculate L for each point on surfaceLNSurfaceDiffuse Light C = intensity of point light sourcekd = diffuse reflection coefficient = angle between normal and direction to light)()cos( NLkCkCIddLNSurfaceNL)cos(Total IlluminationAkIaTotal Illumination)( NLCkAkIdaMaterialsPlastic Metal MatteFrom Apodaca and Gritz, Advanced RenderManSpecular LightPerfect, mirror-like reflection of light from surfaceForms highlights on shiny objects (metal, plastic)LNSurfaceRESpecular Light C = intensity of point light sourceks = specular reflection coefficient =angle between reflected vector (R) and eye (E)n =specular coefficientnsnsERkCkCI )()(cos LNSurfaceER)cos(REFinding the Reflected VectorLNSurfaceRFinding the Reflected VectorLNSurfaceR||LLFinding the Reflected VectorLNSurfaceR||LL)()cos(||NLNNL ||LLL Finding the Reflected VectorLNSurfaceR||LL LLR||Finding the Reflected VectorLNSurfaceR||LLLLLLR ||||2Finding the Reflected VectorLNSurfaceR||LLLNNLR )(2Total Illumination)( NLCkAkIdaTotal Illumination nsdaERkNLkCAkI )()( 5nTotal Illumination nsdaERkNLkCAkI )()( 50nTotal Illumination nsdaERkNLkCAkI )()( 500nMultiple Light SourcesOnly one ambient term no matter how many lightsLight is additive; add contribution of multiple lights (diffuse/specular components)Total Illumination nsdaERkNLkCAkI )()( Total Illumination inisidiaERkNLkCAkI )()(Other LightsAttenuation caused by fog, smokeSpot lightsAttenuationDecrease intensity with distance from lightd = distance to lightr = radius of attenuation for light)1,0max(),(rdrdatt )1,0max(),(22rdrdatt 2221,0max),(rdrdatt 22),(rderdattAttenuation iinisidiardattERkNLkCAkI ),()()(Attenuation iinisidiardattERkNLkCAkI ),()()(Spot LightsEliminate light contribution outside of a coneALSurfaceSpot LightsEliminate light contribution outside of a coneALSurface ALALALspotCoeff),cos(0),cos(Attenuation iinisidiaspotCoeffERkNLkCAkI )()(Spot Lights iinisidiaspotCoeffERkNLkCAkI )()(Spot Lights iinisidiaspotCoeffERkNLkCAkI
View Full Document