Forráskód Böngészése

Merge pull request #3365 from BabylonJS/master

Nightly
David Catuhe 7 éve
szülő
commit
671817f69c

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 9455 - 9455
Playground/babylon.d.txt


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 7815 - 7815
dist/preview release/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 6 - 6
dist/preview release/babylon.js


+ 5 - 4
dist/preview release/babylon.max.js

@@ -8601,7 +8601,7 @@ var BABYLON;
         });
         });
         Object.defineProperty(Engine, "Version", {
         Object.defineProperty(Engine, "Version", {
             get: function () {
             get: function () {
-                return "3.1-rc-1";
+                return "3.1-rc-2";
             },
             },
             enumerable: true,
             enumerable: true,
             configurable: true
             configurable: true
@@ -25031,6 +25031,7 @@ var BABYLON;
                 var instance = this.instances[index];
                 var instance = this.instances[index];
                 var serializationInstance = {
                 var serializationInstance = {
                     name: instance.name,
                     name: instance.name,
+                    id: instance.id,
                     position: instance.position.asArray(),
                     position: instance.position.asArray(),
                     scaling: instance.scaling.asArray()
                     scaling: instance.scaling.asArray()
                 };
                 };
@@ -25285,6 +25286,9 @@ var BABYLON;
                 for (var index = 0; index < parsedMesh.instances.length; index++) {
                 for (var index = 0; index < parsedMesh.instances.length; index++) {
                     var parsedInstance = parsedMesh.instances[index];
                     var parsedInstance = parsedMesh.instances[index];
                     var instance = mesh.createInstance(parsedInstance.name);
                     var instance = mesh.createInstance(parsedInstance.name);
+                    if (parsedInstance.id) {
+                        instance.id = parsedInstance.id;
+                    }
                     if (BABYLON.Tags) {
                     if (BABYLON.Tags) {
                         BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags);
                         BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags);
                     }
                     }
@@ -32555,9 +32559,6 @@ var BABYLON;
         PostProcessManager.prototype.directRender = function (postProcesses, targetTexture, forceFullscreenViewport) {
         PostProcessManager.prototype.directRender = function (postProcesses, targetTexture, forceFullscreenViewport) {
             if (targetTexture === void 0) { targetTexture = null; }
             if (targetTexture === void 0) { targetTexture = null; }
             if (forceFullscreenViewport === void 0) { forceFullscreenViewport = false; }
             if (forceFullscreenViewport === void 0) { forceFullscreenViewport = false; }
-            if (!this._scene.activeCamera) {
-                return;
-            }
             var engine = this._scene.getEngine();
             var engine = this._scene.getEngine();
             for (var index = 0; index < postProcesses.length; index++) {
             for (var index = 0; index < postProcesses.length; index++) {
                 if (index < postProcesses.length - 1) {
                 if (index < postProcesses.length - 1) {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 6 - 6
dist/preview release/babylon.worker.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 6 - 6
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 5 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -8601,7 +8601,7 @@ var BABYLON;
         });
         });
         Object.defineProperty(Engine, "Version", {
         Object.defineProperty(Engine, "Version", {
             get: function () {
             get: function () {
-                return "3.1-rc-1";
+                return "3.1-rc-2";
             },
             },
             enumerable: true,
             enumerable: true,
             configurable: true
             configurable: true
@@ -25031,6 +25031,7 @@ var BABYLON;
                 var instance = this.instances[index];
                 var instance = this.instances[index];
                 var serializationInstance = {
                 var serializationInstance = {
                     name: instance.name,
                     name: instance.name,
+                    id: instance.id,
                     position: instance.position.asArray(),
                     position: instance.position.asArray(),
                     scaling: instance.scaling.asArray()
                     scaling: instance.scaling.asArray()
                 };
                 };
@@ -25285,6 +25286,9 @@ var BABYLON;
                 for (var index = 0; index < parsedMesh.instances.length; index++) {
                 for (var index = 0; index < parsedMesh.instances.length; index++) {
                     var parsedInstance = parsedMesh.instances[index];
                     var parsedInstance = parsedMesh.instances[index];
                     var instance = mesh.createInstance(parsedInstance.name);
                     var instance = mesh.createInstance(parsedInstance.name);
+                    if (parsedInstance.id) {
+                        instance.id = parsedInstance.id;
+                    }
                     if (BABYLON.Tags) {
                     if (BABYLON.Tags) {
                         BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags);
                         BABYLON.Tags.AddTagsTo(instance, parsedInstance.tags);
                     }
                     }
@@ -32555,9 +32559,6 @@ var BABYLON;
         PostProcessManager.prototype.directRender = function (postProcesses, targetTexture, forceFullscreenViewport) {
         PostProcessManager.prototype.directRender = function (postProcesses, targetTexture, forceFullscreenViewport) {
             if (targetTexture === void 0) { targetTexture = null; }
             if (targetTexture === void 0) { targetTexture = null; }
             if (forceFullscreenViewport === void 0) { forceFullscreenViewport = false; }
             if (forceFullscreenViewport === void 0) { forceFullscreenViewport = false; }
-            if (!this._scene.activeCamera) {
-                return;
-            }
             var engine = this._scene.getEngine();
             var engine = this._scene.getEngine();
             for (var index = 0; index < postProcesses.length; index++) {
             for (var index = 0; index < postProcesses.length; index++) {
                 if (index < postProcesses.length - 1) {
                 if (index < postProcesses.length - 1) {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


+ 1 - 1
src/Engine/babylon.engine.ts

@@ -566,7 +566,7 @@
         }
         }
 
 
         public static get Version(): string {
         public static get Version(): string {
-            return "3.1-rc-1";
+            return "3.1-rc-2";
         }
         }
 
 
         // Updatable statics so stick with vars here
         // Updatable statics so stick with vars here

+ 5 - 1
src/Mesh/babylon.mesh.ts

@@ -2174,6 +2174,7 @@
                 var instance = this.instances[index];
                 var instance = this.instances[index];
                 var serializationInstance: any = {
                 var serializationInstance: any = {
                     name: instance.name,
                     name: instance.name,
+                    id: instance.id,
                     position: instance.position.asArray(),
                     position: instance.position.asArray(),
                     scaling: instance.scaling.asArray()
                     scaling: instance.scaling.asArray()
                 };
                 };
@@ -2473,7 +2474,6 @@
                 mesh.layerMask = 0x0FFFFFFF;
                 mesh.layerMask = 0x0FFFFFFF;
             }
             }
 
 
-
             // Physics
             // Physics
             if (parsedMesh.physicsImpostor) {
             if (parsedMesh.physicsImpostor) {
                 mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parsedMesh.physicsImpostor, {
                 mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parsedMesh.physicsImpostor, {
@@ -2489,6 +2489,10 @@
                     var parsedInstance = parsedMesh.instances[index];
                     var parsedInstance = parsedMesh.instances[index];
                     var instance = mesh.createInstance(parsedInstance.name);
                     var instance = mesh.createInstance(parsedInstance.name);
 
 
+                    if (parsedInstance.id) {
+                        instance.id = parsedInstance.id;
+                    }
+
                     if (Tags) {
                     if (Tags) {
                         Tags.AddTagsTo(instance, parsedInstance.tags);
                         Tags.AddTagsTo(instance, parsedInstance.tags);
                     }
                     }

+ 37 - 38
src/PostProcess/babylon.postProcess.ts

@@ -1,21 +1,20 @@
 module BABYLON {
 module BABYLON {
     export type PostProcessOptions = { width: number, height: number };
     export type PostProcessOptions = { width: number, height: number };
 
 
-    export class PostProcess
-    {
+    export class PostProcess {
         public width = -1;
         public width = -1;
         public height = -1;
         public height = -1;
         public renderTargetSamplingMode: number;
         public renderTargetSamplingMode: number;
         public clearColor: Color4;
         public clearColor: Color4;
         public autoClear = true;
         public autoClear = true;
         public alphaMode = Engine.ALPHA_DISABLE;
         public alphaMode = Engine.ALPHA_DISABLE;
-        public alphaConstants: Color4;  
-        public animations = new Array<Animation>();  
+        public alphaConstants: Color4;
+        public animations = new Array<Animation>();
 
 
         /*
         /*
             Enable Pixel Perfect mode where texture is not scaled to be power of 2.
             Enable Pixel Perfect mode where texture is not scaled to be power of 2.
             Can only be used on a single postprocess or on the last one of a chain.
             Can only be used on a single postprocess or on the last one of a chain.
-        */ 
+        */
         public enablePixelPerfectMode = false;
         public enablePixelPerfectMode = false;
 
 
         public scaleMode = Engine.SCALEMODE_FLOOR;
         public scaleMode = Engine.SCALEMODE_FLOOR;
@@ -41,7 +40,7 @@
         private _shareOutputWithPostProcess: PostProcess;
         private _shareOutputWithPostProcess: PostProcess;
         private _texelSize = Vector2.Zero();
         private _texelSize = Vector2.Zero();
         private _forcedOutputTexture: InternalTexture;
         private _forcedOutputTexture: InternalTexture;
-       
+
         // Events
         // Events
 
 
         /**
         /**
@@ -118,11 +117,11 @@
 
 
         public get outputTexture(): InternalTexture {
         public get outputTexture(): InternalTexture {
             return this._textures.data[this._currentRenderTextureInd];
             return this._textures.data[this._currentRenderTextureInd];
-        }   
+        }
 
 
         public set outputTexture(value: InternalTexture) {
         public set outputTexture(value: InternalTexture) {
             this._forcedOutputTexture = value;
             this._forcedOutputTexture = value;
-        }   
+        }
 
 
         public getCamera(): Camera {
         public getCamera(): Camera {
             return this._camera;
             return this._camera;
@@ -140,8 +139,8 @@
             return this._texelSize;
             return this._texelSize;
         }
         }
 
 
-        constructor(public name: string, fragmentUrl: string, parameters: Nullable<string[]>, samplers: Nullable<string[]>, options: number | PostProcessOptions, camera: Nullable<Camera>, 
-                    samplingMode: number = Texture.NEAREST_SAMPLINGMODE, engine?: Engine, reusable?: boolean, defines: Nullable<string> = null, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT, vertexUrl: string = "postprocess", indexParameters?: any, blockCompilation = false) {
+        constructor(public name: string, fragmentUrl: string, parameters: Nullable<string[]>, samplers: Nullable<string[]>, options: number | PostProcessOptions, camera: Nullable<Camera>,
+            samplingMode: number = Texture.NEAREST_SAMPLINGMODE, engine?: Engine, reusable?: boolean, defines: Nullable<string> = null, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT, vertexUrl: string = "postprocess", indexParameters?: any, blockCompilation = false) {
             if (camera != null) {
             if (camera != null) {
                 this._camera = camera;
                 this._camera = camera;
                 this._scene = camera.getScene();
                 this._scene = camera.getScene();
@@ -174,11 +173,11 @@
             if (!blockCompilation) {
             if (!blockCompilation) {
                 this.updateEffect(defines);
                 this.updateEffect(defines);
             }
             }
-        }    
+        }
 
 
         public getEngine(): Engine {
         public getEngine(): Engine {
             return this._engine;
             return this._engine;
-        }        
+        }
 
 
         public getEffect(): Effect {
         public getEffect(): Effect {
             return this._effect;
             return this._effect;
@@ -191,33 +190,33 @@
 
 
             return this;
             return this;
         }
         }
-        
+
         public updateEffect(defines: Nullable<string> = null, uniforms: Nullable<string[]> = null, samplers: Nullable<string[]> = null, indexParameters?: any,
         public updateEffect(defines: Nullable<string> = null, uniforms: Nullable<string[]> = null, samplers: Nullable<string[]> = null, indexParameters?: any,
-                            onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void) {
+            onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void) {
             this._effect = this._engine.createEffect({ vertex: this._vertexUrl, fragment: this._fragmentUrl },
             this._effect = this._engine.createEffect({ vertex: this._vertexUrl, fragment: this._fragmentUrl },
                 ["position"],
                 ["position"],
                 uniforms || this._parameters,
                 uniforms || this._parameters,
-                samplers || this._samplers, 
+                samplers || this._samplers,
                 defines !== null ? defines : "",
                 defines !== null ? defines : "",
                 undefined,
                 undefined,
                 onCompiled,
                 onCompiled,
                 onError,
                 onError,
                 indexParameters || this._indexParameters
                 indexParameters || this._indexParameters
-                );
-         }
+            );
+        }
 
 
         public isReusable(): boolean {
         public isReusable(): boolean {
             return this._reusable;
             return this._reusable;
         }
         }
-        
+
         /** invalidate frameBuffer to hint the postprocess to create a depth buffer */
         /** invalidate frameBuffer to hint the postprocess to create a depth buffer */
-        public markTextureDirty() : void{
+        public markTextureDirty(): void {
             this.width = -1;
             this.width = -1;
         }
         }
 
 
-        public activate(camera: Camera, sourceTexture: Nullable<InternalTexture> = null, forceDepthStencil?: boolean): void {            
+        public activate(camera: Nullable<Camera>, sourceTexture: Nullable<InternalTexture> = null, forceDepthStencil?: boolean): void {
             camera = camera || this._camera;
             camera = camera || this._camera;
-            
+
             var scene = camera.getScene();
             var scene = camera.getScene();
             var engine = scene.getEngine();
             var engine = scene.getEngine();
             var maxSize = engine.getCaps().maxTextureSize;
             var maxSize = engine.getCaps().maxTextureSize;
@@ -255,17 +254,17 @@
                             this._engine._releaseTexture(this._textures.data[i]);
                             this._engine._releaseTexture(this._textures.data[i]);
                         }
                         }
                         this._textures.reset();
                         this._textures.reset();
-                    }         
+                    }
                     this.width = desiredWidth;
                     this.width = desiredWidth;
                     this.height = desiredHeight;
                     this.height = desiredHeight;
 
 
                     let textureSize = { width: this.width, height: this.height };
                     let textureSize = { width: this.width, height: this.height };
-                    let textureOptions = { 
-                        generateMipMaps: false, 
-                        generateDepthBuffer: forceDepthStencil || camera._postProcesses.indexOf(this) === 0, 
+                    let textureOptions = {
+                        generateMipMaps: false,
+                        generateDepthBuffer: forceDepthStencil || camera._postProcesses.indexOf(this) === 0,
                         generateStencilBuffer: (forceDepthStencil || camera._postProcesses.indexOf(this) === 0) && this._engine.isStencilEnable,
                         generateStencilBuffer: (forceDepthStencil || camera._postProcesses.indexOf(this) === 0) && this._engine.isStencilEnable,
-                        samplingMode: this.renderTargetSamplingMode, 
-                        type: this._textureType 
+                        samplingMode: this.renderTargetSamplingMode,
+                        type: this._textureType
                     };
                     };
 
 
                     this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions));
                     this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions));
@@ -273,7 +272,7 @@
                     if (this._reusable) {
                     if (this._reusable) {
                         this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions));
                         this._textures.push(this._engine.createRenderTargetTexture(textureSize, textureOptions));
                     }
                     }
-                    
+
                     this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);
                     this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);
 
 
                     this.onSizeChangedObservable.notifyObservers(this);
                     this.onSizeChangedObservable.notifyObservers(this);
@@ -287,7 +286,7 @@
             }
             }
 
 
             var target: InternalTexture;
             var target: InternalTexture;
-                        
+
             if (this._shareOutputWithPostProcess) {
             if (this._shareOutputWithPostProcess) {
                 target = this._shareOutputWithPostProcess.outputTexture;
                 target = this._shareOutputWithPostProcess.outputTexture;
             } else if (this._forcedOutputTexture) {
             } else if (this._forcedOutputTexture) {
@@ -334,7 +333,7 @@
             }
             }
             return this.width / this.height;
             return this.width / this.height;
         }
         }
-        
+
         public apply(): Nullable<Effect> {
         public apply(): Nullable<Effect> {
             // Check
             // Check
             if (!this._effect || !this._effect.isReady())
             if (!this._effect || !this._effect.isReady())
@@ -350,17 +349,17 @@
             this._engine.setAlphaMode(this.alphaMode);
             this._engine.setAlphaMode(this.alphaMode);
             if (this.alphaConstants) {
             if (this.alphaConstants) {
                 this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);
                 this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);
-            }            
+            }
 
 
             // Texture            
             // Texture            
-            var source: InternalTexture;                        
+            var source: InternalTexture;
             if (this._shareOutputWithPostProcess) {
             if (this._shareOutputWithPostProcess) {
                 source = this._shareOutputWithPostProcess.outputTexture;
                 source = this._shareOutputWithPostProcess.outputTexture;
             } else if (this._forcedOutputTexture) {
             } else if (this._forcedOutputTexture) {
                 source = this._forcedOutputTexture;
                 source = this._forcedOutputTexture;
             } else {
             } else {
                 source = this.outputTexture;
                 source = this.outputTexture;
-            }            
+            }
             this._effect._bindTexture("textureSampler", source);
             this._effect._bindTexture("textureSampler", source);
 
 
             // Parameters
             // Parameters
@@ -384,7 +383,7 @@
         }
         }
 
 
         public dispose(camera?: Camera): void {
         public dispose(camera?: Camera): void {
-            camera = camera || this._camera;            
+            camera = camera || this._camera;
 
 
             this._disposeTextures();
             this._disposeTextures();
 
 
@@ -392,12 +391,12 @@
                 let index = this._scene.postProcesses.indexOf(this);
                 let index = this._scene.postProcesses.indexOf(this);
                 if (index !== -1) {
                 if (index !== -1) {
                     this._scene.postProcesses.splice(index, 1);
                     this._scene.postProcesses.splice(index, 1);
-                }                
+                }
             } else {
             } else {
                 let index = this._engine.postProcesses.indexOf(this);
                 let index = this._engine.postProcesses.indexOf(this);
                 if (index !== -1) {
                 if (index !== -1) {
                     this._engine.postProcesses.splice(index, 1);
                     this._engine.postProcesses.splice(index, 1);
-                }         
+                }
             }
             }
 
 
             if (!camera) {
             if (!camera) {
@@ -407,7 +406,7 @@
 
 
             var index = camera._postProcesses.indexOf(this);
             var index = camera._postProcesses.indexOf(this);
             if (index === 0 && camera._postProcesses.length > 0) {
             if (index === 0 && camera._postProcesses.length > 0) {
-                this._camera._postProcesses[0].markTextureDirty(); 
+                this._camera._postProcesses[0].markTextureDirty();
             }
             }
 
 
             this.onActivateObservable.clear();
             this.onActivateObservable.clear();
@@ -415,6 +414,6 @@
             this.onApplyObservable.clear();
             this.onApplyObservable.clear();
             this.onBeforeRenderObservable.clear();
             this.onBeforeRenderObservable.clear();
             this.onSizeChangedObservable.clear();
             this.onSizeChangedObservable.clear();
-        }          
+        }
     }
     }
 }
 }

+ 2 - 6
src/PostProcess/babylon.postProcessManager.ts

@@ -38,7 +38,7 @@
 
 
             this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
             this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
         }
         }
-        
+
         public _rebuild(): void {
         public _rebuild(): void {
             let vb = this._vertexBuffers[VertexBuffer.PositionKind];
             let vb = this._vertexBuffers[VertexBuffer.PositionKind];
 
 
@@ -48,7 +48,7 @@
             vb._rebuild();
             vb._rebuild();
             this._buildIndexBuffer();
             this._buildIndexBuffer();
         }
         }
-        
+
         // Methods
         // Methods
         public _prepareFrame(sourceTexture: Nullable<InternalTexture> = null, postProcesses: Nullable<PostProcess[]> = null): boolean {
         public _prepareFrame(sourceTexture: Nullable<InternalTexture> = null, postProcesses: Nullable<PostProcess[]> = null): boolean {
             let camera = this._scene.activeCamera;
             let camera = this._scene.activeCamera;
@@ -67,10 +67,6 @@
         }
         }
 
 
         public directRender(postProcesses: PostProcess[], targetTexture: Nullable<InternalTexture> = null, forceFullscreenViewport = false): void {
         public directRender(postProcesses: PostProcess[], targetTexture: Nullable<InternalTexture> = null, forceFullscreenViewport = false): void {
-            if (!this._scene.activeCamera) {
-                return;
-            }
-
             var engine = this._scene.getEngine();
             var engine = this._scene.getEngine();
 
 
             for (var index = 0; index < postProcesses.length; index++) {
             for (var index = 0; index < postProcesses.length; index++) {