Fix font materials incorrectly marked as opaque, not blending properly. Font materials are forced into translucent blending to work properly

[CODEREVIEW] nick.darnell


#ROBOMERGE-SOURCE: CL 11601928 via CL 11602010 via CL 11602175
#ROBOMERGE-BOT: (v656-11643781)

[CL 11730898 by matt kuhlenschmidt in Main branch]
This commit is contained in:
matt kuhlenschmidt
2020-02-28 09:12:58 -05:00
parent a687f23a45
commit dc359ad431
@@ -1054,6 +1054,11 @@ void FSlateRHIRenderingPolicy::DrawElements(
{
PixelShader->SetBlendState(GraphicsPSOInit, Material);
FSlateShaderResource* MaskResource = MaterialShaderResource->GetTextureMaskResource();
if (MaskResource && (Material->GetBlendMode() == EBlendMode::BLEND_Opaque || Material->GetBlendMode() == EBlendMode::BLEND_Masked))
{
// Font materials require some form of translucent blending
GraphicsPSOInit.BlendState = TStaticBlendState<CW_RGBA, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_InverseDestAlpha, BF_One>::GetRHI();
}
GraphicsPSOInit.BoundShaderState.VertexDeclarationRHI = bUseInstancing ? GSlateInstancedVertexDeclaration.VertexDeclarationRHI : GSlateVertexDeclaration.VertexDeclarationRHI;
GraphicsPSOInit.BoundShaderState.VertexShaderRHI = VertexShader.GetVertexShader();