ShaderLab syntax: Blending 混合 Blending is used to make transparent objects. 混合是用来制作透明物体的. When graphics are rendered, after all shaders have executed and all textures have been applied, the pixels are written to the screen. How they are combined with…
Alpha 混合的算法很简单,基于下面的公式就可以实现: D := A * (S - D) / 255 + D D 是目标图像的像素, S 是源图像的像素 A 是 Alpha 值, 0 为全透明, 255 为不透明. 下面是 16 位 565 格式的混合算法的实现,首先用最简单的方式实现,即逐个像素的处理: // 一次处理一个像素,比较简单,但速度较慢 procedure AlphaBlend656(BmpDst, BmpSrc: TBitmap; Alpha: Byte); var i, j,…