[Bug 92309] Box drawn around cursor in multiple 3D games

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

 



Comment # 13 on bug 92309 from
acutiator, thanks in advanced for the effort. I have zero knowledge about all
of this, but this wikipedia article seems to be comprehensible:
https://en.wikipedia.org/wiki/Alpha_compositing

The important part:
~~~~~~~
If an alpha channel is used in an image, it is common to also multiply the
color by the alpha value, to save on additional multiplications during
compositing. This is usually referred to as premultiplied alpha.

Assuming that the pixel color is expressed using straight (non-premultiplied)
RGBA tuples, a pixel value of (0.0, 0.5, 0.0, 0.5) implies a pixel that has 50%
of the maximum green intensity and 50% opacity. If the color were fully green,
its RGBA would be (0, 1, 0, 0.5).

However, if this pixel uses premultiplied alpha, all of the RGB values (0, 1,
0) are multiplied by 0.5 and then the alpha is appended to the end to yield (0,
0.5, 0, 0.5). In this case, the 0.5 value for the G channel actually indicates
100% green intensity (with 50% opacity). For this reason, knowing whether a
file uses premultiplied or straight alpha is essential to correctly process or
composite it.
~~~~~~~

I've also found the following howtos when searching for this:
http://www.gamedev.net/topic/623481-how-to-create-pre-multiplied-alpha-for-use-with-opengl/
http://blog.qythyx.com/2014/01/premultiplied-alpha.html

Hope that helps a bit. You might wait a while whether someone more
knowledgeable gives you a better advice.


You are receiving this mail because:
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux