Heuristic42
Blog
Opengl
Meta
Rendering
0
comment
Apr 19 at 11:24
Matrices
Please have whoever is in charge of the business call me at the…
–
anonymous
comment
Apr 13 at 0:25
Matrices
Hey there! Looking to save on energy costs? Look no further! …
–
anonymous
comment
Apr 5 at 9:43
Matrices
If you look closely in the Bible, there are very specific warni…
–
anonymous
comment
Mar 27 at 17:19
Matrices
Are you still in business? heuristic42.com
–
anonymous
comment
Mar 25 at 4:59
Matrices
Hey There I tried calling your phone number but it was unsuc…
–
anonymous
comment
Mar 5 at 15:39
Matrices
Hi, I hope this message finds you well. I'm reaching out to …
–
anonymous
comment
Feb 7 at 5:45
Microsoft Natural Ergonomic 4000 Replacement
Thank you so much for sharing your thoughts here, it tells me e…
–
anonymous
comment
Jan 28 at 23:31
Microsoft Natural Ergonomic 4000 Replacement
Oh man, I feel this post. Not sure if you've seen the "new" new…
–
anonymous
comment
Jan 25 at 12:06
Matrices
Hi, Mark here. If it is ok for your business processes to be…
–
anonymous
comment
Jan 20 at 3:11
Matrices
[deleted]
–
anonymous
reverted
Dec 21 '23
Route contention when running docker and a VPN
updating to latest
–
admin
edited
Dec 21 '23
Route contention when running docker and a VPN
Things have improved since the original post. It may have been …
–
pknowles
edited
Dec 21 '23
Route contention when running docker and a VPN
Things have improved since the original post. It may have been …
–
anonymous
edited
Dec 21 '23
Route contention when running docker and a VPN
This have improved since the original post. It may have been up…
–
anonymous
comment
Nov 24 '23
Matrices
[deleted]
–
anonymous
edited
Sep 17 '23
Writing custom C++ containers, iterators and value references
Generic containers are awesome. 1. The effort required to wr…
–
pknowles
created
Sep 17 '23
Writing custom C++ containers, iterators and value references
Generic containers are awesome. 1. The effort required to wr…
–
pknowles
comment
Sep 15 '23
DerBard: Custom Split Mechanical Keyboard Prototype
Hey. Thanks for your interest! I've uploaded the files here, bu…
–
pknowles
comment
Sep 13 '23
DerBard: Custom Split Mechanical Keyboard Prototype
Hi! Is it possible to get some models so I can also make it?
–
anonymous
edited
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
edited
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
created
Aug 14 '23
On docker stealing routes and breaking the internet
Boy this is frustrating. The internet just doesn't work with do…
–
pknowles
comment
Jul 13 '23
Matrices
[deleted]
–
anonymous
comment
Jul 6 '23
Matrices
[deleted]
–
anonymous
…
View All
Log in
Transparency and Alpha Blending
leave this field blank to prove your humanity
Slug
*
A URL path component
Parent page
<root>
3D Rendering (Computer Graphics)
--- Cameras
--- Matrices
------ Projection Matrix
--- Vectors
--- 3D Geometry
------ triangle_meshes
--- Shading
------ Transparency and Alpha Blending
--- Lights
--- rasterization
------ Deep Image
--- Shadows
--- Vector Spaces
------ Tangent Space
------ Clip Space
--- rotations
--- images
------ mipmapping
--- materials
OpenGL Tutorials
--- Order Independent Transparency (OIT)
--- The Framebuffer
Pages About This Site
--- Contributing
--- Bugs
--- Why does this website exist?
The parent page this belongs to.
Article title
*
Article revisions must have a non-empty title
Article body
*
Transparency is the visual effect of an object being partially see-through. In computer graphics it typically refers to *alpha blending*. This is where two colours are mixed by an *alpha* ratio. To make a surface see-through, it is mixed with the colour behind it. The colour behind it may be the result of mixing other surface colours. Blending is often order dependent, requiring sorting as discussed later. There are a number of blending operations, but the most common is alpha blending by Porter and Duff. Physically, alpha models a statistical surface coverage. An example is dust and dirt on clear glass, or a fine spray of paint, where a microscopic portion is fully opaque and the rest fully transparent. The alpha value is the ratio between opaque and transparent parts. Alpha blending can be seen as an antialiasing technique, approximating tiny surface details and avoiding the expense of modelling and rendering them. Coloured glass is a common transparency example, although this implies an absorption effect which isn't modelled by classic alpha blending. # Alpha Blending The following equation overlays or mixes a foreground colour $F$ with background $B$ given the ratio $\alpha$. $$\alpha F + (1 - \alpha) B$$ This equation, also called the *over* operator is the most common. # Transparency Multiple transparent surfaces are handled by starting with the background colour and blending each surface onto it in order from farthest to nearest. colour = background foreach surface colour = blend(colour, surface) In some cases it's useful to blend starting with the front surface and going back. In this case, a *visibility* value must be maintained. This gives a portion of remaining colour that can be added. This is scaled down by the transmittance, $1 - \alpha$ at each surface. vis = 1 colour = 0 foreach surface colour += surface * surfaceAlpha * vis vis *= 1 - surfaceAlpha colour += background * vis This approach is sometimes referred to as the *under* operator as colour from a surface behind the blended group is added. # Visibility Rather than blending surfaces in turn, an alternative approach to solving transparency is to find surface visibility by another means. This allows an unordered sum of surface colours: $$ C = \sum S \cdot S_\alpha \cdot \mathsf{vis}(S)$$ Where $C$ is the result, $S$ is the surface colour and $\mathsf{vis}$ is some function that gives the visibility of the surface, as in the under blending approach above. Although sorting is necessary for correct transparency, the colours themselves don't need sorting, only the alpha values to give the function $\mathsf{vis}$. The concept of a statistical visibility is a great tool to better understand transparency and alpha blending. It is also particularly useful in approximate transparency techniques, where the $\mathsf{vis}$ function is hard coded, approximated or compressed to allow fast unordered blending. # Saturation Blending Alpha blending assumes an even statistical coverage at each surface but this is not always the case. If the opaque parts of partially transparent surfaces perfectly overlap, only the front surface will be visible. Alternatively, if all opaque portions of a surface are visible through the gaps of the transparent surfaces in front of it then the visibility scaling factor should be ignored. That is until there are no more gaps left. This is where saturation blending comes in. vis = 1 colour = 0 foreach surface colour += colour * surfaceAlpha * vis vis = max(0, vis - surfaceAlpha) colour += background * vis This must be done in order of nearest to farthest. An example usage is rasterization antialiasing where a fragment's alpha is set to the portion of the triangle covering a pixel. Triangles are rendered from front to back and it is assumed that further contributions to that pixel will be from other triangles filling the remaining area.
Toggle Preview
Edit message
*
A description of the changes made
Discard Draft
Save Draft
leave this field blank to prove your humanity
Flag
the thing you clicked
for moderator attention.
Reason choice:
Spam, promoting, advertising without disclosure
Rude, inappropriate, generally offensive
Too arrogant or demeaning to others
Other
Reason:
The reason for raising the flag
Error