diff options
author | Andreas Grois <andi@grois.info> | 2018-03-17 17:00:53 +0100 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2018-03-17 17:00:53 +0100 |
commit | c93afe46650cca3d133dfb49642db2fac2edee0d (patch) | |
tree | 73adfac5e28e9664830a23ee0976db4375e62c97 | |
parent | d927208ab36f32f9150d2908a4c70fd039f413ef (diff) |
Fix y-value being always the same if only one worker is used
-rw-r--r-- | BuddhaTest/Shaders/BuddhaCompute.glsl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BuddhaTest/Shaders/BuddhaCompute.glsl b/BuddhaTest/Shaders/BuddhaCompute.glsl index 1416254..c2ac57d 100644 --- a/BuddhaTest/Shaders/BuddhaCompute.glsl +++ b/BuddhaTest/Shaders/BuddhaCompute.glsl @@ -208,7 +208,7 @@ vec2 getCurrentOrbitOffset(const uint orbitNumber, const uint totalWorkers, cons {
uint seed = orbitNumber * totalWorkers + uniqueWorkerID;
float x = hash1(seed,seed);
- seed = (seed ^ intHash(orbitNumber));
+ seed = (seed ^ (intHash(orbitNumber+totalWorkers)));
float y = hash1(seed,seed);
vec2 random = vec2(x,y);
return vec2(random.x * 3.5-2.5,random.y*1.55);
|