我想弄清楚如何在WebGL中进行混合模式。到现在为止,我所用的原生HTML5画布绘制功能,与您可以做,比如: var ctx = new Document.getElementById('canvas').getContext('2d');
ctx.globalCompositeOperation = 'lighter'
现在,我想,出于性能考虑,港口这对WebGL的。但是,我很难理解我可以
这已被问过,但我没有找到一个令人满意的答案呢。是否真的没有办法为UIView设置混合模式(也就是说,使用GPU合成来实现混合)。 有一些建议使用像这里CGContextSetBlendMode:Draw an image in Additive Blend Mode without using OpenGL但我迄今为止偶然发现的所有这些解决方案似乎使用绘图程序,据我了解(并且据我的性能测量提示),
我有这种颜色的PS actual = <some color loaded from texture>;
actual.a *= 0.05; //reduce the alpha to have a more transparent result
//Front to back blending
actual.rgb *= actual.a;
last = (1.0 - last.a)