开发者

Algorithmically generating a drop shadow?

开发者 https://www.devze.com 2023-03-05 23:49 出处:网络
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):

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):

Algorithmically generating a drop shadow?

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.

0

精彩评论

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