Simple drop shadow for game character - GameDev.net

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

Hi all, I wondered if anyone has a good idea for making a simple "drop shadow" in OpenGL for characters and other objects in a 3D world. AllContent Blogs Forums News Tutorials LogIn SignUp  Login Username/Email Password Rememberme Forgotpassword? Login or Don'thaveaGameDev.netaccount?Signup  Forgotyourpassword? EmailAddress ResetPassword Pleasecontactusifyouhaveanytroubleresettingyourpassword. Home Blogs Careers Careers Forums News Portfolios Projects Tutorials New?Learnaboutgamedevelopment FollowUs ChatintheGameDev.netDiscord! BacktoGraphicsandGPUProgramming Simpledropshadowforgamecharacter GraphicsandGPUProgramming Programming OpenGL Startedby tseval October16,200809:04AM 3 comments,lastbyzedz13 years,7 monthsago Advertisement tseval Author 130 October16,200809:04AM Hiall, Iwonderedifanyonehasagoodideaformakingasimple"dropshadow"inOpenGLforcharactersandotherobjectsina3Dworld.IwasthinkingsomethinglikethesimpleshadowsinWoWwhereyoujusthaveadarkspotonthegroundunderthecharacter. ThiswillbeusedinanOpenGLgameenginewherewewanttohavevariousoptionsforobjectshadowsrangingfromshadowmapstothesesimpleshadows. TIA Cancel Save DrHalan 122 October16,200809:10AM castarayfromthecharactertotheterrrainandtheneither:-drawaquadcontaingtheblob-shaodw-usethesamewayyoudoshadowmappingtocorrectlyprojectthedropshadowontothefloor Cancel Save MyBlog-http://www.freakybytes.org tseval Author 130 October16,200802:30PM Iwasthinkingaboutthevariantwithablob-texturedquad.IamhoweverabituncertainhowIwouldhandledepthsortingandz-bufferissueswiththismethod.IguessIcoulddisabledepthtesting/depthwriteanddrawitaftertheterrainandbeforetheshadowingobject.Notsurehowthiswouldworkwhendrawingotherobjectsnearbythough.ItwouldsimplifythingsalotifIcoulddrawtheshadowstogetherwiththeshadowingobject,insteadofdrawingallshadowsbeforeallobjects.Anythoughtsonthis? Cancel Save idinev 236 October16,200804:43PM Don'tsweatittoomuch.Iftheshadowdoesn'tcorrectlyoverlapwhenthecharacterisclimbingsomestairs,almostallusersdon'ttakenoticeofit.(althoughforusprogrammers,itcanbeinfuriatingtoseeourcreationsfaillikethat).Youcaneasilygetawaybyputtingtheshadowquad6inchesabovetoes.(butdrawitwithdisableddepth-writeanddepth-test,beforedrawingthecharacter).It'sblocky,pixelatedstuff,thatcatcheseveryone'seyes.Anotheridea,ifyouwanttodoabitmorecorrectprojection:gatherthegeometry,thatisjustunderthecharacter'sfeet,drawthosetriangleswiththeround-shadowtexture(calculatetexcoordsinshader,texenvcombinerormanually). Cancel Save zedz 291 October17,200803:09AM yeahdontworryaboutegquake3justhadaroundspotunderthecharacter+sometimesthatwouldfloatintheairwhenyourehalfonastair Cancel Save Share: Thistopicisclosedtonewreplies. Advertisement Advertisement PopularTopics ShouldIevenbotherdoingmarketingduringthesetimes? GamesBusinessandLaw Wheredoyoustartwhencreatingagame? WritingforGames buildinggamewithdifferentprogrammers GeneralandGameplayProgramming Jobsforpsychologyingames? GamesCareerDevelopment Bestwaytovalidatealgorithms? ForBeginners HowwasEmpireEarthabletorenderhundredsof3Dmodelsonthescreenwhenithadnoaccesstoshaders? GraphicsandGPUProgramming Reticulatingsplines AboutGameDev.net TermsofService PrivacyPolicy ContactUs Copyright(c)1999-2021GameDev.net,LLC BacktoTop



請為這篇文章評分?