File tree 9 files changed +3154
-8
lines changed
cmake/dependencies/internal
9 files changed +3154
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ include(Options)
21
21
include (CXX)
22
22
23
23
# Setup external dependencies
24
- # include(SetupBoost)
25
24
include (SetupTBB)
26
25
include (SetupEmbree)
27
26
include (SetupGLFW)
Original file line number Diff line number Diff line change
1
+ add_library (
2
+ pcg INTERFACE
3
+ )
4
+
5
+ target_include_directories (
6
+ pcg INTERFACE
7
+ "pcg"
8
+ )
Original file line number Diff line number Diff line change 4
4
#include < algorithm>
5
5
#include < random>
6
6
7
+ #include " pcg_random.hpp"
8
+
7
9
#include < embree3/common/math/vec2.h>
8
10
#include < embree3/common/math/vec3.h>
9
11
@@ -13,7 +15,7 @@ class Sampler
13
15
public:
14
16
Sampler ();
15
17
16
- unsigned NewSeed ();
18
+ pcg_extras::seed_seq_from<std::random_device> NewSeed ();
17
19
float Uniform1D ();
18
20
embree::Vec2f Uniform2D ();
19
21
std::vector<embree::Vec2f> Stratified2D (
@@ -30,7 +32,7 @@ class Sampler
30
32
31
33
private:
32
34
std::uniform_real_distribution<float > float_uniform_distribution;
33
- std::mt19937 prng;
35
+ pcg32 prng;
34
36
};
35
37
36
38
#endif // SAMPLER_H
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ target_link_libraries(
27
27
embree_common
28
28
glad
29
29
imgui
30
+ pcg
30
31
spdlog
31
32
tinyexr
32
33
# External dependencies.
Original file line number Diff line number Diff line change @@ -9,12 +9,9 @@ Sampler::Sampler():
9
9
{
10
10
}
11
11
12
- unsigned Sampler::NewSeed ()
12
+ pcg_extras::seed_seq_from<std::random_device> Sampler::NewSeed ()
13
13
{
14
- std::uniform_int_distribution<unsigned > seed;
15
- std::random_device rng;
16
-
17
- return seed (rng);
14
+ return pcg_extras::seed_seq_from<std::random_device>();
18
15
}
19
16
20
17
float Sampler::Uniform1D ()
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ include(SetupCLI11)
3
3
include (SetupEmbreeCommon)
4
4
include (SetupGLAD)
5
5
include (SetupImGui)
6
+ include (SetupPCG)
6
7
include (SetupSPDLog)
7
8
include (SetupTinyEXR)
You can’t perform that action at this time.
0 commit comments