Commit 8173e668 authored by hybrid's avatar hybrid

Another exotic extension, which can be emulated by the new AMD extension as...

Another exotic extension, which can be emulated by the new AMD extension as well, but is mostly found on ancient SGI machines.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3680 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 4424ffec
...@@ -45,7 +45,9 @@ namespace video ...@@ -45,7 +45,9 @@ namespace video
EBO_MIN, //!< Choose minimum value of each color channel EBO_MIN, //!< Choose minimum value of each color channel
EBO_MAX, //!< Choose maximum value of each color channel EBO_MAX, //!< Choose maximum value of each color channel
EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported
EBO_MAX_FACTOR //!< Choose maximum value of each color channel after applying blend factors, not widely supported EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported
EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported
EBO_MAX_ALPHA //!< Choose maximum value of each color channel based on alpha value, not widely supported
}; };
//! MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X //! MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X
......
...@@ -2273,10 +2273,12 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria ...@@ -2273,10 +2273,12 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
break; break;
case EBO_MIN: case EBO_MIN:
case EBO_MIN_FACTOR: case EBO_MIN_FACTOR:
case EBO_MIN_ALPHA:
pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_MIN); pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_MIN);
break; break;
case EBO_MAX: case EBO_MAX:
case EBO_MAX_FACTOR: case EBO_MAX_FACTOR:
case EBO_MAX_ALPHA:
pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_MAX); pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_MAX);
break; break;
default: default:
......
...@@ -2994,6 +2994,26 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -2994,6 +2994,26 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
#endif #endif
if (Version>=120) if (Version>=120)
extGlBlendEquation(GL_MAX); extGlBlendEquation(GL_MAX);
#endif
break;
case EBO_MIN_ALPHA:
#if defined(GL_SGIX_blend_alpha_minmax)
if (FeatureAvailable[IRR_SGIX_blend_alpha_minmax])
extGlBlendEquation(GL_ALPHA_MIN_SGIX);
// fallback in case of missing extension
else
if (FeatureAvailable[IRR_EXT_blend_minmax])
extGlBlendEquation(GL_MIN_EXT);
#endif
break;
case EBO_MAX_ALPHA:
#if defined(GL_SGIX_blend_alpha_minmax)
if (FeatureAvailable[IRR_SGIX_blend_alpha_minmax])
extGlBlendEquation(GL_ALPHA_MAX_SGIX);
// fallback in case of missing extension
else
if (FeatureAvailable[IRR_EXT_blend_minmax])
extGlBlendEquation(GL_MAX_EXT);
#endif #endif
break; break;
default: default:
...@@ -4135,6 +4155,7 @@ bool COpenGLDriver::setRenderTarget(const core::array<video::IRenderTarget>& tar ...@@ -4135,6 +4155,7 @@ bool COpenGLDriver::setRenderTarget(const core::array<video::IRenderTarget>& tar
extGlBlendEquationIndexed(i, GL_MAX); extGlBlendEquationIndexed(i, GL_MAX);
break; break;
case EBO_MIN_FACTOR: case EBO_MIN_FACTOR:
case EBO_MIN_ALPHA:
#if defined(GL_AMD_blend_minmax_factor) #if defined(GL_AMD_blend_minmax_factor)
if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) if (FeatureAvailable[IRR_AMD_blend_minmax_factor])
extGlBlendEquationIndexed(i, GL_FACTOR_MIN_AMD); extGlBlendEquationIndexed(i, GL_FACTOR_MIN_AMD);
...@@ -4144,6 +4165,7 @@ bool COpenGLDriver::setRenderTarget(const core::array<video::IRenderTarget>& tar ...@@ -4144,6 +4165,7 @@ bool COpenGLDriver::setRenderTarget(const core::array<video::IRenderTarget>& tar
extGlBlendEquation(GL_MIN); extGlBlendEquation(GL_MIN);
break; break;
case EBO_MAX_FACTOR: case EBO_MAX_FACTOR:
case EBO_MAX_ALPHA:
#if defined(GL_AMD_blend_minmax_factor) #if defined(GL_AMD_blend_minmax_factor)
if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) if (FeatureAvailable[IRR_AMD_blend_minmax_factor])
extGlBlendEquationIndexed(i, GL_FACTOR_MAX_AMD); extGlBlendEquationIndexed(i, GL_FACTOR_MAX_AMD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment