Browse Source

reduce default particle count for IE and Edge

aardgoose 8 năm trước cách đây
mục cha
commit
11b9d7d8ca
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      examples/webgl_gpgpu_protoplanet.html

+ 5 - 1
examples/webgl_gpgpu_protoplanet.html

@@ -266,11 +266,15 @@
 
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 
+			var isIE = /Trident/i.test( navigator.userAgent );
+			var isEdge = /Edge/i.test( navigator.userAgent );
+
 			var hash = document.location.hash.substr( 1 );
+
 			if ( hash ) hash = parseInt( hash, 0 );
 
 			// Texture width for simulation (each texel is a debris particle)
-			var WIDTH = hash || 64;
+			var WIDTH = hash || ( isIE || isEdge ) ? 4 : 64;
 
 			var container, stats;
 			var camera, scene, renderer, geometry, controls;