Browse Source

Some cleanup and a few small details

mac-autoexp
Nico de Poel 3 years ago
parent
commit
6b74532793
  1. 12
      Assets/Scripts/Fsr2Context.cs
  2. 5
      Assets/Scripts/Fsr2Controller.cs
  3. 1
      Assets/Scripts/Fsr2Pipeline.cs

12
Assets/Scripts/Fsr2Context.cs

@ -118,15 +118,7 @@ namespace FidelityFX
// private void InitShaders() // private void InitShaders()
// { // {
// LoadComputeShader("FSR2/ffx_fsr2_compute_luminance_pyramid_pass", ref _computeLuminancePyramidShader, out _computeLuminancePyramidKernel);
// LoadComputeShader("FSR2/ffx_fsr2_rcas_pass", ref _rcasShader, out _rcasKernel);
// LoadComputeShader("FSR2/ffx_fsr2_prepare_input_color_pass", ref _prepareInputColorShader, out _prepareInputColorKernel);
// LoadComputeShader("FSR2/ffx_fsr2_depth_clip_pass", ref _depthClipShader, out _depthClipKernel);
// LoadComputeShader("FSR2/ffx_fsr2_reconstruct_previous_depth_pass", ref _reconstructPreviousDepthShader, out _reconstructPreviousDepthKernel);
// LoadComputeShader("FSR2/ffx_fsr2_lock_pass", ref _lockShader, out _lockKernel);
// LoadComputeShader("FSR2/ffx_fsr2_accumulate_pass", ref _accumulateShader, out _accumulateKernel);
// LoadComputeShader("FSR2/ffx_fsr2_autogen_reactive_pass", ref _generateReactiveShader, out _generateReactiveKernel); // LoadComputeShader("FSR2/ffx_fsr2_autogen_reactive_pass", ref _generateReactiveShader, out _generateReactiveKernel);
// LoadComputeShader("FSR2/ffx_fsr2_tcr_autogen_pass", ref _tcrAutogenShader, out _tcrAutogenKernel);
// } // }
private void CreatePipelines() private void CreatePipelines()
@ -172,10 +164,6 @@ namespace FidelityFX
_commandBuffer.Clear(); _commandBuffer.Clear();
// TODO: Should probably use a CommandBuffer here, to queue up all of the commands and dispatch them in one go
// Use SetRandomWriteTarget to declare UAVs
// Use ClearRandomWriteTargets to clear all UAVs at once
if (_firstExecution) if (_firstExecution)
{ {
// TODO: clear values // TODO: clear values

5
Assets/Scripts/Fsr2Controller.cs

@ -70,7 +70,7 @@ public class Fsr2Controller : MonoBehaviour
// TODO: destroy and recreate context on screen resolution and/or quality mode change // TODO: destroy and recreate context on screen resolution and/or quality mode change
// TODO: enable motion vector jitter cancellation or not? // TODO: enable motion vector jitter cancellation or not?
_context = Fsr2.CreateContext(DisplaySize, RenderSize);
_context = Fsr2.CreateContext(DisplaySize, RenderSize, Fsr2.InitializationFlags.EnableMotionVectorsJitterCancellation);
// TODO: do we need a depth buffer for the output? We will need depth & motion vectors for subsequent post-FX. How should FSR2 output these? // TODO: do we need a depth buffer for the output? We will need depth & motion vectors for subsequent post-FX. How should FSR2 output these?
// TODO: can probably be a temporary RT // TODO: can probably be a temporary RT
@ -120,7 +120,7 @@ public class Fsr2Controller : MonoBehaviour
_dispatchDescription.Output = _outputRT; _dispatchDescription.Output = _outputRT;
_dispatchDescription.Exposure = null; _dispatchDescription.Exposure = null;
_dispatchDescription.Reactive = null; _dispatchDescription.Reactive = null;
_dispatchDescription.PreExposure = 1.0f;
_dispatchDescription.PreExposure = 0;
_dispatchDescription.EnableSharpening = performSharpenPass; _dispatchDescription.EnableSharpening = performSharpenPass;
_dispatchDescription.Sharpness = sharpness; _dispatchDescription.Sharpness = sharpness;
_dispatchDescription.MotionVectorScale.x = gameCamera.pixelWidth; _dispatchDescription.MotionVectorScale.x = gameCamera.pixelWidth;
@ -136,6 +136,7 @@ public class Fsr2Controller : MonoBehaviour
RenderTexture.ReleaseTemporary(motionVectors); RenderTexture.ReleaseTemporary(motionVectors);
// Output upscaled image to screen // Output upscaled image to screen
// TODO: we should probably use a shader to include depth & motion vectors into the output
Graphics.Blit(_outputRT, dest); Graphics.Blit(_outputRT, dest);
} }
} }

1
Assets/Scripts/Fsr2Pipeline.cs

@ -111,6 +111,7 @@ namespace FidelityFX
commandBuffer.ReleaseTemporaryRT(UavLockInputLuma); commandBuffer.ReleaseTemporaryRT(UavLockInputLuma);
commandBuffer.ReleaseTemporaryRT(UavDilatedReactiveMasks); commandBuffer.ReleaseTemporaryRT(UavDilatedReactiveMasks);
commandBuffer.ReleaseTemporaryRT(UavPreparedInputColor); commandBuffer.ReleaseTemporaryRT(UavPreparedInputColor);
commandBuffer.ReleaseTemporaryRT(UavNewLocks);
} }
protected void LoadComputeShader(string name) protected void LoadComputeShader(string name)

Loading…
Cancel
Save