diff --git a/Source/gs/GSH_OpenGL/GSH_OpenGL.cpp b/Source/gs/GSH_OpenGL/GSH_OpenGL.cpp index f368d6744..b58eb7f70 100644 --- a/Source/gs/GSH_OpenGL/GSH_OpenGL.cpp +++ b/Source/gs/GSH_OpenGL/GSH_OpenGL.cpp @@ -1588,6 +1588,13 @@ void CGSH_OpenGL::Prim_Sprite() float nS[2] = {0, 0}; float nT[2] = {0, 0}; + float nF = 0; + + if(m_PrimitiveMode.nFog) + { + nF = (float)(0xFF - m_VtxBuffer[0].fog) / 255.0f; + } + if(m_PrimitiveMode.nTexture) { if(m_PrimitiveMode.nUseUV) @@ -1629,13 +1636,13 @@ void CGSH_OpenGL::Prim_Sprite() // clang-format off PRIM_VERTEX vertices[] = { - {nX1, nY1, nZ, color, nS[0], nT[0], 1, 0}, - {nX2, nY1, nZ, color, nS[1], nT[0], 1, 0}, - {nX1, nY2, nZ, color, nS[0], nT[1], 1, 0}, + {nX1, nY1, nZ, color, nS[0], nT[0], 1, nF}, + {nX2, nY1, nZ, color, nS[1], nT[0], 1, nF}, + {nX1, nY2, nZ, color, nS[0], nT[1], 1, nF}, - {nX1, nY2, nZ, color, nS[0], nT[1], 1, 0}, - {nX2, nY1, nZ, color, nS[1], nT[0], 1, 0}, - {nX2, nY2, nZ, color, nS[1], nT[1], 1, 0}, + {nX1, nY2, nZ, color, nS[0], nT[1], 1, nF}, + {nX2, nY1, nZ, color, nS[1], nT[0], 1, nF}, + {nX2, nY2, nZ, color, nS[1], nT[1], 1, nF}, }; // clang-format on diff --git a/Source/gs/GSH_Vulkan/GSH_Vulkan.cpp b/Source/gs/GSH_Vulkan/GSH_Vulkan.cpp index 18499e7dd..d8feae136 100644 --- a/Source/gs/GSH_Vulkan/GSH_Vulkan.cpp +++ b/Source/gs/GSH_Vulkan/GSH_Vulkan.cpp @@ -1238,6 +1238,13 @@ void CGSH_Vulkan::Prim_Sprite() float s[2] = {0, 0}; float t[2] = {0, 0}; + float f = 0; + + if(m_primitiveMode.nFog) + { + f = static_cast(0xFF - m_vtxBuffer[0].fog) / 255.0f; + } + if(m_primitiveMode.nTexture) { if(m_primitiveMode.nUseUV) @@ -1279,13 +1286,13 @@ void CGSH_Vulkan::Prim_Sprite() // clang-format off CDraw::PRIM_VERTEX vertices[] = { - {x1, y1, z, color, s[0], t[0], 1, 0}, - {x2, y1, z, color, s[1], t[0], 1, 0}, - {x1, y2, z, color, s[0], t[1], 1, 0}, + {x1, y1, z, color, s[0], t[0], 1, f}, + {x2, y1, z, color, s[1], t[0], 1, f}, + {x1, y2, z, color, s[0], t[1], 1, f}, - {x1, y2, z, color, s[0], t[1], 1, 0}, - {x2, y1, z, color, s[1], t[0], 1, 0}, - {x2, y2, z, color, s[1], t[1], 1, 0}, + {x1, y2, z, color, s[0], t[1], 1, f}, + {x2, y1, z, color, s[1], t[0], 1, f}, + {x2, y2, z, color, s[1], t[1], 1, f}, }; // clang-format on