Commit Graph

  • c1326fc261 Added some comments to the main FSR2 classes Nico de Poel 2023-02-28 11:16:46 +0100
  • 0e4f344166 Fixed a stupid typo that broke type definitions on desktop platforms Nico de Poel 2023-02-27 23:21:45 +0100
  • d3a7dbf45c Redid the type definitions for PS4/5, true 16-bit types should now be supported Nico de Poel 2023-02-27 21:33:00 +0100
  • 62d1d41d2d Stripped Fsr2Dispatcher of most of its functionality, and moved it over to Fsr2Controller Nico de Poel 2023-02-27 15:19:02 +0100
  • a9997e1a02 Moved Fsr2Dispatcher into Fsr2Controller source file and made it internal. Placed everything into the FidelityFX namespace. Nico de Poel 2023-02-27 14:54:47 +0100
  • 747ac54528 Renaming SubsampleTest and Fsr2Controller to Fsr2Controller and Fsr2Dispatcher, respectively Nico de Poel 2023-02-27 14:52:22 +0100
  • 8ceffcadd1 Further cleanup and small details Nico de Poel 2023-02-27 14:48:22 +0100
  • 3de40f6fe6 Cleaned up Fsr2Controller ahead of major refactor Nico de Poel 2023-02-27 12:02:39 +0100
  • bececcdbc1 Added a debug tool for dumping system info and making screenshots, and made the camera mover do something a little bit more interesting. Nico de Poel 2023-02-27 11:53:01 +0100
  • 86c16e3694 - Replaced all input/output parameters with RenderTargetIdentifiers, allowing more flexibility in how these resources are assigned - Cleaned up main MonoBehaviour ahead of a big refactor, and added camera event-based command buffers to set opaque-only and motion vector resources Nico de Poel 2023-02-27 11:52:15 +0100
  • 776700e837 Allow input textures to be set outside of FSR2 context dispatch, opening up new avenues for optimizations. Started with setting motion vectors and output RT directly from the Unity command buffer, blitting to the destination RT only when necessary. Nico de Poel 2023-02-26 22:55:32 +0100
  • 1a0945a283 Allow FSR2 commands to be added to a CommandBuffer passed in externally Nico de Poel 2023-02-26 18:31:30 +0100
  • f184be7b62 Some minor optimizations and cleanup Nico de Poel 2023-02-26 18:15:20 +0100
  • 84c02a1110 ExecuteCommandBuffer needs to be done last, otherwise the commands to release temporary RTs won't be executed and they'll be cleared on the next frame. Oops. Nico de Poel 2023-02-26 18:14:41 +0100
  • b15e828e2c Don't use global_memory on PS4/5 I guess since it breaks everything Nico de Poel 2023-02-26 15:13:04 +0100
  • 903c2f71f3 Updated code to make it compatible with Unity 2020.1, i.e. the oldest version that's technically usable. Nico de Poel 2023-02-26 15:12:23 +0100
  • 76f82751ae Removed #extension directives which are meant only for GLSL and which caused compiler warnings in Unity Nico de Poel 2023-02-26 13:48:06 +0100
  • 16493a7dd4 Upgraded the project to Unity 2021.3.19f1 Selected supported graphics APIs for Windows, Mac and Linux. Disable ESRAM on base Xbox One, to work around render texture corruption issue. Nico de Poel 2023-02-26 13:45:49 +0100
  • 12b5791cd2 Enabled 16-bit floating point support by changing the unused 1D Texture option into an FP16 option, which makes its usage configurable by the game dev. Also included the workaround to force FP32 in the accumulate pass on Nvidia cards. Nico de Poel 2023-02-26 13:43:51 +0100
  • 9733de7067 Added some quick hacks to allow the shaders to compile for Metal. These "interlocked" functions are not interlocked anymore now, but it's good enough for an initial test on MacOS. Nico de Poel 2023-02-26 12:45:36 +0100
  • 882075862f Moved PSSL type definitions up, so that they apply both when FFX_HALF is defined and when not. This allows the shaders to compile for PS4/5 in both modes. Should look into proper half-precision support; fp16 is only supported on PS4 Pro, on base PS4 everything compiles down to fp32 anyway. Nico de Poel 2023-02-26 00:49:01 +0100
  • fbb3080696 Redefine HLSL globallycoherent as PSSL global_memory. The shader compiler seems to like it, and as far as I can tell it should serve the same purpose. Nico de Poel 2023-02-26 00:38:09 +0100
  • 5a638974b6 Removed the Native quality mode option again. It doesn't actually look that good, and I'd like to keep the 0 enum value reserved for "Off" Nico de Poel 2023-02-25 15:31:18 +0100
  • 6c15840df8 Fixed LUT data by using R32_SFloat format instead. Increases VRAM usage a bit but for these small LUTs that's okay. Changed filter mode for temp RTs to just default, to make it more clear we're not specifically choosing any filter mode; how these RTs are sampled is determined by the shaders. Nico de Poel 2023-02-25 11:46:59 +0100
  • 141a4a8335 Added a bit of missing resource management Nico de Poel 2023-02-25 01:05:02 +0100
  • e08a8f9c22 Playing around with resetting and recreating FSR context upon resolution or quality mode change. Seems to be working quite well. Nico de Poel 2023-02-25 00:52:00 +0100
  • 0f584b1098 Implemented generate reactive pass, which can be used separately from the main FSR2 upscale process. Untested still, but its fairly straightforward. Nico de Poel 2023-02-25 00:40:04 +0100
  • e624b61ea5 Removed all of the TCR auto-generation stuff, as I have no intention of actually supporting this anytime soon Nico de Poel 2023-02-24 23:32:51 +0100
  • 7ae1f66a12 Ignore screenshot files Nico de Poel 2023-02-24 16:39:59 +0100
  • dafae40776 Further tweaks to camera jitter parameters and now IT'S WORKING!! 🥳 Nico de Poel 2023-02-24 16:34:48 +0100
  • 25f1742728 Fixes to jitter which at least produces a stable picture now. Still not actually right, but making progress. Nico de Poel 2023-02-24 16:13:20 +0100
  • 0f5f3d9a69 Bits and bobs Nico de Poel 2023-02-24 15:01:11 +0100
  • 2440486872 Implemented resource clearing logic on first execution and reset Nico de Poel 2023-02-24 13:50:55 +0100
  • 1ca5a36f3e Cleanup and minor details Nico de Poel 2023-02-24 13:36:45 +0100
  • 13eb24289e Initial implementation of accumulation pass. It's doing... something but it's definitely not correct yet. Changed scene luminance into a persistent RT, since that makes it easier to control mipmaps and bind specific mip levels. Nico de Poel 2023-02-24 13:28:26 +0100
  • d044cf2789 Moved resources into their own source file, to make it easier to pass them to pipelines in bulk. Added creation of resources for the accumulate pass. Nico de Poel 2023-02-24 12:09:35 +0100
  • 6b74532793 Some cleanup and a few small details Nico de Poel 2023-02-24 11:32:40 +0100
  • 650e805af8 Combined color and depth into a single dispatch parameter, which makes it easier to follow what's going on at the various stages. Nico de Poel 2023-02-23 22:15:59 +0100
  • c184748907 Separate out depth from the color buffer using RenderTextureSubElement, which does work now. This whittles down the additional blitting to just motion vectors, with only a single shader/material required. Nico de Poel 2023-02-23 22:08:26 +0100
  • c0a3b81d84 Simplified gathering of color, depth and motion vector RTs by using the game camera texture directly, and blitting just before dispatch. This gets rid of all the OnRenderImage song and dance in the game camera component, and requires less keeping track of instance variables. Nico de Poel 2023-02-23 21:53:55 +0100
  • d607b1bf5a Apply jitter offset to dispatch parameters Nico de Poel 2023-02-23 19:07:29 +0100
  • 56da810b50 Implemented lock pass Nico de Poel 2023-02-23 16:41:07 +0100
  • 4801535236 Removed shader that was made obsolete as part of FSR 2.2 Nico de Poel 2023-02-23 16:21:15 +0100
  • 38d5f81ccc Added missing RT releases Nico de Poel 2023-02-23 16:14:21 +0100
  • 34598f3900 Moved default exposure and reactive resources to Fsr2Context Nico de Poel 2023-02-23 16:12:34 +0100
  • 934a3d60fa Implemented depth clip pass. Solved the problem of UAV/SRV name mismatch by monkey-patching the relevant shaders. Added default reactive mask. Nico de Poel 2023-02-23 16:06:25 +0100
  • 2f5eaf48ba Bit of cleanup and moving stuff around Nico de Poel 2023-02-23 13:14:34 +0100
  • b15e3b9c39 Use temporary render textures for storing color, depth and motion vectors copied from the game camera. Nico de Poel 2023-02-23 12:38:43 +0100
  • 834c396321 Color, depth and motion vectors are now provided as regular texture inputs to the compute shaders, by blitting them from the game camera ahead of time. Nico de Poel 2023-02-23 12:11:36 +0100
  • 8633cdcfc2 Initial implementation of Reconstruct & Dilate pass. Got a pretty decent way of dealing with double-buffered resources. Uploading Lanczos table in R16_SFloat format using pre-normalized values. Fixed frametime delta being converted improperly. Nico de Poel 2023-02-22 17:16:30 +0100
  • ee13551bb7 Removed GLSL shader files as we don't actually use those, and to reduce clutter. Nico de Poel 2023-02-21 16:40:43 +0100
  • 1b41f6b2d7 Provide pipelines with the entire context description, which makes intiialization a bit simpler. Also provide it when registering resources so that the corrext *max* render size can be used. Started on the reconstruct depth pipeline. Nico de Poel 2023-02-21 14:45:03 +0100
  • 16f529bce8 Made shading change mip level into a reusable const value, and fixed mip sizes for exposure RTs. Actually tested the output of the luminance pyramid shader now and it seems to be working. Nico de Poel 2023-02-21 13:29:31 +0100
  • cd414d75f1 Register aliasable UAV resources globally, before and after scheduling shader dispatches, so that all compute shaders can make use of them but without requiring a whole lot of additional resource management code. Nico de Poel 2023-02-21 13:10:16 +0100
  • 9489a19cd8 Progress on managing resources. Compute luminance pyramid shader is starting to do something. Also looked at the Lanczos LUT resource and ran into some roadblocks there. Nico de Poel 2023-02-21 12:59:44 +0100
  • 16055d7dd9 Continued pipeline implementations: declaring all input/output bindings using shared resource IDs. Nico de Poel 2023-02-20 15:42:23 +0100
  • 913c5879fa Started work on luminance pyramid and acculumate pipelines. Added keywords for customization options to the compute shaders using multi_compile_local. Nico de Poel 2023-02-20 14:19:22 +0100
  • 08e034584c Reorganized context and dispatch code: - Resource binding and shader dispatch is now done in separate Pipeline classes per stage, mirroring the design of the original FSR2 code. - Moved some classes and structs around to make them available outside of the Fsr2Context class. Nico de Poel 2023-02-20 11:36:42 +0100
  • 70dc9e29d4 Use a CommandBuffer to queue up commands and dispatch them all in one go Nico de Poel 2023-02-18 17:23:28 +0100
  • ce66799787 Implemented pretty much all of the constant buffer setup during dispatch. Nico de Poel 2023-02-18 16:57:51 +0100
  • 3dba9d1fa4 Implemented a few more things that are new in FSR 2.2 Nico de Poel 2023-02-18 14:47:40 +0100
  • a576f94e95 A bit of reorganization in how shaders and buffers are created and destroyed. Also using Unity's system info to decide on inverted depth or not. Nico de Poel 2023-02-18 13:08:12 +0100
  • b89de25b10 Tweaks to make the FSR2 shaders compile on PS4/5 platforms. FFX_HALF doesn't seem to be a thing in FSR 2.2 anymore anyway, so might as well keep that disabled. Nico de Poel 2023-02-17 16:18:46 +0100
  • a1086edfe3 Updated C# bindings so far for the changes in FSR 2.2 Nico de Poel 2023-02-17 14:01:43 +0100
  • a64795dd4f Added Unity compute shader for the new experimental Transparency/Composition/Reactive auto-generation feature from FSR 2.2 Nico de Poel 2023-02-17 13:09:23 +0100
  • a6abcbb788 Fixed a couple of issues in the FSR 2.2 shader sources Nico de Poel 2023-02-17 13:07:47 +0100
  • 38a2164a52 Updated shader sources to FSR 2.2 Nico de Poel 2023-02-17 12:54:23 +0100
  • 4fafe1c868 Bunch of initialization stuff; all compute shaders are now being loaded and some initial CB values are being generated Nico de Poel 2023-01-25 16:27:08 +0100
  • 4d6a47a03c Reworked creation and dispatch to use description classes to pass parameters, designed similar to how the original FSR2 library does things, but adapted slightly to fit the Unity context. Nico de Poel 2023-01-25 15:16:12 +0100
  • fc233b935f Moved all compute shader-related code to the Fsr2Context class, renamed FSR2Thing to Fsr2Controller and made the callbacks a static field in the Fsr2 class. It's becoming more clear now who is responsible for what, and where things should be implemented. Nico de Poel 2023-01-11 15:05:39 +0100
  • 1aa6e1f90d Reorganization: created new class for main FSR2 entry points, enums and helper functions. Created a stub Fsr2Context class. Moved jitter helper functions into main FSR2 class. Translated a couple more helper functions. Nico de Poel 2023-01-11 14:16:50 +0100
  • 447ae35772 - Added SPD constants buffer used by luminance pass - Started code reorganization: added a callbacks class for things that need to be customizable by the gamedev Nico de Poel 2023-01-11 13:58:03 +0100
  • 9b768e2c2f - Added Unity wrappers for all FSR2 compute shaders - Experimented with alternate compilation options for RCAS shader Nico de Poel 2023-01-11 12:54:52 +0100
  • 8b5395acd8 Reorganized shader files: FSR2 shaders are now copied directly into the project without alterations, Unity wrappers are located in an FSR2 folder. Nico de Poel 2023-01-11 12:23:28 +0100
  • 79d8aa49b6 - Implemented main FSR2 constants buffer, which now supplies the pre-exposure value to the RCAS shader. - Converted thread groups calculation from FSR2 code Nico de Poel 2023-01-11 12:14:47 +0100
  • b5f324eb25 - Simplified Unity RCAS shader to basically just a few defines and a direct import of the original FSR2 shader code. - Implemented 1x1 exposure texture and bound it to the compute shader. - Implemented RCAS config data set with precomputed values (so we don't have to do any unsafe float-to-int conversions), apply it to a constant buffer, and made sharpness available as a slider in the inspector. Nico de Poel 2023-01-11 11:24:48 +0100
  • 19d9debdc6 Added example assets Nico de Poel 2023-01-10 15:59:12 +0100
  • 0bdc75ff08 First import of Unity FSR2 test project on built-in render pipeline: - Yoinked a bunch of code from MadGoat SSAA to build a custom render scaler - Added a simple shader to check some of the render buffers during upscaling - Successfully ported the RCAS compute shader from the FSR2 project into Unity! Nico de Poel 2023-01-10 15:58:57 +0100