GPUImage中用alphablend时png图片透明部分偏灰的问题解决

Standard

将GPUImageAlphaBlendFilter.m中的“gl_FragColor = vec4(mix(textureColor.rgb, textureColor2.rgb, textureColor2.a * mixturePercent), textureColor.a);”(老sdk有一处,新sdk有两处)替换为:“if (textureColor2.a == 0.0) {
gl_FragColor = textureColor;
} else {
gl_FragColor = vec4(mix(textureColor.rgb, textureColor2.rgb / textureColor2.a,mixturePercent * textureColor2.a), textureColor.a);
}”即可。

发表评论

邮箱地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>