On Mon, 26 Jan 2004, Thomas Winischhofer wrote:

> Sottek, Matthew J wrote:
> >>a) is used for aa text; however, sometimes (haven't yet found out why)
> >>the alphaType argument to this is not PICT_a8 as one would expect, but
> >>PICT_a8r8g8b8.
> >>
> >>I don't quite get the logic behind this. What's the CPUToScreenTexture 
> >>hook for if CPUToScreenAlphaTexture should be able to deal with ARGB 
> >>textures? And how should the "red", "green" and "blue" arguments 
> >>correlate with the RGB contents of this odd texture?
> > 
> > 
> > a) Is used whenever you want to combine a per-pixel alpha with a
> > diffuse color. Text, as you said is the common case but I think there
> > were other intentions...
> > 
> > I've seen some screenshots on Keith's site that show using a window's
> > own alpha channel as a drop shadow. In order for that to work you
> > would need to get an argb input (the offscreen copy of the full
> > window contents) but only use the "a" and use the diffuse rgb as
> > provided. Maybe that is the intended use?
> 
> Hm. I _think_ we're talking about the same thing. However, my (second) 
> question was more meant in the line of the following:
> 
> I am given a constant r, g and b as each a separate parameter, and an 

   You are also given "a".

> a8r8g8b8 texture which by Mark's explanation is for providing an alpha 
> value for each of the r, g, b components. But the format is _a8_r8g8b8; 

   No, it modulates r, g, b, and a.

> if the components' alphas are in the r8g8b8 part, what's to happen with 
> the a8 part of that texture?
> 

  You are given constant a, r, g, b.  An a8 texture modulates all of
them:

   a *= a8
   r *= a8
   g *= a8
   b *= a8

  An a8r8g8b8 texture without componentAlpha is the same:

   a *= mask.a
   r *= mask.a
   g *= mask.a
   b *= mask.a

  With componentAlpha:

   a *= mask.a
   r *= mask.r
   g *= mask.g
   b *= mask.b


                Mark.

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to