Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Kismet
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Kismet/ImportanceSamplingLibrary.h |
| Include | #include "Kismet/ImportanceSamplingLibrary.h" |
Syntax
USTRUCT (BlueprintType ,
Meta=(HasNativeMake="/Script/Engine.ImportanceSamplingLibrary.MakeImportanceTexture", HasNativeBreak="/Script/Engine.ImportanceSamplingLibrary.BreakImportanceTexture"))
struct FImportanceTexture
Remarks
Texture processed for importance sampling Holds marginal PDF of the rows, as well as the PDF of each row
Variables
| Type | Name | Description | |
|---|---|---|---|
| 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 | |
| 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 | |
| int | NumMips | Active number of MIP levels | |
| FIntPoint | Size | Active texture dimensions, capped to 1024 x 1024 | |
| TWeakObjectPtr< UTexture2D > | Texture | Original texture object for Break function. | |
| 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 | |
| TEnumAsByte< EImportanceWeight::Type > | Weighting | Original importance weight for Break function. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Default constructor, must Initialize before use | |||
FImportanceTexture
(
UTexture2D* SourceTexture, |
Constructor with initialization |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FLinearColor | GetColorBilinear
(
FVector2D Position, |
Return color of texel at given MIP level, clamped to available Mip levels | |
| FLinearColor | GetColorTrilinear
(
FVector2D Position, |
Return color interpolated between MIP levels | |
| void | ImportanceSample
(
const FVector2D& Rand, |
Distribute sample points proportional to Texture2D luminance. | |
| float | ImportanceWeight
(
FColor Texel, |
Importance probability weight for given texel | |
| void | Initialize
(
UTexture2D* SourceTexture, |
Allocate and compute PDF arrays for a texture |