Files
metin2-client/src/host/blend_state.h
T

17 lines
618 B
C++

#pragma once
#include <cstdint>
namespace mt_host {
// PORT: the recorded back buffer is X8R8G8B8 and GPU shadow targets are R5G6B5.
// Their destination alpha is always 1, even when Vulkan storage has an alpha
// channel. Reading that storage alpha makes DESTALPHA particles darken the scene.
inline std::uint8_t d3d_blend_for_rgb_target(std::uint8_t factor) {
switch (factor) {
case 7: return 2; // DESTALPHA -> ONE
case 8: return 1; // INVDESTALPHA -> ZERO
case 11: return 1; // SRCALPHASAT -> min(As, 1 - Ad) = ZERO (RGB)
default: return factor;
}
}
} // namespace mt_host