解决方法
您可以使用内置的AlphaTestEffect和Stencil Buffer来实现您所需的屏蔽.
步骤是:
>清除模板缓冲区
>使用AlphaTestEffect将模板绘制到模板缓冲区,因此仅绘制非透明像素.
>使用模板缓冲区遮罩绘制图像.
Crappy Coding文章Texture Modification using Render Targets,with some Stencil Buffer Action显示了如何执行此操作并具有可用的示例代码.