Enum glium::draw_parameters::BlendingFunction
[−]
[src]
pub enum BlendingFunction {
AlwaysReplace,
Min,
Max,
Addition {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
Subtraction {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
ReverseSubtraction {
source: LinearBlendingFactor,
destination: LinearBlendingFactor,
},
}Function that the GPU will use for blending.
Blending happens at the end of the rendering process, when the GPU wants to write the pixels over pixels that already exist in the framebuffer. The blending function allows you to choose how it should merge the two.
If you want to add transparent objects one over another, the usual value
is Addition { source: SourceAlpha, destination: OneMinusSourceAlpha }.
Variants
AlwaysReplace | Simply overwrite the destination pixel with the source pixel. The alpha channels are simply ignored. This is the default mode. For example writing | ||||
Min | For each individual component (red, green, blue, and alpha), the minimum value is chosen between the source and the destination. For example writing | ||||
Max | For each individual component (red, green, blue, and alpha), the maximum value is chosen between the source and the destination. For example writing | ||||
Addition | For each individual component (red, green, blue, and alpha), a weighted addition between the source and the destination. The result is equal to Fields
| ||||
Subtraction | For each individual component (red, green, blue, and alpha), a weighted substraction of the source by the destination. The result is equal to Fields
| ||||
ReverseSubtraction | For each individual component (red, green, blue, and alpha), a weighted substraction of the destination by the source. The result is equal to Fields
|