UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Sobol.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Math/MathFwd.h"
7#include "Math/Vector.h"
8#include "Math/Vector2D.h"
9
13class FSobol
14{
15public:
16 // number of Sobol dimensions in DirectionNumbers and GrayNumbers tables (full Joe and Kuo table is 21201)
17 static constexpr inline int32 MaxDimension = 15;
18
19 // maximum number of bits in a 2D cell coordinate
20 // allows cell grids from 1x1 to 2^MaxCell2DBits x 2^MaxCell2DBits
21 static constexpr inline int32 MaxCell2DBits = 15;
22
23 // maximum number of bits in a 3D cell coordinate
24 // allows cell grids from 1x1x1 to 2^MaxCell3DBits x 2^MaxCell3DBits x 2^MaxCell3DBits
25 static constexpr inline int32 MaxCell3DBits = 10;
26
27private:
28 // 24-bit Sobol direction numbers for 32-bit index
29 static const int32 DirectionNumbers[MaxDimension + 1][32];
30
31 // 24-bit Sobol direction numbers for Gray code order
32 static const int32 GrayNumbers[MaxDimension + 1][32];
33
34 // 24-bit Sobol direction numbers per cell
35 static const int32 Cell2DDirectionNumbers[MaxCell2DBits + 1][32][2];
36
37 // 24-bit Sobol direction numbers per cell in Gray-code order
38 static const int32 Cell2DGrayNumbers[MaxCell2DBits + 1][32][2];
39
40 // 24-bit Sobol direction numbers per cell
41 static const int32 Cell3DDirectionNumbers[MaxCell3DBits + 1][32][3];
42
43 // 24-bit Sobol direction numbers per cell in Gray-code order
44 static const int32 Cell3DGrayNumbers[MaxCell3DBits + 1][32][3];
45
46public:
55 [[nodiscard]] CORE_API static float Evaluate(int32 Index, int32 Dim, int32 Seed = 0);
56
65 [[nodiscard]] CORE_API static float Next(int32 Index, int32 Dim, float Value);
66
67
78
88
89
100
110
113};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint16_t uint16
Definition binka_ue_file_header.h:7
Definition Sobol.h:14
static constexpr int32 MaxCell2DBits
Definition Sobol.h:21
static CORE_API float Evaluate(int32 Index, int32 Dim, int32 Seed=0)
Definition Sobol.cpp:12
static constexpr int32 MaxCell3DBits
Definition Sobol.h:25
static constexpr int32 MaxDimension
Definition Sobol.h:17
static CORE_API uint16 ComputeGPUSpatialSeed(int32 x, int32 y, int32 Index)
Definition Sobol.cpp:241
U16 Index
Definition radfft.cpp:71
Definition IntPoint.h:25