瀏覽代碼

fix onready for domes

David Catuhe 7 年之前
父節點
當前提交
85ca09af76

文件差異過大導致無法顯示
+ 9899 - 9899
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.js


+ 8 - 0
dist/preview release/babylon.max.js

@@ -104448,11 +104448,15 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var tempOptions = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             var texture = _this._videoTexture = new BABYLON.VideoTexture(name + "_texture", urlsOrVideo, scene, false, _this._useDirectMapping, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
+            texture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure material
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
@@ -104551,6 +104555,7 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
@@ -104559,6 +104564,9 @@ var BABYLON;
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
             _this.photoTexture = new BABYLON.Texture(urlOfPhoto, scene, true, !_this._useDirectMapping);
+            _this.photoTexture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure mesh
             _this._mesh.material = material;
             _this._mesh.parent = _this;

+ 8 - 0
dist/preview release/babylon.no-module.max.js

@@ -104415,11 +104415,15 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var tempOptions = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             var texture = _this._videoTexture = new BABYLON.VideoTexture(name + "_texture", urlsOrVideo, scene, false, _this._useDirectMapping, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
+            texture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure material
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
@@ -104518,6 +104522,7 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
@@ -104526,6 +104531,9 @@ var BABYLON;
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
             _this.photoTexture = new BABYLON.Texture(urlOfPhoto, scene, true, !_this._useDirectMapping);
+            _this.photoTexture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure mesh
             _this._mesh.material = material;
             _this._mesh.parent = _this;

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.worker.js


+ 8 - 0
dist/preview release/es6.js

@@ -104415,11 +104415,15 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var tempOptions = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             var texture = _this._videoTexture = new BABYLON.VideoTexture(name + "_texture", urlsOrVideo, scene, false, _this._useDirectMapping, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
+            texture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure material
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
@@ -104518,6 +104522,7 @@ var BABYLON;
             else {
                 _this._useDirectMapping = options.useDirectMapping;
             }
+            _this._setReady(false);
             // create
             var material = _this._material = new BABYLON.BackgroundMaterial(name + "_material", scene);
             _this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
@@ -104526,6 +104531,9 @@ var BABYLON;
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;
             _this.photoTexture = new BABYLON.Texture(urlOfPhoto, scene, true, !_this._useDirectMapping);
+            _this.photoTexture.onLoadObservable.addOnce(function () {
+                _this._setReady(true);
+            });
             // configure mesh
             _this._mesh.material = material;
             _this._mesh.parent = _this;

+ 6 - 0
src/Helpers/babylon.photoDome.ts

@@ -82,6 +82,8 @@ module BABYLON {
                 this._useDirectMapping = options.useDirectMapping;            
             }
 
+            this._setReady(false);
+
             // create
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
             this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
@@ -92,6 +94,10 @@ module BABYLON {
             material.fovMultiplier = 1.0;
 
             this.photoTexture = new Texture(urlOfPhoto, scene, true, !this._useDirectMapping);
+
+            this.photoTexture.onLoadObservable.addOnce(()=> {
+                this._setReady(true);
+            }) ;             
            
             // configure mesh
             this._mesh.material = material;

+ 6 - 0
src/Helpers/babylon.videoDome.ts

@@ -72,12 +72,18 @@ module BABYLON {
                 this._useDirectMapping = options.useDirectMapping;            
             }
 
+            this._setReady(false);
+
             // create
             let tempOptions: VideoTextureSettings = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
             let texture = this._videoTexture = new VideoTexture(name + "_texture", urlsOrVideo, scene, false, this._useDirectMapping, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
 
+            texture.onLoadObservable.addOnce(()=> {
+                this._setReady(true);
+            }) ;          
+
             // configure material
             material.useEquirectangularFOV = true;
             material.fovMultiplier = 1.0;

二進制
tests/validation/ReferenceImages/spherepanel.png


+ 3 - 3
tests/validation/config.json

@@ -2,10 +2,10 @@
   "root": "https://rawgit.com/BabylonJS/Website/master",
   "tests": [  
     {
-      "title": "Particle Helper",
-      "playgroundId": "#1VGT5D#2",
+      "title": "GUI3D SpherePanel",
+      "playgroundId": "#HB4C01#9",
       "renderCount": 50,
-      "referenceImage": "particle_helper.png"
+      "referenceImage": "spherepanel.png"
     },        
     {
       "title": "Particle Helper",