Understanding of color, Alpha, and mixing in OpenGL

Source: Internet
Author: User

If blending is enabled, the Alpha value is often used to mix the color value of the processed part with the color value of the pixel already stored in the frame buffer. The Alpha value can be used for Alpha testing. It is determined to accept or reject a piece based on its alpha value (after the scenes are raster and converted to fragments, but before the final pixel is drawn to the frame buffer ).

 

Without mixing, each new clip will overwrite the existing color value in the frame buffer, just as the clip is not transparent. If you use a mixture, you can control how the original color value is mixed with the color value of the new clip. Therefore, the Alpha mixture can be used to create translucent fragments and retain the color values stored by some plaintiffs. Alpha mixing is the core of techniques such as transparency, digital synthesis, and paint.

For mixed operations, the most natural way of thinking is to regard the RGB component of the clip as its color and the Alpha component as its transparency. The opacity of the transparent and translucent surfaces is lower than that of the opaque surface, that is, their Alpha value is lower than the Alpha value of the opaque surface. For example, if you observe an object through green glass, the visible color part comes from the green part of the glass, and the part comes from the color of the object. The proportion of the two colors depends on the propagation property of the Glass: if the glass emits 80% of its light (that is, the opacity is 20% ), the color we see is a combination of 20% of the glass color and 80% of the color of the object behind the glass.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.