faster way to create 2d drop shadow in glsl? - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

If the shapes are constant, you could precompute the drop shadow. If not, it is simply a matter of making your blur shader more efficient. 2022DeveloperSurveyisopen!Takesurvey. Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore fasterwaytocreate2ddropshadowinglsl? AskQuestion Asked 6yearsago Modified 2years,4monthsago Viewed 5ktimes 2 2 I'mtryingtocreate2ddropshadowfilterusingglsl. whatI'mdoingnowisfirstrendermypixelsintoatexture,thenapplyagaussianblurfiltertoit,thendrawittomainframebufferwithtintedcolor,thendrawtheactualpixelsontop. Theresultisquite,nice,buttheperformanceisquitelow.soit'sthereasimplerwaytocreatedropshadowusingglsl,sincetheshadowdoesn'tneedallthecolorcomponentsoftheactualpixel,onlythealphavalue? opengl2dglslshadow Share Improvethisquestion Follow askedMay24,2016at7:57 ZhiqiangLiZhiqiangLi 35144silverbadges1616bronzebadges Addacomment  |  1Answer 1 Sortedby: Resettodefault Highestscore(default) Datemodified(newestfirst) Datecreated(oldestfirst) 2 Iftheshapesareconstant,youcouldprecomputethedropshadow.Ifnot,itissimplyamatterofmakingyourblurshadermoreefficient.Thereisalotofinformationavailableaboutthisonline,suchasRideout'sarticle(archived)orivankuckir'sarticle(archived). ThetrickistominimizetheamountofTexture2Dcallsandtousebuilt-infeatureslikelineairinterpolation. AlsorefertoFastestGaussianblurimplementation Share Improvethisanswer Follow editedJan19,2020at12:24 answeredMay24,2016at10:56 FonsFons 1,06199silverbadges1010bronzebadges Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedopengl2dglslshadoworaskyourownquestion. TheOverflowBlog Makeyouropen-sourceprojectpublicbeforeyou’reready(Ep.444) Thescienceofinterviewingdevelopers FeaturedonMeta AnnouncingthearrivalofValuedAssociate#1214:Dalmarus Improvementstositestatusandincidentcommunication RetiringOurCommunity-SpecificClosureReasonsforServerFaultandSuperUser Temporarilypausingthesitesatisfactionsurvey StagingGround:ReviewerMotivation,Scaling,andOpenQuestions Linked 39 FastestGaussianblurimplementation Related 9 Omnidirectionalshadowmappingwithdepthcubemap 4 HowexactlydoesdeferredshadingworkinLWJGL? 2 glslpixelshader-distancetoclosesttargetpixel 0 Pseudo-Randomvec2creationwithGLSL 0 DropShadowwithGolangbasedonalpha HotNetworkQuestions Googlespreadsheets Mymodelhasnotfinishedevaluatinginmorethanadaysocan'ttestifitworks,whatiswrongwithit? Whatdoestheidiomaticphrase"erronthesideof"mean? 'Mapping'thevaluesofalisttovariable WhatdoesGandalftheWhitemeanbyhisstrangespeechaboutBoromir? Isitaredflagforacompanytohave"unlimitedpaidtimeoff"? Whatdisadvantagesaretheretoencryptinganentireharddriveorahomedirectory? FindthenthFibonaccinumber,wherenisthemthFibonaccinumber Softwareforcreatinghand-writtenslidesthatarerevealedgradually GameinJamesBondfilm"FromRussiawithlove" HowManyDaysAfterSkimCoatCanIPaint? Can"LaCorrida"mean"TheBullfight"? ESTAform:Mentionthecitydistrictinthecontactinformationsection? WhatisRNAVtransitionandwhatisthedifferencebetweenRNAVtransitionandRNAVSTAR Can'tmultiplywidthin\newcommandforincludegraphics Doesgravitationreallyexistattheparticlelevel? WhentochangeoilfornewgenerationMazda? CanWgatebewrittenonlyusingH,T? Twoparallelrelaysfordoublecurrent WhywouldIuseatrainerinsteadofridingoutside? Partitioningalistbasedonacriterionforsublists CanImakeGooglePlayshowmeALLreviewsforanapp? DifferencebetweenfirewallandACL Mathematica13.0simplifiestrigonometricintegralwrong morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-c Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?