From a83afa07ea880f8edaf405d05bf5f04ad7e72b13 Mon Sep 17 00:00:00 2001 From: James Urquhart Date: Thu, 19 May 2016 22:21:04 +0100 Subject: [PATCH] Fix blockiness when drawing to gui overlays using standard draw commands --- Engine/source/gfx/gfxDrawUtil.cpp | 1 + Engine/source/gfx/gfxFontRenderBatcher.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Engine/source/gfx/gfxDrawUtil.cpp b/Engine/source/gfx/gfxDrawUtil.cpp index 42b146a10..d68b05e55 100644 --- a/Engine/source/gfx/gfxDrawUtil.cpp +++ b/Engine/source/gfx/gfxDrawUtil.cpp @@ -61,6 +61,7 @@ void GFXDrawUtil::_setupStateBlocks() bitmapStretchSR.setZReadWrite(false); bitmapStretchSR.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha); bitmapStretchSR.samplersDefined = true; + bitmapStretchSR.setColorWrites(true, true, true, false); // Linear: Create wrap SB bitmapStretchSR.samplers[0] = GFXSamplerStateDesc::getWrapLinear(); diff --git a/Engine/source/gfx/gfxFontRenderBatcher.cpp b/Engine/source/gfx/gfxFontRenderBatcher.cpp index a9761e7fc..84551506b 100644 --- a/Engine/source/gfx/gfxFontRenderBatcher.cpp +++ b/Engine/source/gfx/gfxFontRenderBatcher.cpp @@ -50,6 +50,8 @@ FontRenderBatcher::FontRenderBatcher() : mStorage(8096) // result in the text always being black. This may not be the case in OpenGL // so it may have to change. -bramage f.samplers[0].textureColorOp = GFXTOPAdd; + + f.setColorWrites(true, true, true, false); mFontSB = GFX->createStateBlock(f); } }