Nico de Poel
fdcc85355c
Try our best to ensure a shaders asset is assigned to the image effect component.
2 years ago
Nico de Poel
bd98fdf00d
Turned shaders aggregate into a scriptable object, with a default asset instance that automatically resets to look up the correct shader references.
2 years ago
Nico de Poel
84e5e72ab7
Refactored loading of FSR3 compute shaders, using an aggregate object containing pre-loaded compute shaders instead of the old callbacks.
This gives more control to the application about how shaders are loaded/unloaded, and it fits in much more nicely with PPV2's resources.
Shaders are currently just serialized as part of the scene component, which isn't the optimal solution yet.
2 years ago
Nico de Poel
13910c8687
Moved ResourceView out of the Fsr3Upscaler class and into the FidelityFX namespace, making usages of ResourceView a lot cleaner.
ResourceView is also generic enough that it could/should be reused for any other FidelityFX effects, so this move makes sense.
2 years ago
Nico de Poel
9854cd1279
Rename FSR2 to FSR3 Upscaler, part 2: class and file names.
2 years ago
Nico de Poel
62a924ae83
Rename FSR2 to FSR3 Upscaler, part 1: strings and comments.
2 years ago
Nico de Poel
68ea8d2f14
Fixed aspect ratio for dual-viewport setups
2 years ago
Nico de Poel
bda7eddc6f
Revert "Removed unnecessary aspect ratio lines that broke screen aspect when using non-standard viewports."
This reverts commit 501f3e4f90 .
2 years ago
Nico de Poel
501f3e4f90
Removed unnecessary aspect ratio lines that broke screen aspect when using non-standard viewports.
2 years ago
Nico de Poel
22701fdd17
Renamed RenderTargetView to ResourceView, which is a bit shorter to type and covers the essence well.
2 years ago
Nico de Poel
d9f9ef10ff
Modified RenderTargetView yet again: made a distinction between an invalid (Unassigned) texture reference and a valid-but-empty (None) texture reference. Inverted IsEmpty as well to be a more generic IsValid property now.
2 years ago
Nico de Poel
47cba76dee
Made all RenderTargetView fields non-nullable, and introduced a special Empty value for optional fields.
This removes the need for a lot of HasValue checks, especially since all fields will eventually get a value anyway, making those checks rather redundant. This also makes it clearer that all SRVs will get bound with a valid input texture, even if the input is optional.
2 years ago
Nico de Poel
e8d12c201e
- Reworked input/output resource management using a new RenderTargetView struct, which encompasses all relevant data required to bind textures from various sources.
This eliminates the need for resource binding code outside of the core FSR2 classes, and makes the public API more strict and consistent, but also more flexible. In addition, it removes the need for the slightly awkward input/output resource debug checks.
- Changed prebaked RCAS configurations into an array, as there is no need for a dynamically sized list here.
2 years ago
Nico de Poel
9911642947
Refactored undo mipmap bias callback such that the RP integration does not need to maintain any bias offset state. Added NaN/Infinity check to the standard apply mipmap bias callback implementation.
3 years ago
Nico de Poel
d0deaa46b5
Experimentation with stacked cameras; apply only viewport rect and jitter offset on first camera, perform upscaling with second camera. Sync settings between cameras.
3 years ago
Nico de Poel
bc3192fc40
Made undoing of mipmap bias a distinct separate callback, so that it can be overridden by client apps.
3 years ago
Nico de Poel
cf04a0ea7b
Renamed max render size field to be consistent with PPV2 integration
3 years ago
Nico de Poel
5236c28e7e
Added support for dynamic resolution scaling using ScalableBufferManager.
3 years ago
Nico de Poel
65280ebf7a
Further refinement to clarity and comments of the BiRP integration
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
8b3a1a7545
Implemented auto-TCR generation feature in BiRP integration example
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
6dbf4b69e2
Added checks to avoid problems when an invalid render size is used
3 years ago
Nico de Poel
490a76986c
Enable HDR by default and clarified the tooltip somewhat
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
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
644349b16b
Respect output target texture's dimensions when determining render size and rescaling camera viewport.
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
1cc0de7c89
Moved Shader ID constants to a separate class file
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
eaecd40cc4
Set default scale value to 0.5 as that seems to work better in multiple contexts
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
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
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
Nico de Poel
bb24ed970b
Reintroduced the ability for FSR2 to output to a render texture again. Very basic for now.
3 years ago
Nico de Poel
bcfb4b6769
Check for HDR when selecting RT formats for opaque-only and final output.
This makes for fewer assumptions and should provide better support for HDR render paths.
3 years ago