欢迎来到天天文库
浏览记录
ID:33871539
大小:4.91 MB
页数:41页
时间:2019-02-28
《3d游戏编程:opengl光照》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、OpenGL:LightingYanciZhangGameProgrammingIIOutlineBasicconceptsoflightingLightinginOpenGLLightpropertiesMaterialpropertiesGameProgrammingIIWhatWeHaveNowRenderingresultfromlastlessonDoesitlooklikea3Dobject?Certainlynot!Whataretheproblems?Lighting!ALitandanUnlitSph
2、ereItDoesMakeaDifference!GameProgrammingIILightingObjectsdonothave3DappearancewithoutlightingLightingsimulateshowobjectsreflectlightTwodifferentlightingmodelsingraphicsGlobalillumination:highrealisticbuthighcostLocalillumination:lowrealisticbutlowcostGameProgramming
3、IIGlobalIlluminationIntherealworldLightmightbereflectedmultipletimesLightmightbeoccluded…GlobalilluminationtriestosimulatethesephenomenaGameProgrammingIILocalIlluminationThecolorofanypointonsurfacesisonlyinfluencedbyItsownproperties(position,normal,material…)Ligh
4、tattributesThecolorisNOTinfluencedbyanyotherpointsinsceneLowcomputationcostbutcannotproduceshadows,multiplereflections…GameProgrammingIILightinginOpenGL1/3LocalilluminationVertex-basedlightingLightingisastatewhichcanbeswitchedonoroffOpenGLdivideslightingintothreepa
5、rts:MaterialpropertiesLightpropertiesGloballightingparametersambientlighttwosidedlightingGameProgrammingIILightinginOpenGL2/3Lightismodeledinfourcategories:Emissionlight(alwaysignored!)AmbientlightView-independentSimulatelightintheenvironmentDiffuselightView-
6、independentSimulateincidentrayisreflectedatmanyanglesSpecularlightView-dependentSimulateincidentrayfromasingleincomingdirectionisreflectedintoasingleoutgoingdirectionGameProgrammingIILightinginOpenGL3/3Formula:ambient+diffuse+specular=shadingresultGameProgrammingIIA
7、mbientLightingApproximatelowleveloflightnormallypresentingeverywhereinsceneScatteredbymanyobjectsbeforereachingeyeConstanttermsAppliesequallytoallpointsonobjectGameProgrammingIIDiffuseLightingApproximatelightscatteredbyobjectswithroughsurfacesIntensitydependsonthea
8、nglebetweenlightsourceandsurfacenormalGameProgrammingIISpecularLightingApproximatelightreflectedby“shi
此文档下载收益归作者所有