Nico de Poel
a2d670d0f8
Added a dummy field to the main FSR2 constant buffer, to make it exactly 128 bytes long. This fixes a data alignment issue on iOS Metal.
3 years ago
Nico de Poel
b1773de624
More textual fixes and corrections.
3 years ago
Nico de Poel
fad865f8bc
Went back to HDR being derived from camera HDR settings. Maybe not entirely correct, but definitely less error prone.
3 years ago
Nico de Poel
4ce471b4d8
More explanation and links
3 years ago
Nico de Poel
6dbf4b69e2
Added checks to avoid problems when an invalid render size is used
3 years ago
Nico de Poel
bb0656c698
More textual changes and cropped the comparison image a bit
3 years ago
Nico de Poel
490a76986c
Enable HDR by default and clarified the tooltip somewhat
3 years ago
Nico de Poel
4b07aaa4ae
Added readme images, plus some minor textual changes and fixed links
3 years ago
Nico de Poel
e89676809e
First draft of readme markdown text
3 years ago
Nico de Poel
9f887a5c3c
Check shader after loading it, throw an exception with a message on failure. This is better than having a random nullref happen, if the shaders cannot be loaded for whatever reason.
3 years ago
Nico de Poel
b1a7f48abb
Made HDR into an explicit toggle that can be set by the application, rather than a best guess based on the camera settings
3 years ago
Nico de Poel
e335624ae1
Removed the backbuffer check, as it caused a false positive when a second overlay camera is active on top of the FSR2 output.
Turns out blitting to an intermediate render texture works just fine if all FSR2 needs to do is output a color buffer.
3 years ago
Nico de Poel
38cc3a83fd
Don't validate input/output resources on reset, so the application has a way to prevent error messages when re-enabling a camera.
In this situation, the previous frame won't have bound the required resources, leading to those errors. Now, if the application calls Reset() after re-enabling the camera, the error messages won't show.
3 years ago
Nico de Poel
47d40fb71d
More accurate representation of where SystemInfo.computeSubGroupSize is available
3 years ago
Nico de Poel
8c95269c69
Added explanatory comments to the helper script
3 years ago
Nico de Poel
0837aa50cb
Removed the separate output color/depth render texture parameter, as it was very much redundant.
Added help tooltips to each of the input parameters.
3 years ago
Nico de Poel
f38b37cb2d
Changed DefaultFormat into a method and placed it next to the other helper methods
3 years ago
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
79046f40b3
Added a sample scene with two cameras, one upscaling and outputting to a render texture, the other applying post-FX and outputting to the display.
3 years ago
Nico de Poel
644349b16b
Respect output target texture's dimensions when determining render size and rescaling camera viewport.
3 years ago
Nico de Poel
6f422fb35d
Added plain MIT license text file
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
495350f569
Allow outputting to a user-provided color + depth buffer and optionally a motion vectors buffer.
This can be used for passing the upscaled result to a different camera for additional post-processing and final output.
Motion vectors aren't rescaled properly yet.
3 years ago
Nico de Poel
1c030377c0
Reshufled some code so that if the initialization process fails for some reason, we don't leave the scene behind in a messed up state.
3 years ago
Nico de Poel
ce9a64cba5
Figured out a way to support cameras with target textures, that avoids errors about depth buffer mismatch.
3 years ago
Nico de Poel
61a10cbd09
Updated project to Unity 2021.3.21f1
3 years ago
Nico de Poel
1cc0de7c89
Moved Shader ID constants to a separate class file
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
0db7773ed9
Added a helper script to allow OnPreCull to happen at a different location in the camera stack from the image effect script.
Also added a scene with PPV2 effects and FSR2 as post-PPV2 image effect to test and demonstrate this.
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
b190b2993c
Suppress a few common but harmless warnings in FFX's HLSL code.
This way we don't have to modify the FSR2 shaders to get rid of these warnings.
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
06a2658080
More renaming
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
ee4d2d43ae
Use render size for motion vector scale, since we are rendering them at lower resolution.
Making this explicit takes away some recurring confusion.
3 years ago
Nico de Poel
d232e3e07b
Removed separate command buffer for binding input buffers, which really wasn't needed anymore.
3 years ago
Nico de Poel
279e294100
Replaced Post-Processing Stack V2 package from Unity repository with a local copy, so that we may make modifications to it
3 years ago
Nico de Poel
cd8b9965d2
Added ambient occlusion and color grading effects for testing purposes.
3 years ago
Nico de Poel
178d9131af
Implemented most of the FSR2 dispatch. It seems to be doing the right things in the background.
Now its output just needs to be hacked into the PPV2 pipeline correctly.
3 years ago
Nico de Poel
d847999e44
Implemented remaining settings and parameters
3 years ago
Nico de Poel
416b501c15
Implemented screen scaling through camera viewport manipulation, done through the helper's LateUpdate.
This also led to some reorganization of variables and event ordering.
Added some bloom to the post-process layer to test the cooperation between FSR2 and other post effects.
3 years ago
Nico de Poel
6bc6d69fb4
Added initial implementation of post-processing stack effect for FSR2, with a new scene to test it in.
This contains the results of a bunch of research so far, on where code gets executed and how to inject additional steps into the render loop.
3 years ago
Nico de Poel
f5cc64db94
Added Post-Processing Stack V2 package to the project
3 years ago
Nico de Poel
05142da9ad
Renamed Fsr2Controller to Fsr2ImageEffect, to make its purpose more clear.
This is "only" a classic OnRenderImage effect, made to run as the final pass and to output directly to the backbuffer.
3 years ago
Nico de Poel
0548c63800
Revert "Reintroduced the ability for FSR2 to output to a render texture again. Very basic for now."
This reverts commit bb24ed970b .
3 years ago
Nico de Poel
9352192f29
Enable HDR when the camera it set for it
3 years ago