I’m developing a render backend for the Nintendo Wii, and I’m struggling to understand how blend modes work. I’m especially confused by how the software renderer behaves, because I’m under the impression that it doesn’t do everything correctly.
I’ve modified the
testgeometry test by removing the call to
SDL_SetRenderDrawBlendMode() and just keep the blend modes on the texture (
SDL_SetTextureBlendMode()). The results are the following – accompanied by my comments:
SDL_BLENDMODE_NONE: I would expect this to just be the texture, but it’s blended with the vertex colours. Is this correct?
SDL_BLENDMODE_BLEND: darker than expected.
SDL_BLENDMODE_MOD: darker than expected:
If I set the background to all white, then at least the BLEND and MOD modes get rendered correctly, and not as dark as in these screenshots. So, it looks like the textures are blended both with the vertex colours, and with the background colour, despite having removed the call to
SDL_SetRenderDrawBlendMode(). Is this a bug in the software renderer? Or can someone explain me the blend modes, and in particular how to make it so that they only affect the texture ↔ vertex colours elements, and not the existing framebuffer contents?