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
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
Nico de Poel
13eb24289e
Initial implementation of accumulation pass. It's doing... something but it's definitely not correct yet.
Changed scene luminance into a persistent RT, since that makes it easier to control mipmaps and bind specific mip levels.
3 years ago
Nico de Poel
d044cf2789
Moved resources into their own source file, to make it easier to pass them to pipelines in bulk. Added creation of resources for the accumulate pass.
3 years ago
Nico de Poel
6b74532793
Some cleanup and a few small details
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
c184748907
Separate out depth from the color buffer using RenderTextureSubElement, which does work now.
This whittles down the additional blitting to just motion vectors, with only a single shader/material required.
3 years ago
Nico de Poel
c0a3b81d84
Simplified gathering of color, depth and motion vector RTs by using the game camera texture directly, and blitting just before dispatch.
This gets rid of all the OnRenderImage song and dance in the game camera component, and requires less keeping track of instance variables.
3 years ago
Nico de Poel
d607b1bf5a
Apply jitter offset to dispatch parameters
3 years ago
Nico de Poel
56da810b50
Implemented lock pass
3 years ago
Nico de Poel
38d5f81ccc
Added missing RT releases
3 years ago
Nico de Poel
34598f3900
Moved default exposure and reactive resources to Fsr2Context
3 years ago
Nico de Poel
934a3d60fa
Implemented depth clip pass. Solved the problem of UAV/SRV name mismatch by monkey-patching the relevant shaders. Added default reactive mask.
3 years ago
Nico de Poel
2f5eaf48ba
Bit of cleanup and moving stuff around
3 years ago
Nico de Poel
b15e3b9c39
Use temporary render textures for storing color, depth and motion vectors copied from the game camera.
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
1b41f6b2d7
Provide pipelines with the entire context description, which makes intiialization a bit simpler. Also provide it when registering resources so that the corrext *max* render size can be used. Started on the reconstruct depth pipeline.
3 years ago
Nico de Poel
16f529bce8
Made shading change mip level into a reusable const value, and fixed mip sizes for exposure RTs.
Actually tested the output of the luminance pyramid shader now and it seems to be working.
3 years ago
Nico de Poel
cd414d75f1
Register aliasable UAV resources globally, before and after scheduling shader dispatches, so that all compute shaders can make use of them but without requiring a whole lot of additional resource management code.
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
16055d7dd9
Continued pipeline implementations: declaring all input/output bindings using shared resource IDs.
3 years ago
Nico de Poel
913c5879fa
Started work on luminance pyramid and acculumate pipelines.
Added keywords for customization options to the compute shaders using multi_compile_local.
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
70dc9e29d4
Use a CommandBuffer to queue up commands and dispatch them all in one go
3 years ago
Nico de Poel
ce66799787
Implemented pretty much all of the constant buffer setup during dispatch.
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
a1086edfe3
Updated C# bindings so far for the changes in FSR 2.2
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
Nico de Poel
447ae35772
- Added SPD constants buffer used by luminance pass
- Started code reorganization: added a callbacks class for things that need to be customizable by the gamedev
3 years ago
Nico de Poel
8b5395acd8
Reorganized shader files: FSR2 shaders are now copied directly into the project without alterations, Unity wrappers are located in an FSR2 folder.
3 years ago
Nico de Poel
79d8aa49b6
- Implemented main FSR2 constants buffer, which now supplies the pre-exposure value to the RCAS shader.
- Converted thread groups calculation from FSR2 code
3 years ago
Nico de Poel
b5f324eb25
- Simplified Unity RCAS shader to basically just a few defines and a direct import of the original FSR2 shader code.
- Implemented 1x1 exposure texture and bound it to the compute shader.
- Implemented RCAS config data set with precomputed values (so we don't have to do any unsafe float-to-int conversions), apply it to a constant buffer, and made sharpness available as a slider in the inspector.
3 years ago
Nico de Poel
0bdc75ff08
First import of Unity FSR2 test project on built-in render pipeline:
- Yoinked a bunch of code from MadGoat SSAA to build a custom render scaler
- Added a simple shader to check some of the render buffers during upscaling
- Successfully ported the RCAS compute shader from the FSR2 project into Unity!
3 years ago