TAA 时域速度链路贯通:天空盒补写 velocity(此前恒 0,相机移动时天空/背景重投影错误 → 闪烁);skyPrevVP(上一帧未抖动 proj × 去平移视图)落帧;TAA 加去遮挡深度检测(重投影点历史深度与当前像素比对,新暴露区拒历史,需 near/far + 投影模式落帧);移除 min-depth dilation(把前景速度泄漏给轮廓旁背景像素 → 边界闪);Forward 不透明段 velocity 附件 Clear→Load 承接天空结果;velocity 不入抖动注释订正(抖动进 velocity = 静止画面持续亚纹素重采样发糊)

This commit is contained in:
2026-10-18 15:22:48 +08:00
parent beba491bcb
commit 2024772bac
13 changed files with 178 additions and 45 deletions
+12 -1
View File
@@ -6,16 +6,27 @@
layout(location = 0) in vec2 fragUV;
layout(location = 0) out vec4 outColor;
layout(location = 1) out vec2 outVelocity; // TAA velocity 附件
layout(set = 0, binding = 0) uniform samplerCube envMap;
// push 与 skybox.vert 一致声明(VUID-08878)
layout(push_constant) uniform PushConstants {
mat4 invVP;
mat4 invVP; // 当前帧反投影(方向重建)
mat4 prevVP; // 上一帧 proj×view(去平移):天空 velocity
} pc;
void main() {
vec4 target = pc.invVP * vec4(fragUV * 2.0 - 1.0, 1.0, 1.0);
vec3 dir = normalize(target.xyz / target.w);
outColor = vec4(texture(envMap, dir).rgb, 1.0);
// 天空 velocity:天空是无限远表面,方向不随相机平移变化(w=0 忽略
// 平移),过上一帧 proj×view 得上一帧屏幕位置,与当前 fragUV 之差即
// 运动向量。相机移动时天空/背景因此正确重投影,不再闪烁
vec4 prevClip = pc.prevVP * vec4(dir, 0.0);
vec2 prevUV = abs(prevClip.w) > 1e-6
? (prevClip.xy / prevClip.w) * 0.5 + 0.5
: fragUV;
outVelocity = fragUV - prevUV;
}