Nico de Poel
bfa9d5196a
Made Callbacks into a property and just use rounding to int for dealing with floating point inaccuracies.
3 years ago
Nico de Poel
73fa30927b
Got rid of the global callbacks thing and made callbacks a local field of the Fsr2ImageEffect script.
This way different applications of FSR2 within the same game can have different callbacks applied to them.
For example: a camera for rendering a 3D UI image to a render texture can have callbacks to apply mipmap bias only to the assets being drawn for the UI.
3 years ago
Nico de Poel
f6da12c854
Brought back Ultra Quality mode (1.2x) scale, likely for good this time.
It gets you about the same performance as native without AA, it has precedent in other games, it gives us nice symmetry with Ultra Performance mode, and it means the QualityMode enum is 0-based now.
3 years ago
Nico de Poel
e0027ed77a
Added MIT license header to every source file, similar to the FFX FSR2 codebase
3 years ago
Nico de Poel
1ff980bea9
Changing my mind yet again about directory names
3 years ago
Nico de Poel
03fd58cb5a
Check for compute shader support when enabling FSR2, and moved debug checking flag to default context creation method.
3 years ago
Nico de Poel
d02fc3cec1
Eliminated High Quality and Native modes again because you know what? AMD were right with their presets.
3 years ago
Nico de Poel
eaecd40cc4
Set default scale value to 0.5 as that seems to work better in multiple contexts
3 years ago
Nico de Poel
3e31950d56
Changed Fsr2Callbacks into an interface + base implementation
3 years ago
Nico de Poel
da651c3d6f
Moved some files
3 years ago
Nico de Poel
92e360aa24
Implemented the debug checking upon dispatch from the original FSR2 source, with some Unity adaptations.
Used this to good effect to fix a few small issues that had gone unnoticed.
Also removed the Message callback which was kind of pointless, since Unity already has a well-established way of outputting warnings and errors.
3 years ago
Nico de Poel
e5384a1b8b
Let's call this High Quality instead of Ultra Quality. Ultra is a bit hyperbolic in this case.
3 years ago
Nico de Poel
022eae95ef
Added one more quality mode tier: ultra quality, which I felt was missing as an option.
It maps nicely from 900p -> 1080p, 1200p -> 1440p, 1800p -> 4K, etc
3 years ago
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
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
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
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
8ceffcadd1
Further cleanup and small details
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
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
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
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
0f5f3d9a69
Bits and bobs
3 years ago
Nico de Poel
650e805af8
Combined color and depth into a single dispatch parameter, which makes it easier to follow what's going on at the various stages.
3 years ago
Nico de Poel
2f5eaf48ba
Bit of cleanup and moving stuff around
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
3dba9d1fa4
Implemented a few more things that are new in FSR 2.2
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
4fafe1c868
Bunch of initialization stuff; all compute shaders are now being loaded and some initial CB values are being generated
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago
Nico de Poel
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.
3 years ago