UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GPUFFT Namespace Reference

Classes

struct  ComplexFFTImage1D
 
struct  ConvolutionWithTextureImage1D
 
class  FFTDescription
 
struct  TwoForOneRealFFTImage1D
 

Typedefs

typedef FVector3f FPreFilter
 

Enumerations

enum class  FFT_XFORM_TYPE : int { FORWARD_HORIZONTAL = 0 , FORWARD_VERTICAL = 1 , INVERSE_HORIZONTAL = 2 , INVERSE_VERTICAL = 3 }
 

Functions

uint32 BitSize (uint32 N)
 
TArray< uint32GetFactors (const uint32 PowTwoLength, const uint32 PowTwoBase)
 
void SwapContents (FRDGTextureRef &TmpBuffer, FRDGTextureRef &DstBuffer)
 
bool IsHorizontal (const FFT_XFORM_TYPE &XFormType)
 
bool IsForward (const FFT_XFORM_TYPE &XFormType)
 
uint32 MaxScanLineLength ()
 
void FFTImage2D (FRDGBuilder &GraphBuilder, const FGlobalShaderMap *ShaderMap, const FIntPoint &FrequencySize, bool bHorizontalFirst, FRDGTextureSRVRef SrcTexture, const FIntRect &ROIRect, FRDGTextureRef ResultTexture)
 
void ConvolutionWithTextureImage2D (FRDGBuilder &GraphBuilder, ERDGPassFlags ComputePassFlags, const FGlobalShaderMap *ShaderMap, const FIntPoint &FrequencySize, bool bHorizontalFirst, FRDGTextureRef TransformedKernel, FRDGTextureSRVRef SrcTexture, const FIntRect &ROIRect, FRDGTextureRef DstTexture, const FIntRect &DstRect, const FPreFilter &PreFilter, FRDGBufferRef PostFilterParameters, ETextureCreateFlags AdditionalTextureCreateFlags)
 
FIntPoint Convolution2DBufferSize (const FIntPoint &FrequencySize, const bool bHorizontalFirst, const FIntPoint &SrcExtent)
 
void CopyImage2D (FRDGBuilder &GraphBuilder, ERDGPassFlags ComputePassFlags, const FGlobalShaderMap *ShaderMap, FRDGTextureSRVRef SrcTexture, const FIntRect &SrcWindow, FRDGTextureRef DstTexture, const FIntRect &DstWindow, const FPreFilter &PreFilter=FPreFilter(TNumericLimits< float >::Max(), TNumericLimits< float >::Lowest(), 0.f))
 

Typedef Documentation

◆ FPreFilter

Define a prefilter to be applied to the pixel Luma, used when forward transforming image data. Used to boost the incoming pixel luma of bright pixels - useful to accentuate the influence of bright pixels during a convolution.

PreFilter.x = MinLuma PreFilter.y = MaxLuma PreFilter.z = Multiplier

When used in TwoForOneRealFFTImage, pixels Luma is limited by MaxLuma and Luma greater than MinLuma is scaled as Multiplier * (Luma - MinLuma) + MinLuma;

Enumeration Type Documentation

◆ FFT_XFORM_TYPE

enum class GPUFFT::FFT_XFORM_TYPE : int
strong

Enumerate the FFT direction and type for up to two dimensions.

Enumerator
FORWARD_HORIZONTAL 
FORWARD_VERTICAL 
INVERSE_HORIZONTAL 
INVERSE_VERTICAL 

Function Documentation

◆ BitSize()

uint32 GPUFFT::BitSize ( uint32  N)

Computes the minimal number of bits required to represent the in number N

◆ Convolution2DBufferSize()

FIntPoint GPUFFT::Convolution2DBufferSize ( const FIntPoint FrequencySize,
const bool  bHorizontalFirst,
const FIntPoint SrcExtent 
)

◆ ConvolutionWithTextureImage2D()

void GPUFFT::ConvolutionWithTextureImage2D ( FRDGBuilder GraphBuilder,
ERDGPassFlags  ComputePassFlags,
const FGlobalShaderMap ShaderMap,
const FIntPoint FrequencySize,
bool  bHorizontalFirst,
FRDGTextureRef  TransformedKernel,
FRDGTextureSRVRef  SrcTexture,
const FIntRect ROIRect,
FRDGTextureRef  DstTexture,
const FIntRect DstRect,
const FPreFilter PreFilter,
FRDGBufferRef  PostFilterParameters,
ETextureCreateFlags  AdditionalTextureCreateFlags 
)

Two Dimensional convolution of an image with a pre-convolved kernel.

Parameters
FrequencySize- The nominal count of frequencies in both directions.
bHornizontalFirst- Defines the data layout of the 2d transform in spectral space.
TransformedKernel- The result of a two dimensional transform of the kernel. Note, the transform order in constructing the TransformedKernel (e.g. bHorizontal first) must match the call here to have compatible data layout.
ROIRect- The Region Of Interest: Defines the src data in the SrcTexture and the location of the result in the ResultUAV
SrcTexture- Input float4 Image. Each channel is a seperate signal to be convolved with the corresponding channel in the Kernel
ResultUAV- UAV buffer that will hold the result.
TmpBuffer0- Temp float4 buffer with pixelformat PF_A32B32G32R32F
TmpBuffer1- Temp float4 buffer with pixelformat PF_A32B32G32R32F

NB: The TransformedKernel should have the same frequencies and layout as transforming the SrcTexture in two dimensions ie. FrequencySize + (bHorizontalFirst) ? FIntPoint(2, 0) : (0, 2);

NB: both TmpBuffers must be (bHorizontalFirst) ? FIntPoint(FrequencySize .X + 2, ROIRect.Size().Y) : FIntPoint(ROIRect.Size().X, FrequencySize .Y + 2);

NB: This function does not transition resources on the Src or Target. That must be done by the calling scope.

The Src and Dst textures can be re-used as the tmp buffers (Dst->TmpBuffer0, Src->TmpBuffer1) provided they are large enough.

◆ CopyImage2D()

void GPUFFT::CopyImage2D ( FRDGBuilder GraphBuilder,
ERDGPassFlags  ComputePassFlags,
const FGlobalShaderMap ShaderMap,
FRDGTextureSRVRef  SrcTexture,
const FIntRect SrcWindow,
FRDGTextureRef  DstTexture,
const FIntRect DstWindow,
const FPreFilter PreFilter = FPreFilter(TNumericLimits<float>::Max(), TNumericLimits<float>::Lowest(), 0.f) 
)

Copy a float4 image and possibly amplify the intensity of select pixels.

Parameters
Context- RHI and ShadersMap
SrcWindow- Location of the data in the SrcTexture to be copied.
SrcTexture- The two dimensional float4 input buffer to transform
DstWindow- Window that images will be copied.
DstUVA- The destination buffer
PreFilter- Values use to boost the intensity of any pixels. Default value deactivates prefilter

Data in the SrcWindow is copied into the DstWindow with no-rescaling. If the SrcWindow is smaller then the DstWindow, zeros will pad the result. If the SrcWindow is larger then the DstWindow, data will be lost.

NB: This function does not transition resources. That must be done by the calling scope.

◆ FFTImage2D()

void GPUFFT::FFTImage2D ( FRDGBuilder GraphBuilder,
const FGlobalShaderMap ShaderMap,
const FIntPoint FrequencySize,
bool  bHorizontalFirst,
FRDGTextureSRVRef  SrcTexture,
const FIntRect ROIRect,
FRDGTextureRef  ResultTexture 
)

Two Dimensional transform of an image

Parameters
FrequencySize- The nominal count of frequencies in both directions.
bHornizontalFirst- Defines the data layout of the 2d transform in spectral space.
ROIRect- The Region Of Interest: Defines the src data in the SrcTexture and the location of the result in the ResultUAV
SrcTexture- Input float4 Image. Each channel is a seperate signal to be convolved with the corresponding channel in the Kernel
ResultBuffer- UAV buffer that will hold the result.
TmpBuffer0- Temp float4 buffer with pixelformat PF_A32B32G32R32F

NB: TmpBuffers must be (bHorizontalFirst) ? FIntPoint(FrequencySize .X + 2, ROIRect.Size().Y) : FIntPoint(ROIRect.Size().X, FrequencySize .Y + 2);

NB: This function does not transition resources on the Src or Target. That must be done by the calling scope.

◆ GetFactors()

TArray< uint32 > GPUFFT::GetFactors ( const uint32  PowTwoLength,
const uint32  PowTwoBase 
)

Decompose the input PowTwoLenght, as PowTwoLength = N X PowTwoBase X PowTwoBase X .. X PowTwoBase NB: This assumes the PowTwoLength and PowTwoBase are powers of two.

◆ IsForward()

bool GPUFFT::IsForward ( const FFT_XFORM_TYPE XFormType)

To determine if the transform is inverse or forward

◆ IsHorizontal()

bool GPUFFT::IsHorizontal ( const FFT_XFORM_TYPE XFormType)

The direction of the associated transform type

◆ MaxScanLineLength()

uint32 GPUFFT::MaxScanLineLength ( )

The largest power of two length scan line that can be FFT'd with group shared memory. Larger sizes require a much slower (

◆ SwapContents()

void GPUFFT::SwapContents ( FRDGTextureRef TmpBuffer,
FRDGTextureRef DstBuffer 
)