Additive (not linear) compositing when using GLX

Carsten Haitzler (The Rasterman) raster at rasterman.com
Mon Oct 18 16:48:45 PDT 2010


On Mon, 18 Oct 2010 12:57:25 -0500 Rendaw <rendaw at zarbosoft.com> said:

>   On 10/18/2010 02:49 AM, Carsten Haitzler (The Rasterman) wrote:
> > you are not producing a premultiplied alpha result. fix that and presto. :)
> I guess I sort of expected glx to handle that, since, should it not, I'd 
> have to change all my calls to glBlendFunc/glColor, glClearColor, and 

yup. you need to change them. as such it won't hurt - you should use premul
argb anyway. there is no other sane way to do destination alpha rendering and
keep rendering correct - so if you ever render to an fbo for example - you'll
need this mode if you ever want that fbo to have an alpha channel of its own
etc.

> all my shader code, right?  Or is there an easier way to get 
> premultiplication?  Well, I guess transparent applications aren't 
> exactly common, anyways.

well that depends what you are doing in your shaders :) and also what your
textures are. as such i moved my entire rendering pipeline to premul ages ago -
textures are premul argb, as are fbo's, buffers and everything. once youa re
there life is easy.

> Anyways, thanks, I got it working!  Thank goodness I was wrapping all my 
> OpenGL calls and not using any shaders! Or something.



-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com



More information about the xorg-devel mailing list