diff --git a/Source/gs/GSH_Direct3D9/GSH_Direct3D9_Shader.cpp b/Source/gs/GSH_Direct3D9/GSH_Direct3D9_Shader.cpp index b9b1c1fee1..35e6016ca4 100644 --- a/Source/gs/GSH_Direct3D9/GSH_Direct3D9_Shader.cpp +++ b/Source/gs/GSH_Direct3D9/GSH_Direct3D9_Shader.cpp @@ -140,6 +140,7 @@ Nuanceur::CShaderBuilder CGSH_Direct3D9::GeneratePixelShader(SHADERCAPS caps) NewFloat4(b, 0, 0, 0, 0), NewFloat4(b, 1, 1, 1, 1)); break; case TEX0_FUNCTION_DECAL: + //TODO: Replace A with fragment's A if tex has no alpha channel. break; default: assert(0); diff --git a/Source/gs/GSH_OpenGL/GSH_OpenGL_Shader.cpp b/Source/gs/GSH_OpenGL/GSH_OpenGL_Shader.cpp index a87c41ac01..ca8148cdac 100644 --- a/Source/gs/GSH_OpenGL/GSH_OpenGL_Shader.cpp +++ b/Source/gs/GSH_OpenGL/GSH_OpenGL_Shader.cpp @@ -316,6 +316,10 @@ Framework::OpenGl::CShader CGSH_OpenGL::GenerateFragmentShader(const SHADERCAPS& } break; case TEX0_FUNCTION_DECAL: + if(!caps.texHasAlpha) + { + shaderBuilder << " textureColor.a = v_color.a;" << std::endl; + } break; case TEX0_FUNCTION_HIGHLIGHT: shaderBuilder << " textureColor.rgb = clamp(textureColor.rgb * v_color.rgb * 2.0, 0.0, 1.0) + v_color.aaa;" << std::endl; diff --git a/Source/gs/GSH_Vulkan/GSH_VulkanDrawDesktop.cpp b/Source/gs/GSH_Vulkan/GSH_VulkanDrawDesktop.cpp index 744d3ec377..bf01622053 100644 --- a/Source/gs/GSH_Vulkan/GSH_VulkanDrawDesktop.cpp +++ b/Source/gs/GSH_Vulkan/GSH_VulkanDrawDesktop.cpp @@ -639,7 +639,10 @@ Framework::Vulkan::CShaderModule CDrawDesktop::CreateFragmentShader(const PIPELI } break; case CGSHandler::TEX0_FUNCTION_DECAL: - //Nothing to do + if(!caps.textureHasAlpha) + { + textureColor = NewFloat4(textureColor->xyz(), inputColor->w()); + } break; case CGSHandler::TEX0_FUNCTION_HIGHLIGHT: { diff --git a/Source/gs/GSH_Vulkan/GSH_VulkanDrawMobile.cpp b/Source/gs/GSH_Vulkan/GSH_VulkanDrawMobile.cpp index 23b60e2fc7..df388fd56f 100644 --- a/Source/gs/GSH_Vulkan/GSH_VulkanDrawMobile.cpp +++ b/Source/gs/GSH_Vulkan/GSH_VulkanDrawMobile.cpp @@ -979,7 +979,10 @@ Framework::Vulkan::CShaderModule CDrawMobile::CreateDrawFragmentShader(const PIP } break; case CGSHandler::TEX0_FUNCTION_DECAL: - //Nothing to do + if(!caps.textureHasAlpha) + { + textureColor = NewFloat4(textureColor->xyz(), inputColor->w()); + } break; case CGSHandler::TEX0_FUNCTION_HIGHLIGHT: {