UImportanceSamplingLibrary::RandomSobolCell3D
#include "Kismet/ImportanceSamplingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns a Sobol-distributed 3D point within a specific cell of a stratified 3D grid, for volumetric jittered sampling patterns.
Caveats & Gotchas
- • The 3D grid tops out at NumCells = 1024 per axis (rounded up to a power of two), a much smaller ceiling than the 2D version's 32768 — high-resolution volumetric sampling needs to tile or subdivide manually.
- • Cell coordinates are integer grid coordinates, not normalized 0-1 positions.
- • For stepping consecutive indices within the same cell, NextSobolCell3D is cheaper.
Signature
static FVector RandomSobolCell3D(int32 Index, int32 NumCells = 1, FVector Cell = FVector(0,0,0), FVector Seed = FVector(0,0,0)) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Index | int32 | Which sequential point in the cell, starting at 0. | — |
| NumCells | int32 | Size of the cell grid, 1 to 1024. Rounded up to the next power of two. | 1 |
| Cell | FVector | Integer grid cell coordinate to draw the point from. | FVector(0,0,0) |
| Seed | FVector | Random 3D seed (components in the range 0-1) to randomize across multiple sequences. | FVector(0,0,0) |
Return Type
FVector Example
Scatter a point within a 3D grid cell C++
const FVector Point = UImportanceSamplingLibrary::RandomSobolCell3D(0, 8, FVector(1,2,0), FVector(0.2f, 0.4f, 0.6f));
// Point is a jittered 3D sample within grid cell (1,2,0) of an 8x8x8 grid Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?