Making Photoshop-like drop shadows in a game
I'm making a game where the game's size varies, so I want to make my own shadows. The api i'm using can fill开发者_运维技巧 rectangles, make ellipses, horizontal lines etc. And supports rgba. Given this, how could I make a drop shadow? I tried making a black to white gradient and setting the alpha to 20%, but it didnt look very good... I'm not sure how they are done. Thanks
I would suggest:
- copy the object,
- move it in the opposite direction of the light source and use its distance as a weight,
- turn it totally black,
- blur it using the light source's distance as a weight, too,
- put it behind the object,
- lower the alpha if you want.
- ?????
- profit.
精彩评论