How do I fix the colours for this Directx TK sprite batch render?

101 Views Asked by At

This is a png from Aseprite, rendered with DirectX TK.

enter image description here

This is the png, as seen in Aseprite.

enter image description here

The code to render the scene:

void Graphics::BeginScene()
{
    m_d3dDeviceContext->ClearRenderTargetView(m_renderTargetView.Get(), BackColor);
    m_d3dDeviceContext->OMSetRenderTargets(1, m_renderTargetView.GetAddressOf(), nullptr);

    CD3D11_VIEWPORT viewport(0.0f, 0.0f, static_cast<float>(m_backBufferWidth), static_cast<float>(m_backbufferHeight));
    m_d3dDeviceContext->RSSetViewports(1, &viewport);
    
    m_spriteBatch->Begin(SpriteSortMode_FrontToBack, NULL, m_samplerState.Get());
}
2

There are 2 best solutions below

0
ball On

Pro tip: Use Pyxel Edit to export png instead of Aseprite.

0
sorrowbreeding On

solution : aseprite -> [Sprite -> Properties -> Color Profile: None] set.