admin 管理员组文章数量: 1087139
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://roclinux.cn/p/1702996671a438941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
更多相关文章
GO语言编程:GoLand 2022 (Win&Mac) v2022.3 中文激活版
GoLand是一款由JetBrains开发的集成开发环境(IDE),专门用于Go编程语言的开发。它提供了一系列功能和工具,以提高开发人员的效率和代码质量
vscode中文支持xp_VSCode (Visual Studio Code) V1.43.0下载并设置成中文语言的方法
Visual Studio Code(简称 VS CodeVSC) 是一款免费开源的现代化轻量级代码编辑器,支持语法高亮、智能代码补全、自定义热键、括号匹配、代码片段、代码对比 Diff、GIT 等特性&
修复计算机语言设置是哪个键,Windows语言设置后修复计算机的方法
当我们给我们的windows语音设置后,电脑可能会出现点问题,这个时候我们需要修复一下计算机,其中要进入BIOS的操作可能会难倒一部分新手用户,那么该如
世界各国浏览器语言代码本地化对照表
阿尔巴尼亚语 [sq] 阿尔巴尼亚语(阿尔巴尼亚) [sq-AL]阿尔萨斯语 [gsw]阿尔萨斯语(法国) [gsw-FR] 阿拉伯语 [ar] 阿拉伯语(阿尔及利亚) [ar-DZ]阿拉伯语(阿联酋) [ar-AE]阿拉伯语(阿曼) [a
ODPS2.0语言升级和兼容问题
问题一:invalid.column.name 在引用一个column时候, LOT模式支持.., 其中这一字段实际会被编译器完全忽略。很多用户可能会在写project_name,但实际上这也是不允许的。原本的编译器
Win7(Win10)+Ubuntu18.04(16.04)双系统安装心得
Win7+Ubuntu18.04双系统安装心得 前阵子作为一个新手小白,一直在鼓捣安装个双系统,今天抽空来总结一下吧,参考了大神的博客,加上我自己的一些体验,写在这留待以后参考吧。 首先我的电脑是1T硬盘,于是我给linux分了大概200
小米4c怎么添加语言怎么设置在哪,小米路由器4C手机怎么设置?
在本文中,将给大家详细的介绍,用手机设置小米路由器4C上网的方法。 新买的、恢复出厂后的小米路由器4C,用手机设置上网时,建议按照下面这个顺序进行操作。
【C语言】解决error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead...
几天编译文件的时候报错, 编译出错信息:错误 1 error C4996: fopen: This function or variable may be unsafe. Consid
Kali Linux安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务
Kali Linux的安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务 1 安装1.1 下载官方镜像1.1.1官网下载1.1.2 国内开源镜像站下载 1.2 导入虚拟机 2 基
R语言学习(1)——Windows系统下安装R及Rtools
文章目录 安装R安装Rtools R版本会不断更新,此文以安装R 4.3.1 和 Rtools 4.3为示例,以供安装最新的R和Rtools作参考 安装R 进入R官网(htt
Win10 中文语言包下载指南:轻松切换系统语言,提升操作体验
Win10 中文语言包下载指南:轻松切换系统语言,提升操作体验 【下载地址】Win10中文语言包下载指南分享 Win10 中文语言包下载指南本仓库提供了一个资源文件,用于下载
用C语言做QQ (初级版)
用C语言做QQ (初级版) 目录 用C语言做QQ (初级版)网络基础入门:什么是网络网络简史网络的诞生90年代的上网方式:电话拨号上网00年代的上网方式:宽带连接上网10年代
DeepSeek与ChatGPT:AI语言模型的全面对决
DeepSeek与ChatGPT:AI语言模型的全面对决 引言:AI 语言模型的时代浪潮一、认识 DeepSeek 与 ChatGPT(一)DeepSe
C语言Windows图形界面程序学习(一)
第一课——Hello,world 新建程序开始编写代码Hello,world运行结果如下拓展源代码:运行结果本次实验是在vc6平台下实现的,弹出对话框——Hello,world 新建程序 新建一个工程 选择“一个简单的Win32程序” 转移
Windows下vscode配置C语言编程环境(初学者入门 超详细)
目录 一、前言 二、配置环境 2.1 下载MinGW 2.1.1 通过MinGW官网下载 2.1.2 直接点击下方链接下载 2.1.3 解压文件 2.2 配置环境变量 2.2.1 配置环境变量 2.2.2 测试环境变量
c语言输入字符串有空格怎么办
char str[50];printf("输入一段字符串:");fgets(str,50,stdin);采用fgets输入可以识别空格,如输入hello world,输出h
android studio没有java语言选项怎么办
我的android studio没有java语言选项怎么办。我打算用java来做一个android应用,但是好像没有看到有java选项,我这个是ubuntu系统 其实运气可能是太好了点。应为你会发
win10c语言文件不运行,win10系统运行程序出现“dll文件没有被指定在windows运行”的解决教程...
win10系统使用久了,好多网友反馈说win10系统运行程序出现“dll文件没有被指定在windows运行”的问题,非常不方便。有什么办法可以永久解决win10系统运行程序出现“dll文件没有被指
解决Windows 10家庭单语言版语言限制:升级专业版全攻略
解决Windows 10家庭单语言版语言限制:升级专业版全攻略 在日常使用Windows 10系统时,部分用户可能会遇到系统提示“当前许可证仅支持单一显示语言”的困扰。这一问题通常出现在预装或激活了Windows 10家庭单语言版的设备上
(已解决)windows系统卸载office2013(安装程序包语言不受系统支持)
文章目录 1. 前期探索✅2. 解决方案2.1 直接下载软件(界面是英语的)2.2 分步下载软件(界面是中文(但可能会下载失败))
发表评论