Fix model track-group movement and RGB destination-alpha blending

This commit is contained in:
shen
2026-09-30 08:13:29 -07:00
parent f345bd5d3b
commit 905f23f135
16 changed files with 367 additions and 72 deletions
+16
View File
@@ -0,0 +1,16 @@
#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