admin 管理员组文章数量: 1086019
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.roclinux.cn/p/1702996671a438941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
更多相关文章
ChatGPT润色魔术:一文教你让论文语言更专业!
目录 1.英文润色 2.中文润色 3.SCI润色 4.润色Prompt汇总 宝子们在写学术论文时,要想让ChatGPT发挥出它的“超能力”,特别是在润色文本时,精确和
从零开始在Windows上快速部署Ollama实现本地AI大语言模型的高效运行
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家:人工智能教程文章目录 前言1. 运行Ollama2. 安装Open
Windows Server 2012 配置指南 之 系统语言汉化篇
首先,当我们连接上服务器的时候,许多小伙伴是茫然的,没错是茫然的! 因为我们的女票竟然还是一个洋妞,咋办呢?
【Windows如何设置系统语言为英文】
主要为了解决程序是英文版,但系统关机时显示的中文的问题 1、在开始菜单中,点击打开【设置】-【时间和语言】-【添加语言】 2、在添加语言界面选择“英文English”-【安装】-下载完成 3、关
戴尔电脑安装Ubuntu16.0418.04双系统心得
戴尔电脑安装Ubuntu16.0418.04双系统心得 一、戴尔电脑安装Ubuntu16.04教程 1.第一步就是进行U盘的烧录,推荐使用的烧录软件是软碟通UltraISO官方中文版。 下载地址ÿ
go语言windowslinux系统下的交叉编译
在开发中往往总是遇到在windows系统下开发,在linux系统上部署的需求。那么如何做交叉编译呢?下面以64位系统为例。 一、Windows下编译成Linux可执行文件 # cmdgo en
更改windows显示语言_如何在Windows 10中更改显示语言
更改windows显示语言 Windows 10 supports changing the default language. You no longer need to be concerned about the default la
本地应用程序_应用程式本地化的十大语言
本地应用程序 应用本地化统计,案例研究和分析 (App localization statistics, case studies and analytics) The goal of every app develo
视频教程-C语言大型软件设计的面向对象-CC++
C语言大型软件设计的面向对象 他长期在跨国企业担任一线工程师和系统架构师,编写大量的Linux代码,并负责审核其他同事的代码。他是Linux的活跃开发者,在Linux主线内核
【VS Code】Windows10下VS Code配置C#、F#语言环境
文章目录 0. 微软.NET开发环境相关资料0.1 .NET的强大之处0.2 .NET、.NET Framwork、.NET Core、C#F#VB...之间的关系0.2.1 什么是.NET Framework0.2.2 .NET Fr
Windows10操作系统搭建C语言开发环境
方案一:WSL后台 + VS Code操作界面 方案特点:新手易上手,有官方指导文档,后台为Linux环境,需要连接外网安装。 第一步:安装VSCodeVisual Studio Codehttps:code.visu
Tiny11作者开源:利用微软官方镜像制作独属于你的Tiny11镜像
微软对Windows 11的最低硬件要求包括至少4GB的内存、双核处理器和64GB的SSD存储。然而,这些基本要求仅仅能保证用户启动和运行系统,而非流畅使用 为了提升体验,
Wombat:93%ChatGPT性能,无需RLHF就能对齐人类的语言模型
文 | zzy 文章地址: https:arxivabs2304.05302v1 训练代码: https:githubGanjinZeroRRHF 模型权重: https:hu
小米4c怎么添加语言怎么设置在哪,小米路由器4C手机怎么设置?
在本文中,将给大家详细的介绍,用手机设置小米路由器4C上网的方法。 新买的、恢复出厂后的小米路由器4C,用手机设置上网时,建议按照下面这个顺序进行操作。
Kali Linux安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务
Kali Linux的安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务 1 安装1.1 下载官方镜像1.1.1官网下载1.1.2 国内开源镜像站下载 1.2 导入虚拟机 2 基
python语言磁力搜索引擎源码公开,基于DHT协议
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接:https:blog.csdn
银行家算法 c语言
操作系统学习之银行家算法,c语言代码实现: 本人原创代码,如果有什么错误的地方,欢迎大佬指正! #include<stdio.h>#include <malloc.h>#include<stdlib.h
C语言大作业 数据结构 医院候诊排队系统 代码【可运行代码+截图】
设计内容: 设计一个医院候诊排队系统。问题描述:医院各科室的医生有限,因此病人到医院看病时必须排队候诊,而病人的病情有轻重之分,
c语言windows.h头文件详解
如果c语言库里没有某个头文件 只需要将下好的头文件放入下面的路径即可 windows.h头文件包含的函数及其用法 1.GetAsyncKeyState()()通过函数来判断按键按下的状态 主要用法是VK_键的名称 例如 GetAs
【操作系统--页面置换算法】C语言详解--大作业版(附代码)
一、实验目的 1设计和实现FIFO,LRU,OPT和CLOCK算法 2设计和实现一个完整的可供选择不同算法的程序 3通过页面访问序列随机发生器实现对上述算法的测试及性能比较 4领略页面置换背后的资源调配思想,并
发表评论