Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Dual Source Blending
I'm no expert, but this seems to allow using dual source blending ala: ``` let alpha_blending = glium::DrawParameters { blend: glium::Blend { color: BlendingFunction::Addition { source: LinearBlendingFactor::SourceOneColor, destination: LinearBlendingFactor::OneMinusSourceOneColor, }, alpha: BlendingFunction::Addition { source: LinearBlendingFactor::SourceOneColor, destination: LinearBlendingFactor::OneMinusSourceOneColor, }, constant_value: (0.0, 0.0, 0.0, 0.0), }, ..Default::default() }; ``` and this in the shader: ``` // The color + alpha layout(location=0, index=0) out vec4 color; // Individual alpha channels for RGBA in color, used for subpixel // antialiasing blending layout(location=0, index=1) out vec4 colorMask; ``` based on my reading of: https://stackoverflow.com/questions/48491340/use-rgb-texture-as-alpha-values-subpixel-font-rendering-in-opengl https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt refs: wez/wezterm#932
- Loading branch information