Fixed transparent texture making framebuffers also transparent in D3D11.

This happened with the Mirror Shield in the inventory screen preview. Also configured the blend function in OpenGL so it matches in both APIs.
This commit is contained in:
MaikelChan 2022-03-25 02:10:28 +01:00
commit 8008cd4c80
No known key found for this signature in database
GPG key ID: B2CE398C279239EC
2 changed files with 2 additions and 2 deletions

View file

@ -532,7 +532,7 @@ static struct ShaderProgram *gfx_d3d11_create_and_load_new_shader(uint64_t shade
blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
} else { } else {

View file

@ -582,7 +582,7 @@ static void gfx_opengl_init(void) {
SohUtils::saveEnvironmentVar("framebuffer", std::to_string(textureColorbuffer)); SohUtils::saveEnvironmentVar("framebuffer", std::to_string(textureColorbuffer));
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
} }
static void gfx_opengl_on_resize(void) { static void gfx_opengl_on_resize(void) {