[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Premultiplied alpha blending and issues with color accuracy

On Fri, May 11, 2012 at 10:52 AM, Thor Harald Johansen <thj@thj.no> wrote:
This would work in the case of an image calculated in the shader, I suppose, so that's a possible solution for the brush issue, but what about blending 2 textures together? I suppose that if I'm going to implement layers, I could just blend these to the main frame buffer by using premultiplied alpha, since I'm not actually outputting an alpha channel to the 3D canvas. For a low number of layers with relatively high opacity values, this should look fine, I guess.
If you have a stack of alpha blended layers, you can just draw them on top of each other. However, if you need different blending equations for layer blending (like grain merge etc.) which the GL blending equation can't do, you'll have to do a ping-pong too.