- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
CompositingandBlending1
ObjectivesLearntousetheAcomponentinRGBAcolorforBlendingfortranslucentsurfacesCompositingimagesAntialiasing2
OpacityandTransparencyOpaquesurfacespermitnolighttopassthroughTransparentsurfacespermitalllighttopassTranslucentsurfacespasssomelighttranslucency=1–opacity(a)opaquesurfacea=13
PhysicalModelsDealingwithtranslucencyinaphysicallycorrectmannerisdifficultduetothecomplexityoftheinternalinteractionsoflightandmatterUsingapipelinerenderer4
WritingModelUseAcomponentofRGBA(orRGBa)colortostoreopacityDuringrenderingwecanexpandourwritingmodeltouseRGBAvaluesColorBufferdestinationcomponentblenddestinationblendingfactorsourceblendingfactorsourcecomponent5
BlendingEquationWecandefinesourceanddestinationblendingfactorsforeachRGBAcomponents=[sr,sg,sb,sa]d=[dr,dg,db,da]Supposethatthesourceanddestinationcolorsareb=[br,bg,bb,ba]c=[cr,cg,cb,ca]Blendasc’=[brsr+crdr,bgsg+cgdg,bbsb+cbdb,basa+cada]6
OpenGLBlendingandCompositingMustenableblendingandpicksourceanddestinationfactorsglEnable(GL_BLEND)glBlendFunc(source_factor,destination_factor)OnlycertainfactorssupportedGL_ZERO,GL_ONEGL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHAGL_DST_ALPHA,GL_ONE_MINUS_DST_ALPHASeeRedbookforcompletelist7
ExampleSupposethatwestartwiththeopaquebackgroundcolor(R0,G0,B0,1)ThiscolorbecomestheinitialdestinationcolorWenowwanttoblendinatranslucentpolygonwithcolor(R1,G1,B1,a1)SelectGL_SRC_ALPHAandGL_ONE_MINUS_SRC_ALPHAasthesourceanddestinationblendingfactorsR’1=a1R1+(1-a1)R0,……Notethisformulaiscorrectifpolygoniseitheropaqueortransparent8
ClampingandAccuracyAllthecomponents(RGBA)areclampedandstayintherange(0,1)However,inatypicalsystem,RGBAvaluesareonlystoredto8bitsCaneasilylooseacc
您可能关注的文档
- 《计算机图形学》Chapter 12 设计参数化三次曲线-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapter 13 并行渲染-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapter 13 光线追踪-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapter 13 全局光照辐射度方法-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapters 10 分层建模 I-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapters 10 分层建模 II-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Chapters 10 图形对象和场景图-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Extra Lectures 凹凸贴图-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Extra Lectures 采样和混叠-(英文)教学课件(非AI生成).ppt
- 《计算机图形学》Extra Lectures 反射与透射-(英文)教学课件(非AI生成).ppt
最近下载
- 2025年高考历史试卷(山东卷)附答案解析.docx VIP
- 中国文化古城—西安.-PPT.pptx VIP
- 《西方社会学理论》全套教学课件.ppt
- 第7课 实践出真知 课件 中职高教版哲学与人生.pptx
- 一针疗法之肩周炎.ppt
- 2025中国银行中银国际证券股份有限公司招聘8人笔试模拟试题及答案解析.docx VIP
- 神经介入治疗概述及护理常规.ppt VIP
- 舒伯特第二即兴曲,降E大调 D.899之2 Impromptu No. 2 in E flat major, D. 899, No. 2 Op90 Schubert钢琴谱.pdf VIP
- 深潜器钛合金框架结构装配焊接工艺研究-中国造船工程学会.doc
- 村两委工作细则汇编.doc VIP
文档评论(0)