xzw 2 роки тому
батько
коміт
f3f773f308
4 змінених файлів з 4 додано та 3 видалено
  1. 1 1
      src/Features.js
  2. 1 1
      src/PotreeRenderer.js
  3. 1 1
      src/custom/potree.shim.js
  4. 1 0
      src/custom/start.js

+ 1 - 1
src/Features.js

@@ -69,7 +69,7 @@ export const Features = (function () {
 		},
 		//WEBGL2: {
 		//	isSupported: function(){
-		//		return gl instanceof WebGL2RenderingContext;
+		//		return  typeof WebGL2RenderingContext != 'undefined' && gl instanceof WebGL2RenderingContext;
 		//	}
 		//},
 		precision: precision

+ 1 - 1
src/PotreeRenderer.js

@@ -281,7 +281,7 @@ class Shader {
 			}
 
 			// uniform blocks
-			if(gl instanceof WebGL2RenderingContext){ 
+			if(typeof WebGL2RenderingContext != 'undefined' && gl instanceof WebGL2RenderingContext){ 
 				let numBlocks = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);
 
 				for (let i = 0; i < numBlocks; i++) {

+ 1 - 1
src/custom/potree.shim.js

@@ -147,7 +147,7 @@ var texLoader = new THREE.TextureLoader()
                 }
             }
 
-            return gl instanceof WebGL2RenderingContext || gl.getExtension('EXT_frag_depth'); //shader中的GL_EXT_frag_depth需要判断一下detectIOS吗。。
+            return (typeof WebGL2RenderingContext != 'undefined' && gl instanceof WebGL2RenderingContext) || gl.getExtension('EXT_frag_depth'); //shader中的GL_EXT_frag_depth需要判断一下detectIOS吗。。
         }
     } 
     

+ 1 - 0
src/custom/start.js

@@ -66,6 +66,7 @@ export function start(dom, mapDom, number ){ //t-Zvd3w0m
          
         var panosLoadDone = function(){   
              
+
             viewer.images360.loadDone() 
             viewer.scene.add360Images(viewer.images360); 
             viewer.mapViewer.addListener(viewer.images360)