diff --git a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp index f2197c929..a7a3789b7 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp @@ -186,10 +186,11 @@ GFXD3D11StateBlock::GFXD3D11StateBlock(const GFXStateBlockDesc& desc) else mSamplerDesc[i].Filter = comparison ? D3D11_FILTER_COMPARISON_ANISOTROPIC : D3D11_FILTER_ANISOTROPIC; - mSamplerDesc[i].BorderColor[0] = gfxSamplerState.borderColor.red; - mSamplerDesc[i].BorderColor[1] = gfxSamplerState.borderColor.green; - mSamplerDesc[i].BorderColor[2] = gfxSamplerState.borderColor.blue; - mSamplerDesc[i].BorderColor[3] = gfxSamplerState.borderColor.alpha; + LinearColorF bc = LinearColorF(gfxSamplerState.borderColor); + mSamplerDesc[i].BorderColor[0] = bc.red; + mSamplerDesc[i].BorderColor[1] = bc.green; + mSamplerDesc[i].BorderColor[2] = bc.blue; + mSamplerDesc[i].BorderColor[3] = bc.alpha; mSamplerDesc[i].ComparisonFunc = GFXD3D11CmpFunc[gfxSamplerState.samplerFunc]; hr = D3D11DEVICE->CreateSamplerState(&mSamplerDesc[i], &mSamplerStates[i]); diff --git a/Engine/source/gfx/gfxStateBlock.cpp b/Engine/source/gfx/gfxStateBlock.cpp index 80d3289ee..66f19e54c 100644 --- a/Engine/source/gfx/gfxStateBlock.cpp +++ b/Engine/source/gfx/gfxStateBlock.cpp @@ -278,7 +278,7 @@ GFXSamplerStateDesc::GFXSamplerStateDesc() samplerFunc = GFXCmpNever; maxAnisotropy = 1; mipLODBias = 0.0f; - borderColor = LinearColorF::WHITE; + borderColor = ColorI::WHITE; } GFXSamplerStateDesc GFXSamplerStateDesc::getWrapLinear() diff --git a/Engine/source/gfx/gfxStateBlock.h b/Engine/source/gfx/gfxStateBlock.h index 5cefd381a..21ca5b4d5 100644 --- a/Engine/source/gfx/gfxStateBlock.h +++ b/Engine/source/gfx/gfxStateBlock.h @@ -49,7 +49,7 @@ struct GFXSamplerStateDesc GFXCmpFunc samplerFunc; - LinearColorF borderColor; + ColorI borderColor; /// The maximum anisotropy used when one of the filter types /// is set to anisotropic. diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 9d60401cc..07f72802f 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -220,7 +220,9 @@ void GFXGLTextureObject::initSamplerState(const GFXSamplerStateDesc &ssd) if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) glTexParameterf(mBinding, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); - glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, ssd.borderColor); + LinearColorF bc = LinearColorF(ssd.borderColor); + GLfloat color[4]={bc.red, bc.green, bc.blue, bc.alpha}; + glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, color); mNeedInitSamplerState = false; mSampler = ssd; } diff --git a/Engine/source/gfx/sim/gfxStateBlockData.cpp b/Engine/source/gfx/sim/gfxStateBlockData.cpp index ffbd36f76..853250221 100644 --- a/Engine/source/gfx/sim/gfxStateBlockData.cpp +++ b/Engine/source/gfx/sim/gfxStateBlockData.cpp @@ -315,7 +315,7 @@ void GFXSamplerStateData::initPersistFields() endGroup( "Filter State" ); - addField("borderColor", TypeColorF, Offset(mState.borderColor, GFXSamplerStateData), ""); + addField("borderColor", TypeColorI, Offset(mState.borderColor, GFXSamplerStateData), ""); addField("samplerFunc", TypeGFXCmpFunc, Offset(mState.samplerFunc, GFXSamplerStateData), "Compares sampled data against existing sampled data. The default is GFXCmpNever.");