Nico de Poel
8f1be6d3e6
Re-added transparency & composition parameter, even though we never use it and just fall back to the default reactivity mask, we officially support it as an input now.
3 years ago
Nico de Poel
eade3d40ce
Moved generate reactive parameters up in the source file, so it's close to where it's being used.
It felt very weird having it dangle off the bottom of the source file.
3 years ago
Nico de Poel
ec79c8ab24
Enable reactive mask generation by default
3 years ago
Nico de Poel
54849cee0f
Use RenderTargetIdentifier magic to bind UAV outputs to SRV inputs, making obsolete the monkey patching of shaders.
Also reorganized the SRV/UAV names to match the ordering from the FSR2 source.
3 years ago
Nico de Poel
69da937fd7
Added some seemingly sensible ranges to the reactive mask parameters.
I really wish this stuff was a bit better explained and documented.
3 years ago
Nico de Poel
d5e17958d6
I do think we want to use the jittered projection matrix for transparent rendering. Otherwise the reactive mask's inputs do not match.
3 years ago
Nico de Poel
b7c49ea0e3
Allow reactive mask generation parameters to be set from the inspector.
Also set a default quality mode and reintroduced the Native quality mode, to make FSR2 into an expensive TAA + sharpen.
3 years ago
Nico de Poel
44c5f2847d
Release opaque-only input RT as soon as we're done with it.
This saves on aliasable memory used throughout the FSR2 process, and makes the extra cleanup pass afterward unnecessary.
3 years ago
Nico de Poel
e887db581b
Capture opaque-only input just before the forward alpha rendering pass, so that opaque image effects like color grading don't affect the reactive mask.
3 years ago
Nico de Poel
84b52c8853
Set non-jittered projection matrix before applying jittering, making motion vector jitter cancellation unnecessary.
This should make outputting non-jittered upscaled depth and motion vectors for subsequent render passes a lot easier.
3 years ago
Nico de Poel
070bd2704f
Reordered inspector fields because I'm OCD like that
3 years ago
Nico de Poel
9647805dcc
Copy opaque-only render buffer to a temporary texture as input for the reactive mask generator, and clean up the RT after FSR2 is done.
Generating the reactive mask now actually works and the difference is very noticeable in motion; much less artifacting on transparent effects.
3 years ago
Nico de Poel
5ed7a5279b
Progressed implementation of reactive mask generation pass.
Added temporary RT to contain the generated reactive mask, bind it to the FSR2 inputs, and made it available as a toggle on the script.
3 years ago
Nico de Poel
1364ace6b9
Re-enabled ESRAM for base Xbox One, and set some default resolutions for PS4/5
3 years ago
Nico de Poel
d47b8c78da
Added option to enable FP16 from the scene
3 years ago
Nico de Poel
158d5bc176
Perform render scaling by manipulating the Camera viewport rect, which removes the need for a second game object and camera altogether.
This eliminates the stupid full screen quad drawing that the second camera was doing, while also making the entire setup a lot simpler.
3 years ago
Nico de Poel
c1326fc261
Added some comments to the main FSR2 classes
3 years ago
Nico de Poel
0e4f344166
Fixed a stupid typo that broke type definitions on desktop platforms
3 years ago
Nico de Poel
d3a7dbf45c
Redid the type definitions for PS4/5, true 16-bit types should now be supported
3 years ago
Nico de Poel
62d1d41d2d
Stripped Fsr2Dispatcher of most of its functionality, and moved it over to Fsr2Controller
3 years ago
Nico de Poel
a9997e1a02
Moved Fsr2Dispatcher into Fsr2Controller source file and made it internal. Placed everything into the FidelityFX namespace.
3 years ago
Nico de Poel
747ac54528
Renaming SubsampleTest and Fsr2Controller to Fsr2Controller and Fsr2Dispatcher, respectively
3 years ago
Nico de Poel
8ceffcadd1
Further cleanup and small details
3 years ago
Nico de Poel
3de40f6fe6
Cleaned up Fsr2Controller ahead of major refactor
3 years ago
Nico de Poel
bececcdbc1
Added a debug tool for dumping system info and making screenshots, and made the camera mover do something a little bit more interesting.
3 years ago
Nico de Poel
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
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
1a0945a283
Allow FSR2 commands to be added to a CommandBuffer passed in externally
3 years ago
Nico de Poel
f184be7b62
Some minor optimizations and cleanup
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
b15e828e2c
Don't use global_memory on PS4/5 I guess since it breaks everything
3 years ago
Nico de Poel
903c2f71f3
Updated code to make it compatible with Unity 2020.1, i.e. the oldest version that's technically usable.
3 years ago
Nico de Poel
76f82751ae
Removed #extension directives which are meant only for GLSL and which caused compiler warnings in Unity
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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"
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
141a4a8335
Added a bit of missing resource management
3 years ago
Nico de Poel
e08a8f9c22
Playing around with resetting and recreating FSR context upon resolution or quality mode change. Seems to be working quite well.
3 years ago
Nico de Poel
0f584b1098
Implemented generate reactive pass, which can be used separately from the main FSR2 upscale process.
Untested still, but its fairly straightforward.
3 years ago
Nico de Poel
e624b61ea5
Removed all of the TCR auto-generation stuff, as I have no intention of actually supporting this anytime soon
3 years ago
Nico de Poel
7ae1f66a12
Ignore screenshot files
3 years ago
Nico de Poel
dafae40776
Further tweaks to camera jitter parameters and now IT'S WORKING!! 🥳
3 years ago
Nico de Poel
25f1742728
Fixes to jitter which at least produces a stable picture now. Still not actually right, but making progress.
3 years ago
Nico de Poel
0f5f3d9a69
Bits and bobs
3 years ago
Nico de Poel
2440486872
Implemented resource clearing logic on first execution and reset
3 years ago
Nico de Poel
1ca5a36f3e
Cleanup and minor details
3 years ago