Browse Source

Added missing bits of temporal reactive implementation in the FP32 code path, and only bind the relevant inputs to the Accumulate shader based on the ASR mode. Fixes Balanced and Performance modes on Xbox One, which for some reason still seems to be running the FP32 code path, no matter what the FFXM_HALF keyword is set to.

armasr
Nico de Poel 10 months ago
parent
commit
760003744f
  1. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs
  2. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs

@ -255,18 +255,20 @@ namespace ArmASR
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvUpscaleMaximumBiasLut, Resources.MaximumBiasLut); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvUpscaleMaximumBiasLut, Resources.MaximumBiasLut);
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvSceneLuminanceMips, Resources.SceneLuminance); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvSceneLuminanceMips, Resources.SceneLuminance);
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvAutoExposure, Resources.AutoExposure[frameIndex]); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvAutoExposure, Resources.AutoExposure[frameIndex]);
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvInternalTemporalReactive, Resources.InternalReactive[frameIndex ^ 1]);
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvNewLocks, AsrShaderIDs.UavNewLocks); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvNewLocks, AsrShaderIDs.UavNewLocks);
if (ContextDescription.Variant == Asr.Variant.Quality) if (ContextDescription.Variant == Asr.Variant.Quality)
{ {
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]);
_mrt[0] = Resources.InternalUpscaled[frameIndex]; // fColorAndWeight _mrt[0] = Resources.InternalUpscaled[frameIndex]; // fColorAndWeight
_mrt[1] = Resources.LockStatus[frameIndex]; // fLockStatus _mrt[1] = Resources.LockStatus[frameIndex]; // fLockStatus
_mrt[2] = Resources.LumaHistory[frameIndex]; // fLumaHistory _mrt[2] = Resources.LumaHistory[frameIndex]; // fLumaHistory
} }
else else
{ {
commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvInternalTemporalReactive, Resources.InternalReactive[frameIndex ^ 1]);
_mrt[0] = Resources.InternalUpscaled[frameIndex]; // fUpscaledColor _mrt[0] = Resources.InternalUpscaled[frameIndex]; // fUpscaledColor
_mrt[1] = Resources.InternalReactive[frameIndex]; // fTemporalReactive _mrt[1] = Resources.InternalReactive[frameIndex]; // fTemporalReactive
_mrt[2] = Resources.LockStatus[frameIndex]; // fLockStatus _mrt[2] = Resources.LockStatus[frameIndex]; // fLockStatus

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

@ -324,7 +324,11 @@ void ReprojectHistoryColor(const AccumulationPassCommonParams params, FFXM_PARAM
#endif #endif
//Compute temporal reactivity info //Compute temporal reactivity info
#if FFXM_SHADER_QUALITY_OPT_SEPARATE_TEMPORAL_REACTIVE
fTemporalReactiveFactor = ffxSaturate(abs(SampleTemporalReactive(params.fReprojectedHrUv)));
#else
fTemporalReactiveFactor = ffxSaturate(abs(fHistory.w)); fTemporalReactiveFactor = ffxSaturate(abs(fHistory.w));
#endif
bInMotionLastFrame = (fHistory.w < 0.0f); bInMotionLastFrame = (fHistory.w < 0.0f);
} }

Loading…
Cancel
Save