Nico de Poel
a2c1211d98
Create temporary resources at actual render size, further reducing VRAM usage when dynamic resolution is in effect.
3 years ago
Nico de Poel
20801cfd6a
Updated shaders to FSR 2.2.1
3 years ago
Nico de Poel
5236c28e7e
Added support for dynamic resolution scaling using ScalableBufferManager.
3 years ago
Nico de Poel
cf316ebf4f
Comment that the atomic counter shouldn't be aliasable
3 years ago
Nico de Poel
63d6fd3203
Changed atomic counter from a temporary RT to a permanent one, and set it to 0 only on the first frame. Potential fix for auto-exposure on MacOS.
3 years ago
Nico de Poel
47c2560476
Consolidated accumulate and accumulate+sharpen pipelines into a single pipeline, with the sharpening option being changed into a local keyword that can be enabled or disabled on-the-fly.
This removes the need for an additional copy of the accumulate shader, which saves a considerable amount of memory.
3 years ago
Nico de Poel
7798ae524c
Added various controls for changing FSR2 settings at run-time
3 years ago
Nico de Poel
65280ebf7a
Further refinement to clarity and comments of the BiRP integration
3 years ago
Nico de Poel
ab635e30bd
Synced readme with OSS repo
3 years ago
Nico de Poel
ff879b658d
Reworked image effect integration, splitting things up into separate methods to improve readability and comprehension.
3 years ago
Nico de Poel
4f0edf6049
Simplified a bunch of code and removed some unnecessary bits. Mipmap bias is applied more safely now. Context gets reset if auto exposure bool changes.
3 years ago
Nico de Poel
5a0482f0bc
Comments and tooltips
3 years ago
Nico de Poel
537d96d3b6
Explicitly create and destroy the opaque-only RT before and after rendering, so that it remains valid throughout. Fixes the ESRAM-related visual jittering issue on Xbox One when auto-reactive or auto-TCR is enabled.
3 years ago
Nico de Poel
20a6d4a057
Removed unnecessary HDRP keyword from two shaders
3 years ago
Nico de Poel
b136b864cd
Updated README
3 years ago
Nico de Poel
53e8164f0e
Clear the atomic counter used by the luminance pyramid pass. This fixes auto-exposure being broken and causing a black screen on some platforms (Xbox, OpenGL).
3 years ago
Nico de Poel
26cb485c30
Also use HDRP texture array workaround for opaque-only color input buffer
3 years ago
Nico de Poel
501b1b0638
Added workaround for HDRP using texture arrays for its camera buffers on some platforms
3 years ago
Nico de Poel
653b427c37
Commented out all experimental DXC-related pragmas, as these could sometimes cause shader compilation issues even when not enabled.
3 years ago
Nico de Poel
8b3a1a7545
Implemented auto-TCR generation feature in BiRP integration example
3 years ago
Nico de Poel
ef20869c48
Added support for experimental auto-TCR generation pass
3 years ago
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