Re: Question with regards to componentAlpha

Keith Packard <[email protected]> Sat, 14 Sep 2002 08:08:39 -0700
Newsgroups gmane.comp.xfree86.render
Message-ID <E17qEXH-0000L4-00@localhost>
Around 15 o'clock on Sep 13, Thomas Roell wrote:

> (VII)	dest.b = (source.b * mask.b) * 1 + dest.b * (1 - source.a * mask.b)
> 	dest.g = (source.g * mask.g) * 1 + dest.g * (1 - source.a * mask.g)
> 	dest.r = (source.r * mask.r) * 1 + dest.r * (1 - source.a * mask.r)
> 	dest.a = (source.a * mask.a) * 1 + dest.a * (1 - source.a * mask.a)	
This is the intended function.  If you find the spec wording unclear, 
please suggest changes.

> Even worse, unless "source" or "mask" is a constant it is not implementable
> in hardware reasonable (unless 2 passes are used).

I'm sorry your hardware doesn't permit acceleration of this function.  
Some does.

In a brief conversation with Tom Duff, it turns out that many lighting 
effects use this function, in particular it is use to emulate stained 
glass in Renderman (as seen in Young Sherlock Holmes).

And, it's currently used by Xft to draw text on monitors with known 
sub-pixel geometries.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab