Browse Source

GPUParticleSystem: Using alternative pack() code. Hopefully fixes #7804.

Mr.doob 9 years ago
parent
commit
a84b64b1d7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/js/GPUParticleSystem.js

+ 1 - 1
examples/js/GPUParticleSystem.js

@@ -83,7 +83,7 @@ THREE.GPUParticleSystem = function(options) {
       '{',
       'const vec4 bit_shift = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);',
       'const vec4 bit_mask  = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);',
-      'vec4 res = fract(depth * bit_shift);',
+      'vec4 res = mod(depth*bit_shift*vec4(255), vec4(256))/vec4(255);',
       'res -= res.xxyz * bit_mask;',
       'return res;',
       '}',