mirror of
https://github.com/SFML/SFML.git
synced 2025-01-19 15:55:13 +08:00
Fixed computation of the alpha channel in sf::BlendAdd
This commit is contained in:
parent
2285e3d344
commit
38da3f4338
@ -344,9 +344,10 @@ void RenderTarget::applyBlendMode(BlendMode mode)
|
|||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
// Alpha blending
|
|
||||||
// glBlendFuncSeparateEXT is used when available to avoid an incorrect alpha value when the target
|
// glBlendFuncSeparateEXT is used when available to avoid an incorrect alpha value when the target
|
||||||
// is a RenderTexture -- in this case the alpha value must be written directly to the target buffer
|
// is a RenderTexture -- in this case the alpha value must be written directly to the target buffer
|
||||||
|
|
||||||
|
// Alpha blending
|
||||||
default :
|
default :
|
||||||
case BlendAlpha :
|
case BlendAlpha :
|
||||||
if (GLEW_EXT_blend_func_separate)
|
if (GLEW_EXT_blend_func_separate)
|
||||||
@ -357,7 +358,10 @@ void RenderTarget::applyBlendMode(BlendMode mode)
|
|||||||
|
|
||||||
// Additive blending
|
// Additive blending
|
||||||
case BlendAdd :
|
case BlendAdd :
|
||||||
glCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE));
|
if (GLEW_EXT_blend_func_separate)
|
||||||
|
glCheck(glBlendFuncSeparateEXT(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE));
|
||||||
|
else
|
||||||
|
glCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Multiplicative blending
|
// Multiplicative blending
|
||||||
|
Loading…
Reference in New Issue
Block a user