开发者

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:

  1. copy the object,
  2. move it in the opposite direction of the light source and use its distance as a weight,
  3. turn it totally black,
  4. blur it using the light source's distance as a weight, too,
  5. put it behind the object,
  6. lower the alpha if you want.
  7. ?????
  8. profit.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜