mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Reduce FSR2 jitter by preserving temporal history
This commit is contained in:
parent
51a8cf565f
commit
0a88406a3d
1 changed files with 0 additions and 16 deletions
|
|
@ -1027,22 +1027,6 @@ void Renderer::beginFrame() {
|
||||||
if (!fsr2_.useAmdBackend) {
|
if (!fsr2_.useAmdBackend) {
|
||||||
camera->setJitter(0.0f, 0.0f);
|
camera->setJitter(0.0f, 0.0f);
|
||||||
} else {
|
} else {
|
||||||
glm::mat4 currentVP = camera->getViewProjectionMatrix();
|
|
||||||
|
|
||||||
// Reset history only for clear camera movement.
|
|
||||||
bool cameraMoved = false;
|
|
||||||
for (int i = 0; i < 4 && !cameraMoved; i++) {
|
|
||||||
for (int j = 0; j < 4 && !cameraMoved; j++) {
|
|
||||||
if (std::abs(currentVP[i][j] - fsr2_.lastStableVP[i][j]) > 1e-3f) {
|
|
||||||
cameraMoved = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cameraMoved) {
|
|
||||||
fsr2_.lastStableVP = currentVP;
|
|
||||||
fsr2_.needsHistoryReset = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if WOWEE_HAS_AMD_FSR2
|
#if WOWEE_HAS_AMD_FSR2
|
||||||
// AMD-recommended jitter sequence in pixel space, converted to NDC projection offset.
|
// AMD-recommended jitter sequence in pixel space, converted to NDC projection offset.
|
||||||
int32_t phaseCount = ffxFsr2GetJitterPhaseCount(
|
int32_t phaseCount = ffxFsr2GetJitterPhaseCount(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue