Simple drop shadow for game character - GameDev.net
文章推薦指數: 80 %
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
延伸文章資訊
- 1What rendering techniques would I use to draw a drop ...
For further trickery, you can alternate between shadow and card render to get effect like (d), or...
- 2Tutorial 16 : Shadow mapping
Tutorial 16 : Shadow mapping. Basic shadowmap. Rendering the shadow map. Setting up the rendertar...
- 3[OpenGL] Shadow Map 陰影 - 程式人生
圖:隨著鍵盤控制點光源位置移動,陰影發生實時的變換... box_shadow div陰影效果. div內陰影box-shadow: 0px 0px 10px 5px # ...
- 410 Graphic Design Mistakes You May Not Know You're Making (and how ...
- 5Drop shadow - Wikipedia