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).