Pārlūkot izejas kodu

Merge branch 'master' of http://face3d.4dage.com:7005/chenzhiguang/zhengzhou_university

chenzhiguang 4 gadi atpakaļ
vecāks
revīzija
7322f4e369

+ 28 - 5
web/public/static/js/lib/stats.min.js

@@ -18,9 +18,12 @@ var Stats = function() {
     }, !1);
     var g = (performance || Date).now()
       , e = g
-      , a = 0
+      , a = 0 
       , r = h(new Stats.Panel("FPS","#0ff","#002"))
       , f = h(new Stats.Panel("MS","#0f0","#020"));
+      
+    var info = {dur:0, aveFps:0}
+      
     if (self.performance && self.performance.memory)
         var t = h(new Stats.Panel("MB","#f08","#201"));
     k(0);
@@ -33,7 +36,7 @@ var Stats = function() {
             g = (performance || Date).now()
         },
         end: function() {
-            a++;
+            /* a++;
             var c = (performance || Date).now();
             if(f.dom.clientWidth) f.update(c - g, 200);
             
@@ -45,11 +48,29 @@ var Stats = function() {
                 var d = performance.memory;
                 t.update(d.usedJSHeapSize / 1048576, d.jsHeapSizeLimit / 1048576)
             } 
-            return 1E3 * a / (c - e)//c
+            return 1E3 * a / (c - e)//c */
+            
+            a++; 
+            var c = (performance || Date).now();
+      
+            if(c > e + 1E3){
+                
+                var v = 1E3 * a / (c - e)
+                var {min,max} = r.update(v, 100)
+                e = c
+                a = 0
+                
+                
+                info = {min, max, fps:v, dur : c - g,  aveFps:(info.aveFps * (info.dur / 1000 ) + v ) / ((c - g) / 1000)}
+                return info
+            
+            }  
+            
+            
         },
         update: function() {
-            g = this.end()
-            return g
+            var a1 = this.end()
+            return a1
         },
         domElement: c,
         setMode: k
@@ -98,6 +119,8 @@ Stats.Panel = function(h, k, l) {
             b.fillStyle = l;
             b.globalAlpha = .9;
             b.fillRect(d + n - a, m, a, e((1 - f / v) * p))
+            
+            return {min:c, max:g}
         }
     }
 }

+ 25 - 9
web/public/static/js/main_2020_show.js

@@ -22385,11 +22385,25 @@ window.Modernizr = function(n, e, t) {
                 //loadVideo();//add   
                 //-------------------
                 
-                setTimeout(()=>{
+                /* setTimeout(()=>{
                     this.qualityManager.updateMaximums()
-                    // && stats.dom.parentElement.removeChild(stats.dom), window.stats = null
-                    window.stats && (stats.dom.parentElement )
-                },6000)
+                    window.stats && (stats.dom.parentElement && stats.dom.parentElement.removeChild(stats.dom), window.stats = null)
+                },6000) */
+                
+                var updateCount = 0;
+                var interval = setInterval(()=>{
+                    updateCount ++
+                    if(updateCount>4){
+                        clearInterval(interval)
+                        window.stats && (stats.dom.parentElement && stats.dom.parentElement.removeChild(stats.dom), window.stats = null)
+                        return;
+                    }
+                    this.qualityManager.updateMaximums()
+                    
+                    
+                },5000)
+                
+                
                 
                 var t = e.mode
                   , i = e.pano
@@ -24562,7 +24576,8 @@ window.Modernizr = function(n, e, t) {
             u.profiling.enabled && this.overrideTextures(),
             e.appendChild(this.renderer.domElement)
             
-            window.stats = new Stats();  
+            window.stats = new Stats();
+            window.stats.begin()
             e.appendChild( stats.dom );
         }
         ,
@@ -25178,7 +25193,7 @@ window.Modernizr = function(n, e, t) {
             this.updateComponents(),
             this.updateTextureMemory(),
             this.render(),
-            window.stats && (window.fps = stats.update()),
+            window.stats && (window.fps = stats.update() || window.fps),
             this.emit(a.AfterRender))
         };
         n.prototype.getImageData = function() {
@@ -28200,8 +28215,9 @@ window.Modernizr = function(n, e, t) {
             //if(settings.mobileNavHigh)return r.HIGH  //改
             //else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
             //cause配置不高 卡顿
-            
-            if(window.fps>50)return r.HIGH
+            if(window.fps && window.fps.aveFps>52){
+                return r.HIGH
+            } 
             else return r.STANDARD
         
         
@@ -28214,7 +28230,7 @@ window.Modernizr = function(n, e, t) {
         ,
         n.prototype.detectMaxZoomPanoSize = function() {
             //return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
-            if(window.fps > 56){
+            if(window.fps && window.fps.aveFps>56){
                 return this.getPanoSize(r.ULTRAHIGH)
             }else{
                 return this.getPanoSize(r.HIGH)