Blending¶
Rendering equations¶
Mode |
Equation |
Src |
Dst |
Src (Alpha) |
Dst (Alpha) |
---|---|---|---|---|---|
Normal |
Add |
1 |
1-SrcAlpha |
||
Multiply |
Add |
DstColor |
1-SrcAlpha |
||
Screen |
Add |
1 |
1-SrcColor |
||
Lighten |
Max |
DstColor |
1 |
||
Color Dodge |
Add |
DstColor |
1 |
||
Linear Dodge |
Add |
1 |
1-SrcColor |
1 |
1-SrcAlpha |
Add (Glow) |
Add |
1 |
1 |
1 |
1-SrcAlpha |
Subtract |
ReverseSubtract |
1-DstColor |
1 |
||
Exclusion |
Add |
1-DstColor |
1-SrcColor |
1 |
1 |
Inverse |
Add |
1-DstColor |
1-SrcAlpha |
||
Destination In |
Add |
0 |
SrcAlpha |
||
Clip to Lower |
Add |
DstAlpha |
1-SrcAlpha |
||
Slice from Lower |
Add |
0 |
1-SrcAlpha |
Blend Accuracy Extension¶
I2D_BLEND_ACCURACY
extension, this extension is entirely implementation side.Normal
Multiply
Screen
Lighten
Color Dodge
Subtract
Inverse
I2D_EXTENDED_BLEND_MODES
is supported.Overlay
Darken
Color Burn
Hard Light
Soft Light
Difference
Exclusion
Implementation Notes
This extension can be implemented in OpenGL via the GL_KHR_blend_equation_advanced and GL_KHR_blend_equation_advanced_coherent extensions.
This extension can be implemented in Vulkan via the VK_EXT_blend_operation_advanced extension.
This extension can be implemented on tiler GPUs, such as PowerVR and Apple Silicon chips, via framebuffer fetch.
Extended Blend Modes¶
I2D_EXTENDED_BLEND_MODES
extension.Overlay
Darken
Color Burn
Hard Light
Soft Light
Difference
Exclusion
Implementation Notes
This extension can be emulated by shaders using Texture Barriers.
This extension can be emulated by shaders using a ping-pong framebuffer setup, this is unoptimal.
I2D_BLEND_ACCURACY
.