Fixed random seed when run in benchmark mode, use default random engine instead of fixed mersene twister
Refs #269
This commit is contained in:
parent
5790f30c17
commit
9e073bdd3b
11 changed files with 55 additions and 60 deletions
|
|
@ -233,14 +233,13 @@ public:
|
|||
// Setup and fill the compute shader storage buffers containing the particles
|
||||
void prepareStorageBuffers()
|
||||
{
|
||||
std::mt19937 rGenerator;
|
||||
std::uniform_real_distribution<float> rDistribution(-1.0f, 1.0f);
|
||||
std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||
std::uniform_real_distribution<float> rndDist(-1.0f, 1.0f);
|
||||
|
||||
// Initial particle positions
|
||||
std::vector<Particle> particleBuffer(PARTICLE_COUNT);
|
||||
for (auto& particle : particleBuffer)
|
||||
{
|
||||
particle.pos = glm::vec2(rDistribution(rGenerator), rDistribution(rGenerator));
|
||||
for (auto& particle : particleBuffer) {
|
||||
particle.pos = glm::vec2(rndDist(rndEngine), rndDist(rndEngine));
|
||||
particle.vel = glm::vec2(0.0f);
|
||||
particle.gradientPos.x = particle.pos.x / 2.0f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue