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:
committed by
Anne Marije v/d Meer
parent
b34577103e
commit
8c5286400a
@ -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;
|
||||
|
Reference in New Issue
Block a user