1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +00:00

Use premultiplied alpha for plDynamicTextMaps on GUI controls.

This fixes the irregular dark fringes around light text when not exactly pixel-aligned that are caused by independent interpolation of color and alpha. It also makes calculations simpler for things to come.
This commit is contained in:
Christian Walther
2011-12-30 15:10:47 +01:00
committed by Anne Marije v/d Meer
parent b34577103e
commit 8c5286400a
10 changed files with 144 additions and 21 deletions

View File

@ -7211,12 +7211,26 @@ void plDXPipeline::IHandleFirstStageBlend()
fD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
if( fLayerState[0].fBlendFlags & hsGMatState::kBlendInvertFinalAlpha )
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA );
if( fLayerState[0].fBlendFlags & hsGMatState::kBlendAlphaPremultiplied )
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
}
else
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA );
}
fD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA );
}
else
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
if( fLayerState[0].fBlendFlags & hsGMatState::kBlendAlphaPremultiplied )
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
}
else
{
fD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
}
fD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
}
break;