I found there is implmenetation of Sobol RNG in UE_5.4\Engine\Source\Runtime\Core\Public\Math\Sobol.h
I tried to use it, but simple code returns strange results (copied below post):
int sobolSeed = 123234;
int sobolIndex = 0;
for (int i = 0; i < 100; i++)
{
float rnd = FSobol::Evaluate(sobolIndex++, 0, sobolSeed);
UE_LOG(LogTemp, Log, TEXT("r=%f i=%d s=%d"), rnd, sobolIndex, sobolSeed);
}
Code generates values very similar to each other - doesn’t seems very random
I tried also to use ::Next function, but with very similar result.
float rnd = FSobol::Evaluate(sobolIndex++, 0, sobolSeed);
for (int i = 0; i < 100; i++)
{
rnd = FSobol::Next(sobolIndex++, 0, rnd);
UE_LOG(LogTemp, Log, TEXT("r=%f i=%d s=%d"), rnd, sobolIndex, sobolSeed);
}
Any Idea how should I use it?
I don’t found any documentation for it - maybe it is not yet implemented/tested etc?
Anyway it resembles one of Dilbert cartoons
returned values are:
LogTemp: r=0.007345 i=1 s=123234
LogTemp: r=0.007345 i=2 s=123234
LogTemp: r=0.007345 i=3 s=123234
LogTemp: r=0.007345 i=4 s=123234
LogTemp: r=0.007346 i=5 s=123234
LogTemp: r=0.007346 i=6 s=123234
LogTemp: r=0.007345 i=7 s=123234
LogTemp: r=0.007345 i=8 s=123234
LogTemp: r=0.007346 i=9 s=123234
LogTemp: r=0.007346 i=10 s=123234
LogTemp: r=0.007346 i=11 s=123234
LogTemp: r=0.007346 i=12 s=123234
LogTemp: r=0.007346 i=13 s=123234
LogTemp: r=0.007346 i=14 s=123234
LogTemp: r=0.007346 i=15 s=123234
LogTemp: r=0.007346 i=16 s=123234
LogTemp: r=0.007346 i=17 s=123234
LogTemp: r=0.007346 i=18 s=123234
LogTemp: r=0.007346 i=19 s=123234
LogTemp: r=0.007346 i=20 s=123234
LogTemp: r=0.007347 i=21 s=123234
LogTemp: r=0.007347 i=22 s=123234
LogTemp: r=0.007346 i=23 s=123234
LogTemp: r=0.007346 i=24 s=123234
LogTemp: r=0.007347 i=25 s=123234
LogTemp: r=0.007347 i=26 s=123234
LogTemp: r=0.007347 i=27 s=123234
LogTemp: r=0.007347 i=28 s=123234
LogTemp: r=0.007347 i=29 s=123234
LogTemp: r=0.007347 i=30 s=123234
LogTemp: r=0.007347 i=31 s=123234
LogTemp: r=0.007347 i=32 s=123234
LogTemp: r=0.007343 i=33 s=123234
LogTemp: r=0.007343 i=34 s=123234
LogTemp: r=0.007343 i=35 s=123234
LogTemp: r=0.007343 i=36 s=123234
LogTemp: r=0.007344 i=37 s=123234
LogTemp: r=0.007344 i=38 s=123234
LogTemp: r=0.007344 i=39 s=123234
LogTemp: r=0.007344 i=40 s=123234
LogTemp: r=0.007344 i=41 s=123234
LogTemp: r=0.007344 i=42 s=123234
LogTemp: r=0.007344 i=43 s=123234
LogTemp: r=0.007344 i=44 s=123234
LogTemp: r=0.007344 i=45 s=123234
LogTemp: r=0.007344 i=46 s=123234
LogTemp: r=0.007344 i=47 s=123234
LogTemp: r=0.007344 i=48 s=123234
LogTemp: r=0.007344 i=49 s=123234