admin 管理员组文章数量: 887021
2023年12月19日发(作者:如何学好c语言心得)
rtandMichaelHerfJanuary15,1997CMU-CS-97-104SchoolofComputerScienceCarnegieMellonUniversityPittsburgh,PA15213email:ph@,herf+@ldWideWeb:/eviatedversionappearedin[rt,FastSoftShadows,VisualProceedings,SIGGRAPH96,Aug.1996,p.145].AbstractThispaperdescribesanalgorithmentgraphicsworkstations,thetechniquecancalculatethesoftshadowscastbymoving,tic,diffusescene,thesehighqualityshadowscanthenbedisplayedat30Hz,ffusescene,themethodprecomputesaradiancetexturetureforeachpolygoniscomputedbycreatingregisteredprojectionsofthesceneontothepolygonfrommultiplesamplepointsoneachlightsource,anhisprecomputation,softshadowsinastaticscenecanbedieloperationsemployedbythnwsandconclusionscontainedinthisdocumentarethoseoftheauthorsandshouldnotbeinterpretedasrepresentingtheofficialpolicies,eitherexpressedorimplied,ment.
Keywords:penumbra,texturemapping,graphicsworkstation,interaction,real-time,SGIRealityEngine.
1IntroductionShadowsarebothanimportantvisualcuefortheperceptiosdifferaccordingtothetypeoflightsourcecausingthem:pointlightsourcesyieldhardshadows,whilelinearandarea(alsoknownasextended)lightsourcesgenerallyyieldsoftshadowswithanumbra(fullyshadowedregion)andpenumbra(partiallyshad-owedregion).Therealworldcontainsmostlysoftshadowsduetothefinitesizeofskylight,thesun,andlightbulbs,yetmostcomputergraphicsrenderingsoftwaresimulatesonlyhardshadows,ivesharpnessotgraphicsworkstations,suchasSiliconGraphics(SGI)andHewlettPackard(HP)machines,providez-bufsareseldomsimulatedonsuchmachines,however,becauseexistingalgorithmsarenotgeneralenough,dowalgorithmsmostsuitableforinteractionongraphicsworkstatuchalgorithmsarepracticalforoneortwolightsources,theyareimpractenthereanorithmexploitsgraphicshardwareforfastprojective(perspective)transformation,clipping,scanconversion,texturemapping,visibilitytesting,dwareisusedbothtocomputetheshadingonthesurfacesandtodisplayit,fusescenes,theshadingiscomputedinapreprocessingstepwhosecostisproportionaltothenumberoflightsourcesamples,butwhilethesceneisstatic,hodisalsouoryrequirementsofthealgorithmarealsoindependentofthenumberoflightsourcesamples.1.1TheIdeaFordiffusescenes,ourmethodworksbyprecomputing,foreachpolygoninthescene,aradiancetexture[12,14]thatrecordsthecolor(outgoingradiance)fusescene,theradianceateachsurfacepointisviewindependent,diancetextureisaaradiosityalgorithm,however,ideaistousegraphicshardwaretodeterminevisibilityandcalculateshading,thatis,todeterminewhichportionsofasurfaceareoccludedwithrespecttoagivenextendedlightsource,rtosimulateextendedlightsources,weapproximatethemwithanumberoflightsamplepoints,anasmanyoperationsinhardwareaspossible,however,wedonotuseahemicube[7]d,tocomputetheshadowsforasinglepolygon,werenderthesceneintoascratchbuffer,withallpolygonsexcepttheonebeingshadedappropriatelyblackened,usingiewsareregiseresultinghardshadowimagesareaveraged,asoftshadowimageresults(figure1).Thisimageisthenusedturessemainderofthepaper,wesummarizepreviousshadowalgorithms,wepresentourmethodfordiffusescenesinmoredetail,wediscussgeneralizationstosceneswithspecularandgeneralre-flectance,wepresentourimplementationandresults,edanumberofshadowalgorithms[19].Herewealgorithmscanbedividedintothreecategories:thosethatcomputeeverythingonthefly,thosethatprecomputejustvisibility,raytracingcomputeseverythingontheflsarecomputedonapoint-by-pointbasisbytracingraysbetwadowscanbesimulatedbytracingraystoanumberofpointsdistributedacrossthelightsource[8].Theshadowvolumeapproachisanothermethodforcomputingshadowsontheflismethod,oneconstructsimaginarysurfacesthanandBadlerusedanextendedz-bufferalgorithmwithlinkedlistsateachpixeltosupportsoftshadowsusingthisapproach[4].TepixelprocessorsofthePixelPlanesmachinetosimulatehardshadowsinreal-time[10].HeidmannusedthestencilbufferinadvancedSGImachines[13].WithHeidmann’salgorithm,thescenemustberenderedthroughthestencilcreatedfromeachlightsource,sothecostperframe1991hardware,softshhodappearstobeoneofthealgoridprefer,however,e,bruteforceapproach,goodforcastingshadowsofobjectsontoaplane,istofindtheprojectivetransformationthatprojectsobjectsfromapointlightontoaplane,andtouseittodraweachsquashed,blackenedobjectontopoftheplane[3],[15,p.401].Thisalgorithmeffectivelymultipliesthenumberofobjectsinthescenebythenumberoflightsourcestimesthenumberofreceiverpolygonsontowhichshadowsarebeingcast,however,soitistypirproblemwiththismethodisthatoccludersbehindthereceiverwillcasterroneousshadows,dofcomputingvisibilityonthefly,-buffershadowalgorithmusestwo(ormore)passesofz-bufferrendering,firstfromthelightsources,andthenfromtheeye[18].Thez-buffersfromthelightviewsareusedinthefinal
Figure1:2:Left:scenewithsquarelightsource(foreground),triangularoccluder(center),andrectangularreceiver(background),:Approximatesoftshadowsresultingfrom22gridofsamplepoints;:Correctsoftshadowimage(generatedwith1616sampling).detnsformationofpointsfromonecoordinatesystemtoanothercanbeacceleratedusingtexturemappinghard-ware[17].Thislattermethod,bySegaletal.,achievesreal-timerates,adowscanbegeneratedonagraphicsworkstationbyrenderingthescenemultipletimes,usingdifferentpointsontheextendedlightsource,averagingtheresultingimagesusingaccumulationbufferhardware[11].Avariationoftheshadowvolumeapproachistointersectthesevolumeswithsurfacesinthescenetoprecomputetheumbraandpenumbraregionsoneachsurface[16].Duringthefinalrenderingpass,putationcanbetakenfur-ther,mostrelevanttodiffusescenes,thesemethodscomputevisibilitycontinuously,lresearchershaveexploredcontinuousvisiisapproach,surfacesaresubdividedintofullylit,penumbra,andandFeiner’ssoftshadowmethod,polygonsaresplitusingBSPtrees,andthesesub-polygonsarethenpre-shaded[6].kisandFiumeusedmoresophisticatedcomputationalgeometrytechniquestoprecomputetheirsubdivision,andreportedrenderingtimesofseveralseconds[9].Mostradiositymethodsdiscretizeeachsurfaceintoameshofelementsandthenuicubemethodcomputesvisibilityfromalightsourcepointtoanentirehemispherebypro-jectingthesceneontoahalf-cube[7].itymeshestypicallydonotresolveshadowswell,lartifactsareMadiositymethodsarenotfastenoughtosupportinteractivechangestothegeometry,’sincrementalradiositymethodisanexception[5].Ourownmethodcanbecategorizednexttohemicuberadiositymethods,h-niqueforcomputingvisibilityalsohasparallelstothemethodofflatteningobjectstoaplane.2.2GraphicsHardwareCurrentgraphicshardware,suchastheSiliconGraphicsRealityEngine[1],canprojective-transform,clip,shade,scanconvert,andtexturetensofthousandsofpolygonsinreal-time(in1/30sec.).lly,suchhardwaresupportsarbitrary44homogeneoustransformationsofplanarpolygons,clippingtoanytruncatedpyra-midalfrustum(rightoroblique),achines,Phongshading(onceperpixel)isnotpossible,butfacetedshading(onceperpolygon)andGouraudshading(oncepervertex)hading2
n,generalformforhardware-supportedilluminationisdif-fusereflectionfrommultiplepointspotlightsources,withatexturemappedreflectancefunctionandattenuation:light lrx'liθ'θreceiver
RxcoscosFigure3:ianceatpointonthereceiverisbeingcalculatedbysummingthecontributionsfromasetofpointlightsourcesatonlight.3.1ApproximatingExtendedLightSourcesAlthoughsuchintegralscanbesolvedinclosedformforplanar1),thecomplexityofthevisibilitysurfaceswithnoocclusion(omputeapproximationstotheintegral,however,byreplacingeachextendedlightsourcebyasetofpointlightsources:1whereisa3-DDiracdeltafunction,ource,andTypically,eachsampleonalightsourcehasequalarea:,isapproximation,theradianceofareflectivesurfacepointcanbecomputedbysummingthecontributionsoverallsamplepointsonalllightsources:acos+cos+12where,asshowninFigure3,isa3-Dpointonareflectivesurface,andisapointonalightsource,ispolarangle(anglefromnormal)at,istheangleat,isthedistancebetweenand,,,andarefunctionsofand,isoutgoingradianceatpointforcolorchannel,duetoeitheremissionorreflection,aisambientradiance,isreflectance,isaBooleanvisibilityfunctionthatequals1ifpointisvisiblefrompoint,else0,cos+maxcos0,forbackfacetesting,andtheintegralisoverallpointsonalllightsources,withrespect,whichisaninfinputstotheproblemarethegeometry,thereflectance,onalllightsources,theambientradi-andemittedradianceancea,andtheoutputisthereflectedradiancefunction.2(2)Eachtermintheinnersummationcanberegardedasahardshadowimageresultingfromapointlightsourceat,firstone,whichisanareatimesthereflectanceofthereceivingpolygon,ondfactoristhecosineoftheangleonthereceiver,timesthecosineoftheangleonthelight3
b+ex+eyzoyoy=wb+ex=0x=wy=0yab+exbxohasapexanditsparallelogrambasehasonevertexatandedgevectorsxandy(boldlowercasedenotesa3-Dpointorvector).Theparallelepipedliesinwhatwewillcallunitscreenspace,fromtheapex,theleftandrightsidesofthepyramidmaptotheparallelplanesu0andu1,thebottomandtopmaptou0andu1,andthebaseplaneand,figure4.A44homogeneousmhavetheform:Figure4:,timestheradianceofthelightsource,nbecomputedinhardwarebyrenderingthereceiverpolygonturnedon,usingaspinesthatdonotsupportPhongshading,wewillhavetofirdfactorilitycanbecomputedbyprojectingfulladvantageofthehardware,wecanprecomputetheshadingforeachpolygonusingtheformulaabove,andthendisplayviewsofthescenutesoftshadowtextures,ehardshadowimagesarenotregistered(theywouldnotbe,usinghemi-cubes),thenitwouldbenecessarytoresamplethemsothatcorresralternativeistochoosethetransformationforeachprojectnarreceiversurfaces,thisiseasilyaccofitaparallelogramaroundthereceiversurfaceofinterest,andthencon-structapyramidwiththisasitsbaseandthelightpointasitsapex,thereisa44homogeneoustransformationthatwillmapsuchapyramidintoanaxis-alignedbox,dshadowimageduetosamplepointonlightiscreatedbyloadiygonisilluminatedbytheambientlightplusasinglepointlightsourceat,ibilityfunctionisthencomputedbyrenderingtheremainderofthescenewithallsurfacesshadedasiftheywerethereceiverilluminatedbyambientlight:mostquicklydonewithz-bufferingoff,geachpolygonwithanunsortedpainter’salgorithmsufficesherebecauseallpolygonsarethesamecolor,andafterclipping,theonlypolygonfragmentsremainingwillliebetweenthelightsourceandthereceiver,utetheweightedaverageofthehardshadowimagessocreated,weusetheaccumulationbuffer.3.3ProjectiveTransformationofaPyramidtoaBoxWewantaprojective(perspective)transformationthatamidliesinobjectspace,=0w=141333andthehomogeneoustransformationandhomogeneousdivisiontotransformobjectspacetounitscreenspaceare:o1o1oanduuu1Thethirdrowofmatrixtogeneousscreencoordinates,,andareeachaffinefunctionsofo,o,ando(thatis,linearplustranslation).Theconstraintsabovespecifythevalueofeachofthethreecoordinatesatfourpointsinspace–rdinate,forexample,hasvalue1atthepoints,x,andy,ore,thevectorw,thusfixingthefirstisnormaltoanyplaneofconstantyxthreeelementsofthelastrowofthematrixwithinascalefactor:gandw1ww,first33wwcanbederivedsimilarly(seefigure4).Theresulttworowsofis:xyxxyxwxxyxyyyxyxzyzxyxy0001wwwywwzwwwherexywwxyyxwandxyw111xyxywwBlinn[3]usesarelatedprojectivetransformationforthegenera-tionofshadowsonaplane,buthisisaprojection(itcollapses3-Dto2-D),hethirddimensionforclipping.3.4UsingtheTransformationTousethistransformationinourshadowalgorithm,wefirstfieceiverisarectangleorotherparallelogram,thefitisexact;ifthereceiverisatriangle,thenwefitthetriangleintothelowerlefttriangleoftheparallelogram;andformoregeneralpolygonswithfourormoresides,ssibletogofurtherwithprojectivetransformations,mappingarbitraryplanarquadrilateralsintosquares(usingtheho-mogeneoustexturetransformationmatrixofOpenGL,forexample).Weassumeforsimplicity,however,thatthetransformationbetweentexturespace(thescreenspaceintheselightsourceprojections)andobjectspaceisaffine,andsowerestrictourselvestoparallelograms.
3.5SoftShadowAlgorithmforDiffuseScenesToprecomputesoftshadowradiancetextures:turnoffz-bufferingforeachreceiverpolygonchooseresolutionforreceiver’stexture(xypixels)clearaccumulatorimageofxypixelstoblackcreatetemporaryimageofxypixelsforeachlightsourcefirstbackfacetest:ifisentirelybehindorisentirelybehind,thenskiptonextforeachsamplepointonlightsourcesecondbackfacetest:ifxliisbehindthenskiptonextcomputetransformationmatrixM,whereaxli,andthebaseparallelogramfitstightlyaroundsetcurrenttransformationmatrixtoscalexy1Msetclippingplanestounear1andufarbigdrawwithilluminationfromxlionly,asdescribedinequation(2),intotempimageforeachotherobjectinscenedrawobjectwithambientcolorintotempimageaddtempimageintoaccumulatorimagewithweightsaveaccumulatorimageastextureforpolygonsteps,sticsampling[8]withthesamenumberofsamplesyieldssmootherpenumbrathanauniformgrid,jitfixednumberofsamplesoneachlightsourceisineffi-mplingofalightsourceismostimportantwhenthelightsourcesubtendsalargesolidanglefromthepointofviewofthereceiver,sincethatpproachistochoosethelightsourcesampleresolutionsuchthatthesolidanglesubtendedbythelightsourceareaassociatedwitheachsampleisbelowauser-specifiorithmcaneasilyhandlediffuse(non-directional)lightsourceswhoseoutgoingradiancevarieswithposition,hlightsources,importancesam-plingmightbepreferable:concenreaveragedtogethertocomputeasoftshadowimage,atobjectscastingshadowsneednotbepolygonal;layastaticscenefrommovingviewpoints,simply:3.8TextureResolutionTheresolutionoftheshadowtextureshouldberoughlyequaltotheresolutionatwhichitwillbeviewed(onetexturepixelmappingtoonescreenpixel);lowerresolutionresultsinvisibleartifactssuchasblockyshadows,bsenceofinformationaboutprobableviews,areasonabletechniqueistosetthenumberofpixelsonapolygon’stexture,ineachdimension,proportionaltoitssizeinworldspaceus-inga“desiredpixelsize”isscheme,therequiredtexturememory,inpixels,willbethetotalworldspacesurfaceareememoryfortrianglescanbefurtheroptimizedbyearetoomanypolygonsinthescene,orthedesiredpixelsizeistoosmall,thetexturememorycouldbeexceeded,cetexturescanbeantialiasedbysupersampling:gener-atingthehardandinitialsoftshadowimagesatseveraltimesthedesiredresolution,andthenfiedsurfacesshouldberenderedwithgoodtexturefilygonswillcontainpenumbralregionswithrespecttoalightsource,andwillrequirehightextureresolution,butotherswillbeeithertotallyshadowed(umbral)ortotallyilluminatedbyeachlightsource,mesthesefunctionswillbesosmooththtimizationsavessignifieacanbecarriedfurther,replacingthplexshadowpatternsandradiancefunctions,however,texturesmayrenderfasterthanthecorrespondingGouraudapproximation,dependingontherelativespeedoftexturemappingandGouraud-shadedtriangledrawing,z-bufferingforeachobjectinsceneifobjectreceivesshadows,drawittexturedbutwithoutilluminationelsedrawobjectwithillumination3.6BackfaceTesting0canbeoptimizedusingbackfaceThecaseswherecos+cos+ifpolygonisbehindpolygon,computethesigneddistancesfromtheplaneofpolygontoeachoftheverticesof(signedpositiveonthefrontofandnegativeontheback).Iftheyareallpositive,thenisentirelyinfrontof,iftheyareallnonpositive,isentirelyinback,otherwise,iftheapexofthepyramidisbehindthereceiverthatdefinesthebaseplane,simplytestifww0.0ateverypointontheTheabovecheckswillensurethatcosreceiver,butthereisstillthepossibilitythatcos0onportionsofthereceiver(ereceiverisonlypartiallyilluminatedbythelightsource).Thisfinalcaseshouldbehandledatthepohading,oragoodapproximationtoit,isneededhere.3.7SamplingExtendedLightSourcesThesetofsamplesusedoneachlightsourcegreatlyinflsamples,orapoorlychosensampledistribution,resultinpenumbrasthatappearstepped,anysamplesareused,however,formgridofsamplepointsisused,mple,ifauniformgridofsamplesisusedonaparallelogramlightsource,anoccluderbigedgecoplanarwithoneofthelightsourceedgeswillcause3.9ComplexityWenowanalyzetheexpectedcomplexityofouralgorithm(worstcasecostsarenotlikelytobeobservedinpractice,sowedonotdiscussthemhere).Althoughmoresophisticatedschemesarepos-sible,wewillassumeforthepurposesofanalysisthatthesameset5
3.10ComparisontoOtherAlgorithmslight
版权声明:本文标题:Simulating Soft Shadows with Graphics Hardware 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1702996671h438941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
更多相关文章
【历史上的今天】11 月 10 日:初代 Windows 诞生;Word 之父出生;Go 语言发布
整理 | 王启隆 透过「历史上的今天」,从过去看未来,从现在亦可以改变未来。 今天是 2021 年 11 月 10 日,在 1994 年的今天,我国第
2023ChatGPT浪潮,2024开源大语言模型会成王者?
《2023ChatGPT浪潮,2024开源大语言模型会成王者?》 一、2023年的回顾 1.1、背景 我们正迈向2023年的终点,回首这一年,技术
win7安装Ubuntu18.04双系统心得和踩坑总结
捣鼓了一天Ubuntu终于安装成功,开机可以选择进入Win7还是Ubuntu系统。在这里总结一下注意事项和我踩到的坑,希望可以帮助大家。 我这里只做一个总结,具体每一步的操
Windows server2019所有国家语言转换,不在担心系统中英版本
1,首先需要去MSDN下载语言包 复制到迅雷下载 ed2k:|file|mu_windows_server_2019_language_pack_x64_dvd_679192ff.iso|2831929344|E
个人实践win10下 64位 c与c++语言 vscode 的安装与配置,2019年4月
才知道有这么个文本编辑器,微软开发的,开源跨平台。支持市面上的各种主流语言(通过插件扩展),有智能补全,高亮等等功能。 整个文本编辑器几十MB,挺小巧。 界面看起来挺漂亮,所以准备尝尝鲜。 安装 版本是vscode 1.33 ,安装完
C语言编译器Visual Studio官方正版下载安装
首先打开微软官网。 微软官网https:www.microsoftzh-cn进入Visual Studio的产品介绍页。 一般我们用的是win系统。 点击下载。 选择社区版,因为其他版本要花钱ÿ
C语言windows系统库,windows.h
1.弹出对话框 首先调用Windows.h这个头文件 #include<windows.h> 接下来调用MessageBox(1,2,3,4); 第一个参数设置为0,第一个参数是依赖的窗口的编号&#
操作系统作业之银行家算法(c语言实现)
银行家算法分析: 银行家算法数据结构: 进程数 processNum 资源类数 resourceNum 系统剩余可利用资源Available,为一个含有m个元素的数组; 最大需求矩阵Max,为一个processNum*resourceN
操作系统实验(四)银行家算法C++语言实现
问题描述: 设计程序模拟预防进程死锁的银行家算法的工作过程。假设系统中有n个进程P1, … ,Pn,有m类可分配的资源R1, … ,Rm,在T0时刻,进程Pi分配到的j类资源为Allocationij个,它还需要j类资源Need ij个,
“C语言之父”40年前搞的操作系统复活,Linux、Windows都借鉴过它
本文转载自 量子位,作者 贾浩楠 Plan 9操作系统?没听说过…. 但事实是,连Linux、Windows都得叫它一声“老大哥”! 没错&
C语言实现银行家算法
一.银行家算法 1.由来 银行家算法最初是由荷兰计算机科学家艾兹赫尔·迪杰斯特拉(Edsger W. Dijkstra)于1965年提出的。当时他正致力于解决多道程序设计中产生的死锁问题。在多
C语言程序运行结果闪退怎么办
学习编译C语言的朋友们可能会遇到这样的问题,程序调试的时候没有错误,可是在运行结果的时候会发现程序结果闪退,导致看不到结果。关于此类问题,给出以下解决方
Java默认字符编码与Windows系统语言设置
href"http:liushi.hitideapluginsplogeshistylesplogeshi.css" type"textcss" rel"stylesheet&
sap c4c开发语言,SAP C4C Opportunity和SAP ERP Sales流程的集成
首先在C4C里创建一个新的Opportunity: 给这个Opportunity添加一个新的产品: 点按钮:Request Pricing, 从ERP抓取pricing数据&
在Mac下修改Office的界面显示语言
参考:在Mac下修改Office的界面显示语言 在Macos中,微软的Office套件的UI,是根据系统默认语言来设置的。系统是中文,Office就是中
【VS Code】Windows10下VS Code安装配置、功能介绍和各种语言、项目环境配置目录(持续更新中!)
这篇文章属于本人参考诸多博客、教程、文档等资料,所撰写的「Windows10上配置VS Code」系列文章的汇总目录,内容随时可能发生更新变动,欢迎关注和收藏本文以作备忘。
c语言编程对电脑配置的要求,请问学习电脑编程需要什么配置的笔记本电脑?价格多少?...
推荐5000元左右的笔记本。 推荐华硕PX574 ASUSPRO PX574 兼顾强大的性能与出色的便携性,为不间断生产力而打造。 选配8代 英特尔酷睿处理器,支持双硬盘。 双显卡 Intel®
系统语言在C盘什么地方,Win7桌面文件在C盘哪里?|Win7系统桌面文件在哪?
桌面文件,其实是C盘的一部分,所以就有了为什么放在桌面的文件越多,电脑就会越卡,就是这样的原因,有些用户就想搞清楚win7系统的桌
openai chatgpt 大语言模型
简介 OpenAI 一个美国人工智能研究实验室,由非营利组织 OpenAI Inc,和其营利组织子公司 OpenAI LP 所组成。该组织于 2015 年由萨姆·阿尔特曼、里德·霍夫曼、杰西卡·利
【语言-批处理】Win7 Win8 win10 双击bat直接以管理员身份启动
直接上bat代码,把下面的代码复制到,批处理文件的最前面即可,以后再也不用右击去选 以前管理员启动了echo offecho 正在启用超级管理员权限... %1 %2
发表评论