Browse Source

Fixed dynamic resolution scaling:

- Two instances of the same bug in ARM's code, where RenderSize was used instead of MaxRenderSize to calculate UVs
- One instance of me previously fixing a bug in Isonzo that isn't a bug in the latest PPV2 code, oops
armasr
Nico de Poel 10 months ago
parent
commit
1222d236f5
  1. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_lock.h
  2. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_upsample.h
  3. 3
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_lock.h

@ -65,7 +65,7 @@ FfxBoolean ComputeThinFeatureConfidence(FfxInt32x2 pos)
FFXM_MIN16_F lumaSamples [9]; FFXM_MIN16_F lumaSamples [9];
FFXM_MIN16_F fTmpDummy = FFXM_MIN16_F(0.0f); FFXM_MIN16_F fTmpDummy = FFXM_MIN16_F(0.0f);
const FfxFloat32x2 fInputLumaSize = FfxFloat32x2(RenderSize());
const FfxFloat32x2 fInputLumaSize = FfxFloat32x2(MaxRenderSize());
const FfxFloat32x2 fPxBaseUv = FfxFloat32x2(pos) / fInputLumaSize; const FfxFloat32x2 fPxBaseUv = FfxFloat32x2(pos) / fInputLumaSize;
const FfxFloat32x2 fUnitUv = FfxFloat32x2(1.0f, 1.0f) / fInputLumaSize; const FfxFloat32x2 fUnitUv = FfxFloat32x2(1.0f, 1.0f) / fInputLumaSize;

4
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_upsample.h

@ -84,8 +84,8 @@ FfxFloat32x4 ComputeUpsampledColorAndWeight(const AccumulationPassCommonParams p
FfxFloat32x2 fSrcUnjitteredPos = (FfxFloat32x2(iSrcInputPos) + FfxFloat32x2(0.5f, 0.5f)) - Jitter(); // This is the un-jittered position of the sample at offset 0,0 FfxFloat32x2 fSrcUnjitteredPos = (FfxFloat32x2(iSrcInputPos) + FfxFloat32x2(0.5f, 0.5f)) - Jitter(); // This is the un-jittered position of the sample at offset 0,0
FfxFloat32x2 iSrcInputUv = FfxFloat32x2(fSrcOutputPos) / FfxFloat32x2(RenderSize());
FfxFloat32x2 unitOffsetUv = FfxFloat32x2(1.0f, 1.0f) / FfxFloat32x2(RenderSize());
FfxFloat32x2 iSrcInputUv = FfxFloat32x2(fSrcOutputPos) / FfxFloat32x2(MaxRenderSize());
FfxFloat32x2 unitOffsetUv = FfxFloat32x2(1.0f, 1.0f) / FfxFloat32x2(MaxRenderSize());
FFXM_MIN16_F4 fColorAndWeight = FFXM_MIN16_F4(0.0f, 0.0f, 0.0f, 0.0f); FFXM_MIN16_F4 fColorAndWeight = FFXM_MIN16_F4(0.0f, 0.0f, 0.0f, 0.0f);

3
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

@ -742,8 +742,7 @@ namespace UnityEngine.Rendering.PostProcessing
// Create a copy of the opaque-only color buffer for auto-reactive mask generation // Create a copy of the opaque-only color buffer for auto-reactive mask generation
if (context.IsSuperResolutionActive() && (upscaling.autoGenerateReactiveMask || upscaling.autoGenerateTransparencyAndComposition)) if (context.IsSuperResolutionActive() && (upscaling.autoGenerateReactiveMask || upscaling.autoGenerateTransparencyAndComposition))
{ {
Vector2Int scaledRenderSize = upscaling.GetScaledRenderSize(context.camera);
m_opaqueOnly = context.GetScreenSpaceTemporaryRT(colorFormat: sourceFormat, widthOverride: scaledRenderSize.x, heightOverride: scaledRenderSize.y);
m_opaqueOnly = context.GetScreenSpaceTemporaryRT(colorFormat: sourceFormat);
m_LegacyCmdBufferOpaque.BuiltinBlit(cameraTarget, m_opaqueOnly); m_LegacyCmdBufferOpaque.BuiltinBlit(cameraTarget, m_opaqueOnly);
} }

Loading…
Cancel
Save