admin 管理员组

文章数量: 1087836


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

本文标签: 学好 语言 心得 作者

更多相关文章

c语言-实现学生选课系统

5月前

下载源代码链接: https:download.csdndownloadqq_4417634364109300 1.本文使用C语言写的一个简单项目,学生的选课系统,主要实现对学生和课程信息管理,实现系统的管理学生和课程选课退课等信

用C语言做一个好玩的4399游戏盒

5月前

前言 墨奇游戏盒:探索无尽乐趣的奇幻之旅 在数字世界的浩瀚海洋中,墨奇游戏盒犹如一艘满载宝藏的航船,引领我们驶向无尽的游戏乐趣。这里,经典与创新交织&a

精进:如何成为一个很厉害的人--作者:采铜

5月前

精进:如何成为一个很厉害的人 作者:采铜 文章目录 精进:如何成为一个很厉害的人序 用更勇敢的方式去生活01 时间之尺 我们应该怎样对待时间活在“全部的现在” 从当下出发&

Win7(Win10)+Ubuntu18.04(16.04)双系统安装心得

5月前

Win7+Ubuntu18.04双系统安装心得 前阵子作为一个新手小白,一直在鼓捣安装个双系统,今天抽空来总结一下吧,参考了大神的博客,加上我自己的一些体验,写在这留待以后参考吧。 首先我的电脑是1T硬盘,于是我给linux分了大概200

类ChatGPT的各种语言大模型LLM开源Github模型集合​

5月前

作为开发人员,面对堪称科技奇点爆发的ChatGPT,我们如何应对。当然是努力跟进,虽然ChatGPT不开源,但是有诸多不输ChatGPT的各类语言大模型

Windows10 C语言开发编译器Dev C++

5月前

工欲善其事必先利其器,现在很多想学习编程又入手新机的小伙伴用的大都是正版的Windows10系统。C语言作为编程入门级别的语言,是很多高校在大一就开设的先行课。很多大学的机房用的大都是Window

Kali Linux安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务

5月前

Kali Linux的安装与配置——下载安装、中文语言、设置root账户、配置静态IP、启用SSH、更换国内源、安装软件和启用自带服务 1 安装1.1 下载官方镜像1.1.1官网下载1.1.2 国内开源镜像站下载 1.2 导入虚拟机 2 基

PS2019 cc for Mac语言切换

5月前

下载语言包 点击进入下载页面 提取码:ohqs 操作步骤 ①关闭PS软件 ②把语言包拷贝到locales中 ③打开PS(按照指示进入常规界面) 我的已经设置为中文&am

C语言多线程实例之pthread的应用(在windows下的应用(win7))

5月前

Pthread是由POSIX提出的一套通用的线程库,在linux平台下,它被广泛的支持,而windows平台下,却并不被支持,而p

C语言大作业 数据结构 医院候诊排队系统 代码【可运行代码+截图】

5月前

设计内容: 设计一个医院候诊排队系统。问题描述:医院各科室的医生有限,因此病人到医院看病时必须排队候诊,而病人的病情有轻重之分,

在Windows系统中安装Go语言

5月前

第一步:在Downloads - The Go Programming Language网站中,下载了go.1.17.7.windows-adm64.msi。 第二步:运行

windows server 2008 R2如何更换系统界面语言中文换英文

5月前

下面我们来讲解一下如何将中文系统转化成日文、韩文、英文等其它语言界面的系统。以windows server 2008 R2系统中文变英文为例:1、到微软官方下载:Windows Server 20

说说系统分析师考试(从考试介绍到考试心得)

5月前

软考,2004软考改革,职称以考代评 系统分析师考试,就是参加软考。 软考——中国计算机技术与软件专业技术资格考试,是国家级的IT专业技术人员从业资

Windows7系统修改GO语言环境变量(GOPATH)

4月前

1、打开cmd命令,输入:go env ;查看当前系统下的环境变量 2、创建goWork文件,此为工作空间; 3、在goWork文

DeepSeek与ChatGPT:AI语言模型的全面对决

4月前

DeepSeek与ChatGPT:AI语言模型的全面对决 引言:AI 语言模型的时代浪潮一、认识 DeepSeek 与 ChatGPT(一)DeepSe

配置windows C语言环境

4月前

配置c语言运行环境 下载mingw-w64 在线安装.exe文件。mingw-64 file 然后,双击“mingw-w64-install.exe”,就出现安装提示框。 x86_64&

利用银行家算法避免死锁(C语言实现)

4月前

利用银行家算法避免死锁 【注】本代码数据及思路方法参考自《计算机操作系统&#xff08;第四版&#xff09;》汤小丹等 编著的教材。 #include <iostream>#define m 3资

go 项目在windows上运行_Go 语言在 Windows 上的安装及配置

3月前

既然要学习 Go 语言,那么肯定要在本机安装 Go 语言的开发环境,这节课我们就来学习下如何在 Windows 操作系统下安装 Go 语言的开发环境: 1. Go 语言的下载 Tips:本文以本文撰写时的 Go 语言最新版本,也就是 go.

Windows单语言版显示语言限制解析与专业版升级指南

2月前

Windows单语言版显示语言限制解析与专业版升级指南 现象解析:为何系统仅支持单一显示语言? 当用户收到"Windows许可证仅支持一个显示语言"的提示时,这表明当前系统为Windows 10家庭单语言版。该版本是

国产人工智能语言大模型相关网站

2月前

以下给大家分享了一些国产人工智能语言大模型相关网站&#xff0c;仅供参考。&#xff08;大语言模型仅仅是作为辅助工具&#xff0c;实际应用中还是要多思考和学习&#xff09; 1.字节豆包&#

发表评论

全部评论 0
暂无评论