Algorithmically generating a drop shadow?
For my game, I need to be able to generate drop shadows. T开发者_开发技巧he kind that only span the bottom right. Like this (neglect the blue square):
Given a 2D array of RGBA pixels, how could I generate a drop shadow bitmap?
Thanks
This is done by a Gausian blur of a black square. It also can be done with every other shape.
A shadow is a black object of the same shape as the one casting the shadow, blurred and shifted. That's all there is to it.
精彩评论