Tiling is not broken. The problem with IE is that it pre-mutliplies colors by alpha, and then divides back, ignoring UNPACK_PREMULTIPLY_ALPHA_WEBGL being false. Closer your alpha to 0, more precision loss occurs on IE. Try separating color and alpha to different textures.
又一个GITHUB上的相关信息: Some implementations of HTMLCanvasElement's CanvasRenderingContext2D store color values internally in premultiplied form. If such a canvas is uploaded to a WebGL texture with the UNPACK_PREMULTIPLY_ALPHA_WEBGL pixel storage parameter set to false, the color channels will have to be un-multiplied by the alpha channel, which is a lossy operation.
2 个回复
InJoins
赞同来自:
在我的IOS手机上,带ALPHA通道的贴图的颜色先是被预乘了ALPHA,然后又除以了ALPHA,所以,在ALPHA比较低的地方,像素颜色变的很暗。
LAYA引擎的大神,能研究一下这个问题吗?(在PS里做一张半透明贴图,RGB拉一个渐变,ALPHA也拉一个渐变,然后用SUPERPNG导出;或者ALPHA拉在蒙板里,用PS自己的PNG格式导出也行;然后赋值给一个模型,就可以看到问题)
Tiling is not broken. The problem with IE is that it pre-mutliplies colors by alpha, and then divides back, ignoring UNPACK_PREMULTIPLY_ALPHA_WEBGL being false. Closer your alpha to 0, more precision loss occurs on IE. Try separating color and alpha to different textures.
InJoins
赞同来自:
Some implementations of HTMLCanvasElement's CanvasRenderingContext2D store color values internally in premultiplied form. If such a canvas is uploaded to a WebGL texture with the UNPACK_PREMULTIPLY_ALPHA_WEBGL pixel storage parameter set to false, the color channels will have to be un-multiplied by the alpha channel, which is a lossy operation.