|
@@ -316,6 +316,10 @@
|
|
|
|
|
|
gpuCompute = new GPUComputationRenderer( WIDTH, WIDTH, renderer );
|
|
|
|
|
|
+ if ( isSafari() ) {
|
|
|
+ gpuCompute.setDataType( THREE.HalfFloatType );
|
|
|
+ }
|
|
|
+
|
|
|
var dtPosition = gpuCompute.createTexture();
|
|
|
var dtVelocity = gpuCompute.createTexture();
|
|
|
|
|
@@ -342,6 +346,10 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function isSafari() {
|
|
|
+ return !!navigator.userAgent.match(/Safari/i) && !navigator.userAgent.match(/Chrome/i);
|
|
|
+ }
|
|
|
+
|
|
|
function restartSimulation() {
|
|
|
|
|
|
var dtPosition = gpuCompute.createTexture();
|