forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Code for Drop shadow effect?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
theHobbit



Joined: 30 Sep 2006
Posts: 65

PostPosted: Fri Jul 04, 2008 7:51 am    Post subject: Code for Drop shadow effect? Reply with quote

Hi there, could anyone post the code to make a drop shadow effect of an image or sprite please?

Thanks in advance
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Fri Jul 04, 2008 5:19 pm    Post subject: Reply with quote

shadows for dummies:
1) draw your sprites as hardware accelerated rectangles
2) first draw the shadow at x+displace, y+displace being x,y your sprite position and displace a const to adjust: draw your shadow drawing the sprite specifying black/half transparent as each vertex's color
3) draw your sprite at x,y
Considerations: if you need a basilar 2d environment then disable z-buffer...BUT z-buffer can give you layers organization _for free_. If you wasn't speaking of 2d shadows but of 3d ones, then you have a looooong way to walk. If so, start learning algorithms, not code: A nice place to learn this kind of algorithms is www.delphi3d.net (quite out of date, but full of interesting and easy to understand articles)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group