Skip to content

FidelityFX Lens

Navigation: SDKGPUFidelityFX GPU References

FidelityFX Lens

FidelityFX Lens GPU documentation.

Functions

FfxLensGetRGMag

FfxFloat32x2 FfxLensGetRGMag(FfxFloat32 chromAbIntensity)

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

Returns: FfxFloat32x2 containing the red and green wavelength/channel magnitude values

Parameters:

  • chromAbIntensity (FfxFloat32) – Intensity constant value for the chromatic aberration effect.

Returns: FfxFloat32x2

Source: sdk/include/FidelityFX/gpu/lens/ffx_lens.h (line 177, column 14)

FfxLensSampleWithChromaticAberration

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

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

Returns: The final sampled RGB color.

Parameters:

  • coord (FfxInt32x2) – The input window coordinate [0, widthPixels), [0, heightPixels).
  • centerCoord (FfxInt32x2) – The center window coordinate of the screen.
  • redMag (FfxFloat32) – Magnitude value for the offset calculation of the red wavelength (texture channel).
  • greenMag (FfxFloat32) – Magnitude value for the offset calculation of the green wavelength (texture channel).

Returns: FfxFloat32x3

Source: sdk/include/FidelityFX/gpu/lens/ffx_lens.h (line 204, column 14)

FfxLensApplyFilmGrain

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 (FfxInt32x2) – The input window coordinate [0, widthPixels), [0, heightPixels).
  • color (inout FfxFloat32x3) – The current running color, or more clearly, the sampled input color texture color after being modified by chromatic aberration function.
  • grainScaleVal (FfxFloat32) – Scaling constant value for the grain’s noise frequency.
  • grainAmountVal (FfxFloat32) – Intensity constant value of the grain effect.
  • grainSeedVal (uint) – Seed value for the grain noise, for example, to change how the noise functions effect the grain frame to frame.

Source: sdk/include/FidelityFX/gpu/lens/ffx_lens.h (line 226, column 6)

FfxLensApplyVignette

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 (FfxInt32x2) – The input window coordinate [0, widthPixels), [0, heightPixels).
  • centerCoord (FfxInt32x2) – The center window coordinate of the screen.
  • color (inout FfxFloat32x3) – The current running color, or more clearly, the sampled input color texture color after being modified by chromatic aberration and film grain functions.
  • vignetteAmount (FfxFloat32) – Intensity constant value of the vignette effect.

Source: sdk/include/FidelityFX/gpu/lens/ffx_lens.h (line 244, column 6)

FfxLens

void FfxLens(FfxUInt32 Gtid, FfxUInt32x2 Gidx)

Lens pass entry point.

Parameters:

  • Gtid (FfxUInt32) – Thread index within thread group (SV_GroupThreadID).
  • Gidx (FfxUInt32x2) – Group index of thread (SV_GroupID).

Source: sdk/include/FidelityFX/gpu/lens/ffx_lens.h (line 264, column 6)