FidelityFX Lens

FidelityFX Lens GPU documentation.

Functions

Return type

Description

FfxFloat32x2

FfxLensGetRGMag (FfxFloat32 chromAbIntensity)
Function call to calculate the red and green wavelength/channel sample offset values.

FfxFloat32x3

Function call to apply chromatic aberration effect when sampling the color input texture.

void

FfxLensApplyFilmGrain ( FfxInt32x2 coord, inout FfxFloat32x3 color, FfxFloat32 grainScaleVal, FfxFloat32 grainAmountVal, uint grainSeedVal )
Function call to apply film grain effect to inout color. This call could be skipped entirely as the choice to use the film grain is optional.

void

FfxLensApplyVignette ( FfxInt32x2 coord, FfxInt32x2 centerCoord, inout FfxFloat32x3 color, FfxFloat32 vignetteAmount )
Function call to apply vignette effect to inout color. This call could be skipped entirely as the choice to use the vignette is optional.

void

Lens pass entry point.

Detailed description

FidelityFX Lens GPU documentation.

Global functions

FfxLensGetRGMag

Copied!

FfxFloat32x2  FfxLensGetRGMag (FfxFloat32  chromAbIntensity)

Function call to calculate the red and green wavelength/channel sample offset values.

Parameters:

chromAbIntensity

Intensity constant value for the chromatic aberration effect.

Returns:

FfxFloat32x2 containing the red and green wavelength/channel magnitude values


FfxLensSampleWithChromaticAberration

Copied!

FfxFloat32x3  FfxLensSampleWithChromaticAberration (
    FfxInt32x2  coord,
    FfxInt32x2  centerCoord,
    FfxFloat32  redMag,
    FfxFloat32  greenMag
)

Function call to apply chromatic aberration effect when sampling the color input texture.

Parameters:

coord

The input window coordinate [0, widthPixels), [0, heightPixels).

centerCoord

The center window coordinate of the screen.

redMag

Magnitude value for the offset calculation of the red wavelength (texture channel).

greenMag

Magnitude value for the offset calculation of the green wavelength (texture channel).

Returns:

The final sampled RGB color.


FfxLensApplyFilmGrain

Copied!

void FfxLensApplyFilmGrain (
    FfxInt32x2  coord,
    inout FfxFloat32x3  color,
    FfxFloat32  grainScaleVal,
    FfxFloat32  grainAmountVal,
    uint grainSeedVal
)

Function call to apply film grain effect to inout color. This call could be skipped entirely as the choice to use the film grain is optional.

Parameters:

coord

The input window coordinate [0, widthPixels), [0, heightPixels).

color

The current running color, or more clearly, the sampled input color texture color after being modified by chromatic aberration function.

grainScaleVal

Scaling constant value for the grain’s noise frequency.

grainAmountVal

Intensity constant value of the grain effect.

grainSeedVal

Seed value for the grain noise, for example, to change how the noise functions effect the grain frame to frame.


FfxLensApplyVignette

Copied!

void FfxLensApplyVignette (
    FfxInt32x2  coord,
    FfxInt32x2  centerCoord,
    inout FfxFloat32x3  color,
    FfxFloat32  vignetteAmount
)

Function call to apply vignette effect to inout color. This call could be skipped entirely as the choice to use the vignette is optional.

Parameters:

coord

The input window coordinate [0, widthPixels), [0, heightPixels).

centerCoord

The center window coordinate of the screen.

color

The current running color, or more clearly, the sampled input color texture color after being modified by chromatic aberration and film grain functions.

vignetteAmount

Intensity constant value of the vignette effect.


FfxLens

Copied!

void FfxLens (FfxUInt32  Gtid, FfxUInt32x2  Gidx)

Lens pass entry point.

Parameters:

Gtid

Thread index within thread group (SV_GroupThreadID).

Gidx

Group index of thread (SV_GroupID).


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!