UImportanceSamplingLibrary::NextSobolCell2D
#include "Kismet/ImportanceSamplingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Advances a 2D Sobol cell sequence to the next point using the previous sample, avoiding recomputation from index 0. Use inside loops that step through consecutive samples in the same grid cell.
Caveats & Gotchas
- • PreviousValue must be the actual result returned for Index-1 in the same cell — arbitrary values break the incremental math.
- • NumCells must match the value used to produce PreviousValue; changing it mid-sequence invalidates the result.
- • Only valid for consecutive indices within a single cell; jumping indices requires RandomSobolCell2D.
Signature
static FVector2D NextSobolCell2D(int32 Index, int32 NumCells = 1, FVector2D PreviousValue = FVector2D(0,0)) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Index | int32 | Which sequential point in the cell (the point being advanced to). | — |
| NumCells | int32 | Size of the cell grid, 1 to 32768. Rounded up to the next power of two. | 1 |
| PreviousValue | FVector2D | The Sobol value returned for Index-1 in the same cell. | FVector2D(0,0) |
Return Type
FVector2D Example
Step through samples in a cell C++
FVector2D Point = UImportanceSamplingLibrary::RandomSobolCell2D(0, 8, FVector2D(1,1));
for (int32 i = 1; i < 32; ++i)
{
Point = UImportanceSamplingLibrary::NextSobolCell2D(i, 8, Point);
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?