FImportanceTexture

Texture processed for importance sampling Holds marginal PDF of the rows, as well as the PDF of each row

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Kismet/ImportanceSamplingLibrary.h

Include

#include "Kismet/ImportanceSamplingLibrary.h"

Syntax

struct FImportanceTexture

Remarks

Texture processed for importance sampling Holds marginal PDF of the rows, as well as the PDF of each row

Variables

Name Description

Public variable

TArray< float >

 

ConditionalCDF

Unnormalized cumulative probability of each pixel in a row (Size.Y row CDFs of Size.X+1) First entry of each row is zero, final entry in each row is the CDF normalization factor for that row

Public variable

TArray< float >

 

MarginalCDF

Unnormalized cumulative density of the image by rows (Size.Y+1) First entry is zero, final entry is the CDF normalization factor

Public variable

int

 

NumMips

Active number of MIP levels

Public variable

FIntPoint

 

Size

Active texture dimensions, capped to 1024 x 1024

Public variable

TWeakObjectPtr<...

 

Texture

Original texture object for Break function.

Public variable

TArray< FColor ...

 

TextureData

Packed copy of MIP level data for filtered sampling (capped to 1024x1024) local copy seems better than allocating and copying the same data temporarily for each sample

Public variable

TEnumAsByte< EI...

 

Weighting

Original importance weight for Break function.

Constructors

Name Description

Public function

FImportanceTexture()

Default constructor, must Initialize before use

Public function

FImportanceTexture

(
    UTexture2D* SourceTexture,
    TEnumAsByte< EImportanceWeight::Typ...
)

Constructor with initialization

Functions

Name Description

Public function Const

FLinearColor

 

GetColorBilinear

(
    FVector2D Position,
    int32 Mip
)

Return color of texel at given MIP level, clamped to available Mip levels

Public function Const

FLinearColor

 

GetColorTrilinear

(
    FVector2D Position,
    float Mip
)

Return color interpolated between MIP levels

Public function Const

void

 

ImportanceSample

(
    const FVector2D& Rand,
    int Samples,
    float Intensity,
    FVector2D& SamplePosition,
    FLinearColor& SampleColor,
    float& SampleIntensity,
    float& SampleSize
)

Distribute sample points proportional to Texture2D luminance.

Public function Const

float

 

ImportanceWeight

(
    FColor Texel,
    TEnumAsByte< EImportanceWeight::Typ...
)

Importance probability weight for given texel

Public function

void

 

Initialize

(
    UTexture2D* SourceTexture,
    TEnumAsByte< EImportanceWeight::Typ...
)

Allocate and compute PDF arrays for a texture

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss