Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for lens distortion offsets in Frame Interpolation #86

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hsiversson
Copy link

@hsiversson hsiversson commented Aug 12, 2024

This change contains the changes needed to support an optional buffer that can describe application defined distortion offsets used to apply distortion as a post processing effect.

FrameGenerationDispatch can to accept an optional distortion field resource.
The distortion field resource is expected to have a 4-channel floating point format.
The following data layout is expected:

XY: The offset which can be applied to go from source UV to distorted UV.
ZW: The offset which can be applied to go from distorted UV to source UV.

Worth knowing is that this implementation is somewhat barebone, and could potentially use some additional work to become fully generic and cross-platform. For example, in the current setup, I did not find a good solution on how to let the app provide the optional buffer when using the frame generation dispatch callback,

How to test:

  1. Build new FfxApi DLLs using the changes.
  2. Replace DLLs in the PrebuiltSignedDLL folder with the newly built DLLs.
  3. Build the FSR sample.
  4. Launch the sample.
  5. Disable "Use Callback" mode for frame interpolation.
  6. Under "Tonemapping" there are three new controls for Lens Distortion.
    Use the "Enable" flag to toggle distortion on/off.
  7. Under "Upscaling" there's a new flag called "Use Distortion Field" which lets you toggle the usage of the distortion field resource.
  8. Set "Use Distortion Field" to off and "Lens Distortion Enable" to true to see how FI would currently be affected by distortion effects. Then enable "Use Distortion Field" again to see how the extra resource fixes the artifacts.

PLEASE NOTE!
There's also a small bugfix in ffx_frameinterpolation_game_motion_vector_field.h:
Incorrect sample of previous backbuffer was taken instead of current backbuffer.

@hsiversson hsiversson changed the title Fixed incorrect backbuffer sample Added support for lens distortion offsets in Frame Interpolation Aug 23, 2024
@amd-jiahli
Copy link

FSR3.1.2 integrated lens distortion largely based on 82fb88e.
FSR3.1.3 has equivalent fix from 5a26133.

This MR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants