فهرست منبع

Merge branch 'master' into particleAsComponent

# Conflicts:
#	dist/preview release/babylon.d.ts
#	dist/preview release/babylon.js
#	dist/preview release/babylon.worker.js
#	dist/preview release/viewer/babylon.viewer.js
David Catuhe 7 سال پیش
والد
کامیت
213629cbc1
30فایلهای تغییر یافته به همراه6968 افزوده شده و 8041 حذف شده
  1. 7 2
      Viewer/src/configuration/configurationCompatibility.ts
  2. 10 6
      Viewer/src/loader/modelLoader.ts
  3. 4 9
      Viewer/src/managers/telemetryManager.ts
  4. 25 19
      Viewer/src/viewer/viewer.ts
  5. 5584 5600
      dist/preview release/babylon.d.ts
  6. 54 54
      dist/preview release/babylon.js
  7. 223 466
      dist/preview release/babylon.max.js
  8. 223 466
      dist/preview release/babylon.no-module.max.js
  9. 52 52
      dist/preview release/babylon.worker.js
  10. 223 466
      dist/preview release/es6.js
  11. 1 1
      dist/preview release/glTF2Interface/package.json
  12. 1 1
      dist/preview release/gui/package.json
  13. 2 2
      dist/preview release/inspector/babylon.inspector.bundle.js
  14. 1 1
      dist/preview release/inspector/package.json
  15. 2 2
      dist/preview release/loaders/package.json
  16. 1 1
      dist/preview release/materialsLibrary/package.json
  17. 1 1
      dist/preview release/postProcessesLibrary/package.json
  18. 1 1
      dist/preview release/proceduralTexturesLibrary/package.json
  19. 2 2
      dist/preview release/serializers/package.json
  20. 65 65
      dist/preview release/viewer/babylon.viewer.js
  21. 240 486
      dist/preview release/viewer/babylon.viewer.max.js
  22. 1 0
      dist/preview release/what's new.md
  23. 1 1
      package.json
  24. 9 4
      src/Animations/babylon.animatable.ts
  25. 162 283
      src/Engine/babylon.engine.ts
  26. 9 0
      src/Engine/babylon.nullEngine.ts
  27. 33 33
      src/Materials/Textures/babylon.texture.ts
  28. 9 5
      src/Tools/babylon.database.ts
  29. 9 3
      src/Tools/babylon.tools.ts
  30. 13 9
      src/babylon.scene.ts

+ 7 - 2
Viewer/src/configuration/configurationCompatibility.ts

@@ -7,8 +7,6 @@ import { ViewerConfiguration, getConfigurationKey } from './configuration'
  */
 export function processConfigurationCompatibility(configuration: ViewerConfiguration) {
 
-
-
     if (configuration.camera) {
         // camera contrast -> image processing contrast
         if (configuration.camera.contrast !== undefined) {
@@ -31,6 +29,13 @@ export function processConfigurationCompatibility(configuration: ViewerConfigura
             }
         }
     }
+
+    if (configuration.model && typeof configuration.model === 'object') {
+        // castShadows === castShadow
+        if ((<any>configuration.model).castShadows !== undefined && configuration.model.castShadow === undefined) {
+            configuration.model.castShadow = (<any>configuration.model).castShadows;
+        }
+    }
 }
 
 function setKeyInObject(object: any, keys: string, value: any, shouldOverwrite?: boolean) {

+ 10 - 6
Viewer/src/loader/modelLoader.ts

@@ -22,6 +22,12 @@ export class ModelLoader {
 
     private _plugins: Array<ILoaderPlugin>;
 
+    private _baseUrl: string;
+
+    public get baseUrl(): string {
+        return this._baseUrl;
+    }
+
     /**
      * Create a new Model loader
      * @param _viewer the viewer using this model loader
@@ -62,19 +68,17 @@ export class ModelLoader {
 
         model.loadId = this._loadId++;
 
-        let base: string = "";
-
         let filename: any;
         if (modelConfiguration.file) {
-            base = "file:";
+            this._baseUrl = "file:";
             filename = modelConfiguration.file;
         }
         else if (modelConfiguration.url) {
             filename = Tools.GetFilename(modelConfiguration.url) || modelConfiguration.url;
-            base = modelConfiguration.root || Tools.GetFolderPath(modelConfiguration.url);
+            this._baseUrl = modelConfiguration.root || Tools.GetFolderPath(modelConfiguration.url);
         }
 
-        if (!filename || !base) {
+        if (!filename || !this._baseUrl) {
             model.state = ModelState.ERROR;
             Tools.Error("No URL provided");
             return model;
@@ -85,7 +89,7 @@ export class ModelLoader {
 
         let scene = model.rootMesh.getScene();
 
-        model.loader = SceneLoader.ImportMesh(undefined, base, filename, scene, (meshes, particleSystems, skeletons, animationGroups) => {
+        model.loader = SceneLoader.ImportMesh(undefined, this._baseUrl, filename, scene, (meshes, particleSystems, skeletons, animationGroups) => {
             meshes.forEach(mesh => {
                 Tags.AddTagsTo(mesh, "viewerMesh");
                 model.addMesh(mesh);

+ 4 - 9
Viewer/src/managers/telemetryManager.ts

@@ -43,16 +43,11 @@ export class TelemetryManager {
         let logErrors = true;
 
         while (logErrors) {
-            let gl = (<any>engine)._gl;
-            if (gl && gl.getError) {
-                let error = gl.getError();
-                if (error === gl.NO_ERROR) {
-                    logErrors = false;
-                } else {
-                    this.broadcast("WebGL Error", viewerId, { error: error });
-                }
-            } else {
+            let error = engine.getError();
+            if (error === 0) {
                 logErrors = false;
+            } else {
+                this.broadcast("WebGL Error", viewerId, { error: error });
             }
         }
     }

+ 25 - 19
Viewer/src/viewer/viewer.ts

@@ -1,17 +1,18 @@
-import { viewerManager } from './viewerManager';
-import { SceneManager } from '../managers/sceneManager';
-import { ConfigurationLoader } from '../configuration/loader';
-import { Effect, Observable, Engine, Scene, Database, SceneLoaderProgressEvent, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Tools, RenderingManager, TargetCamera, WebVRFreeCamera, Vector3 } from 'babylonjs';
-import { ViewerConfiguration, IObserversConfiguration, IModelConfiguration } from '../configuration/';
-
-import { ViewerModel } from '../model/viewerModel';
-import { ModelLoader } from '../loader/modelLoader';
+import { Database, Effect, Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, RenderingManager, Scene, SceneLoaderProgressEvent, TargetCamera, Tools, Vector3 } from 'babylonjs';
+import { IModelConfiguration, IObserversConfiguration, ViewerConfiguration } from '../configuration/';
+import { processConfigurationCompatibility } from '../configuration/configurationCompatibility';
+import { ConfigurationContainer } from '../configuration/configurationContainer';
 import { viewerGlobals } from '../configuration/globals';
-import { telemetryManager } from '../managers/telemetryManager';
+import { ConfigurationLoader } from '../configuration/loader';
 import { deepmerge } from '../helper/';
+import { ModelLoader } from '../loader/modelLoader';
 import { ObservablesManager } from '../managers/observablesManager';
-import { ConfigurationContainer } from '../configuration/configurationContainer';
+import { SceneManager } from '../managers/sceneManager';
+import { telemetryManager } from '../managers/telemetryManager';
+import { ViewerModel } from '../model/viewerModel';
 import { TemplateManager } from '../templating/templateManager';
+import { viewerManager } from './viewerManager';
+
 
 /**
  * The AbstractViewr is the center of Babylon's viewer.
@@ -271,14 +272,8 @@ export abstract class AbstractViewer {
             }
 
             this.sceneManager.vrHelper.enterVR();
-            // calculate position and vr scale
-
-            if (this.sceneManager.environmentHelper) {
-                this.sceneManager.environmentHelper.ground && this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(this._vrScale);
-                this.sceneManager.environmentHelper.skybox && this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(this._vrScale);
-            }
 
-            // position the vr camera to be in front of the object
+            // position the vr camera to be in front of the object or wherever the user has configured it to be
             if (this.sceneManager.vrHelper.currentVRCamera) {
                 if (this.configuration.vr && this.configuration.vr.cameraPosition !== undefined) {
                     this.sceneManager.vrHelper.currentVRCamera.position.copyFrom(this.configuration.vr.cameraPosition as Vector3);
@@ -286,6 +281,7 @@ export abstract class AbstractViewer {
                     this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(0, this.sceneManager.vrHelper.currentVRCamera.position.y, -1);
                 }
                 (<TargetCamera>this.sceneManager.vrHelper.currentVRCamera).rotationQuaternion && (<TargetCamera>this.sceneManager.vrHelper.currentVRCamera).rotationQuaternion.copyFromFloats(0, 0, 0, 1);
+                // set the height of the model to be what the user has configured, or floating by default
                 if (this.configuration.vr && this.configuration.vr.modelHeightCorrection !== undefined) {
                     if (typeof this.configuration.vr.modelHeightCorrection === 'number') {
                         this._vrModelRepositioning = this.configuration.vr.modelHeightCorrection
@@ -299,6 +295,7 @@ export abstract class AbstractViewer {
                 this._vrModelRepositioning = 0;
             }
 
+            // scale the model
             if (this.sceneManager.models.length) {
                 let boundingVectors = this.sceneManager.models[0].rootMesh.getHierarchyBoundingVectors();
                 let sizeVec = boundingVectors.max.subtract(boundingVectors.min);
@@ -315,6 +312,12 @@ export abstract class AbstractViewer {
                 this.sceneManager.models[0].rootMesh.rotationQuaternion = null;
             }
 
+            // scale the environment to match the model
+            if (this.sceneManager.environmentHelper) {
+                this.sceneManager.environmentHelper.ground && this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(this._vrScale);
+                this.sceneManager.environmentHelper.skybox && this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(this._vrScale);
+            }
+
             // post processing
             if (this.sceneManager.defaultRenderingPipelineEnabled && this.sceneManager.defaultRenderingPipeline) {
                 this.sceneManager.defaultRenderingPipeline.imageProcessingEnabled = false;
@@ -323,13 +326,14 @@ export abstract class AbstractViewer {
         } else {
             if (this.sceneManager.vrHelper) {
                 this.sceneManager.vrHelper.exitVR();
-                //this.sceneManager.scene.activeCamera = this.sceneManager.camera;
+
+                // undo the scaling of the model
                 if (this.sceneManager.models.length) {
                     this.sceneManager.models[0].rootMesh.scaling.scaleInPlace(1 / this._vrScale);
                     this.sceneManager.models[0].rootMesh.position.y -= this._vrModelRepositioning;
-
                 }
 
+                // undo the scaling of the environment
                 if (this.sceneManager.environmentHelper) {
                     this.sceneManager.environmentHelper.ground && this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(1 / this._vrScale);
                     this.sceneManager.environmentHelper.skybox && this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(1 / this._vrScale);
@@ -457,6 +461,8 @@ export abstract class AbstractViewer {
                 console.log("Error parsing file " + newConfiguration, error);
             });
         } else {
+            //backcompat
+            processConfigurationCompatibility(newConfiguration);
             // update this.configuration with the new data
             this._configurationContainer.configuration = deepmerge(this.configuration || {}, newConfiguration);
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5584 - 5600
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 54 - 54
dist/preview release/babylon.js


+ 223 - 466
dist/preview release/babylon.max.js

@@ -11165,7 +11165,7 @@ var BABYLON;
         var magFilter = gl.NEAREST;
         var minFilter = gl.NEAREST;
         switch (samplingMode) {
-            case BABYLON.Texture.BILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11174,7 +11174,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.TRILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_TRILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11183,7 +11183,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_SAMPLINGMODE:
+            case Engine.TEXTURE_NEAREST_SAMPLINGMODE:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11192,7 +11192,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11201,7 +11201,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11210,7 +11210,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11219,15 +11219,15 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11236,7 +11236,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPLINEAR:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11245,11 +11245,11 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_LINEAR:
+            case Engine.TEXTURE_LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
                 break;
@@ -11828,368 +11828,12 @@ var BABYLON;
                 }
             }
         };
-        Object.defineProperty(Engine, "NEVER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
-            get: function () {
-                return Engine._NEVER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALWAYS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
-            get: function () {
-                return Engine._ALWAYS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LESS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
-            get: function () {
-                return Engine._LESS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "EQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
-            get: function () {
-                return Engine._EQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
-            get: function () {
-                return Engine._LEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GREATER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
-            get: function () {
-                return Engine._GREATER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
-            get: function () {
-                return Engine._GEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "NOTEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
-            get: function () {
-                return Engine._NOTEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "KEEP", {
-            /** Passed to stencilOperation to specify that stencil value must be kept */
-            get: function () {
-                return Engine._KEEP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "REPLACE", {
-            /** Passed to stencilOperation to specify that stencil value must be replaced */
-            get: function () {
-                return Engine._REPLACE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented */
-            get: function () {
-                return Engine._INCR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented */
-            get: function () {
-                return Engine._DECR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INVERT", {
-            /** Passed to stencilOperation to specify that stencil value must be inverted */
-            get: function () {
-                return Engine._INVERT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
-            get: function () {
-                return Engine._INCR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
-            get: function () {
-                return Engine._DECR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_DISABLE", {
-            // Alpha
-            /** Defines that alpha blending is disabled */
-            get: function () {
-                return Engine._ALPHA_DISABLE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ONEONE", {
-            /** Defines that alpha blending to SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ONEONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ADD", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ADD;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_COMBINE", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_COMBINE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SUBTRACT", {
-            /** Defines that alpha blending to DEST - SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_SUBTRACT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MULTIPLY", {
-            /** Defines that alpha blending to SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_MULTIPLY;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MAXIMIZED", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
-            get: function () {
-                return Engine._ALPHA_MAXIMIZED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED", {
-            /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED_PORTERDUFF", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
-             * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED_PORTERDUFF;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_INTERPOLATE", {
-            /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
-            get: function () {
-                return Engine._ALPHA_INTERPOLATE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SCREENMODE", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC) * DEST
-             * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_SCREENMODE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NONE", {
-            // Delays
-            /** Defines that the ressource is not delayed*/
-            get: function () {
-                return Engine._DELAYLOADSTATE_NONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADED", {
-            /** Defines that the ressource was successfully delay loaded */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADING", {
-            /** Defines that the ressource is currently delay loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADING;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NOTLOADED", {
-            /** Defines that the ressource is delayed and has not started loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_NOTLOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_ALPHA", {
-            /** ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE", {
-            /** LUMINANCE */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
-            /**
-             * R
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_R;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
-            /**
-             * RG
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RG;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
-            /** LUMINANCE_ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB", {
-            /** RGB */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA", {
-            /** RGBA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_UNSIGNED_INT", {
-            /** UNSIGNED_INT */
-            get: function () {
-                return Engine._TEXTURETYPE_UNSIGNED_INT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_FLOAT", {
-            /** FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_HALF_FLOAT", {
-            /** HALF_FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_HALF_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_FLOOR", {
-            /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_FLOOR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_NEAREST", {
-            /** Defines that texture rescaling will look for the nearest power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_NEAREST;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_CEILING", {
-            /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_CEILING;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Engine, "Version", {
             /**
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-alpha.9";
+                return "3.3.0-alpha.10";
             },
             enumerable: true,
             configurable: true
@@ -12288,7 +11932,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture) {
-                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture;
             },
@@ -12301,7 +11945,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture3D) {
-                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture3D;
             },
@@ -12316,7 +11960,7 @@ var BABYLON;
                 if (!this._emptyCubeTexture) {
                     var faceData = new Uint8Array(4);
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyCubeTexture;
             },
@@ -14729,7 +14373,7 @@ var BABYLON;
          */
         Engine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
             if (buffer === void 0) { buffer = null; }
@@ -14907,12 +14551,12 @@ var BABYLON;
             }, {
                 generateMipMaps: false,
                 type: Engine.TEXTURETYPE_UNSIGNED_INT,
-                samplingMode: BABYLON.Texture.BILINEAR_SAMPLINGMODE,
+                samplingMode: Engine.TEXTURE_BILINEAR_SAMPLINGMODE,
                 generateDepthBuffer: false,
                 generateStencilBuffer: false
             });
             if (!this._rescalePostProcess) {
-                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
+                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, Engine.TEXTURE_BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
             }
             this._rescalePostProcess.getEffect().executeWhenCompiled(function () {
                 _this._rescalePostProcess.onApply = function (effect) {
@@ -15213,7 +14857,7 @@ var BABYLON;
             internalTexture.generateMipMaps = false;
             internalTexture._generateDepthBuffer = true;
             internalTexture._generateStencilBuffer = generateStencil;
-            internalTexture.samplingMode = bilinearFiltering ? BABYLON.Texture.BILINEAR_SAMPLINGMODE : BABYLON.Texture.NEAREST_SAMPLINGMODE;
+            internalTexture.samplingMode = bilinearFiltering ? Engine.TEXTURE_BILINEAR_SAMPLINGMODE : Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             internalTexture.type = Engine.TEXTURETYPE_UNSIGNED_INT;
             internalTexture._comparisonFunction = comparisonFunction;
             var gl = this._gl;
@@ -15358,7 +15002,7 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
                 fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
                 fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type;
-                fullOptions.samplingMode = options.samplingMode === undefined ? BABYLON.Texture.TRILINEAR_SAMPLINGMODE : options.samplingMode;
+                fullOptions.samplingMode = options.samplingMode === undefined ? Engine.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
                 fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format;
             }
             else {
@@ -15366,16 +15010,16 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = true;
                 fullOptions.generateStencilBuffer = false;
                 fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT;
-                fullOptions.samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
                 fullOptions.format = Engine.TEXTUREFORMAT_RGBA;
             }
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -15435,7 +15079,7 @@ var BABYLON;
             var generateDepthTexture = false;
             var textureCount = 1;
             var defaultType = Engine.TEXTURETYPE_UNSIGNED_INT;
-            var defaultSamplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+            var defaultSamplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
             var types = new Array();
             var samplingModes = new Array();
             if (options !== undefined) {
@@ -15465,11 +15109,11 @@ var BABYLON;
                 var type = types[i] || defaultType;
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                     // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                     // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {
@@ -15718,15 +15362,15 @@ var BABYLON;
          * @returns a new render target cube texture stored in an InternalTexture
          */
         Engine.prototype.createRenderTargetCubeTexture = function (size, options) {
-            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: BABYLON.Texture.TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
+            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
             fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -16191,7 +15835,7 @@ var BABYLON;
             var _this = this;
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (invertY === void 0) { invertY = false; }
             var gl = this._gl;
             var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode);
@@ -16356,7 +16000,7 @@ var BABYLON;
         };
         Engine.prototype._prepareWebGLTexture = function (texture, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             var maxTextureSize = this.getCaps().maxTextureSize;
             var potWidth = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(width, maxTextureSize) : width);
             var potHeight = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(height, maxTextureSize) : height);
@@ -16678,11 +16322,11 @@ var BABYLON;
         };
         Engine.prototype._getTextureWrapMode = function (mode) {
             switch (mode) {
-                case BABYLON.Texture.WRAP_ADDRESSMODE:
+                case Engine.TEXTURE_WRAP_ADDRESSMODE:
                     return this._gl.REPEAT;
-                case BABYLON.Texture.CLAMP_ADDRESSMODE:
+                case Engine.TEXTURE_CLAMP_ADDRESSMODE:
                     return this._gl.CLAMP_TO_EDGE;
-                case BABYLON.Texture.MIRROR_ADDRESSMODE:
+                case Engine.TEXTURE_MIRROR_ADDRESSMODE:
                     return this._gl.MIRRORED_REPEAT;
             }
             return this._gl.REPEAT;
@@ -16764,7 +16408,7 @@ var BABYLON;
                 if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                     internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                     // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
-                    var textureWrapMode = (texture.coordinatesMode !== BABYLON.Texture.CUBIC_MODE && texture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
+                    var textureWrapMode = (texture.coordinatesMode !== Engine.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Engine.TEXTURE_SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode, internalTexture);
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode);
                 }
@@ -16815,9 +16459,9 @@ var BABYLON;
             }
             var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;
             var value = texture.anisotropicFilteringLevel;
-            if (internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPNEAREST
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR) {
+            if (internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR) {
                 value = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear
             }
             if (anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== value) {
@@ -17670,52 +17314,157 @@ var BABYLON;
         /** Gets the list of created engines */
         Engine.Instances = new Array();
         // Const statics
-        Engine._ALPHA_DISABLE = 0;
-        Engine._ALPHA_ADD = 1;
-        Engine._ALPHA_COMBINE = 2;
-        Engine._ALPHA_SUBTRACT = 3;
-        Engine._ALPHA_MULTIPLY = 4;
-        Engine._ALPHA_MAXIMIZED = 5;
-        Engine._ALPHA_ONEONE = 6;
-        Engine._ALPHA_PREMULTIPLIED = 7;
-        Engine._ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
-        Engine._ALPHA_INTERPOLATE = 9;
-        Engine._ALPHA_SCREENMODE = 10;
-        Engine._DELAYLOADSTATE_NONE = 0;
-        Engine._DELAYLOADSTATE_LOADED = 1;
-        Engine._DELAYLOADSTATE_LOADING = 2;
-        Engine._DELAYLOADSTATE_NOTLOADED = 4;
-        Engine._TEXTUREFORMAT_ALPHA = 0;
-        Engine._TEXTUREFORMAT_LUMINANCE = 1;
-        Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
-        Engine._TEXTUREFORMAT_RGB = 4;
-        Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R = 6;
-        Engine._TEXTUREFORMAT_RG = 7;
-        Engine._TEXTURETYPE_UNSIGNED_INT = 0;
-        Engine._TEXTURETYPE_FLOAT = 1;
-        Engine._TEXTURETYPE_HALF_FLOAT = 2;
+        /** Defines that alpha blending is disabled */
+        Engine.ALPHA_DISABLE = 0;
+        /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
+        Engine.ALPHA_ADD = 1;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_COMBINE = 2;
+        /** Defines that alpha blending to DEST - SRC * DEST */
+        Engine.ALPHA_SUBTRACT = 3;
+        /** Defines that alpha blending to SRC * DEST */
+        Engine.ALPHA_MULTIPLY = 4;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
+        Engine.ALPHA_MAXIMIZED = 5;
+        /** Defines that alpha blending to SRC + DEST */
+        Engine.ALPHA_ONEONE = 6;
+        /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_PREMULTIPLIED = 7;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
+         * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
+        /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
+        Engine.ALPHA_INTERPOLATE = 9;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC) * DEST
+         * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_SCREENMODE = 10;
+        /** Defines that the ressource is not delayed*/
+        Engine.DELAYLOADSTATE_NONE = 0;
+        /** Defines that the ressource was successfully delay loaded */
+        Engine.DELAYLOADSTATE_LOADED = 1;
+        /** Defines that the ressource is currently delay loading */
+        Engine.DELAYLOADSTATE_LOADING = 2;
+        /** Defines that the ressource is delayed and has not started loading */
+        Engine.DELAYLOADSTATE_NOTLOADED = 4;
         // Depht or Stencil test Constants.
-        Engine._NEVER = 0x0200; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
-        Engine._ALWAYS = 0x0207; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
-        Engine._LESS = 0x0201; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
-        Engine._EQUAL = 0x0202; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
-        Engine._LEQUAL = 0x0203; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
-        Engine._GREATER = 0x0204; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
-        Engine._GEQUAL = 0x0206; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
-        Engine._NOTEQUAL = 0x0205; //  Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
+        Engine.NEVER = 0x0200;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
+        Engine.ALWAYS = 0x0207;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
+        Engine.LESS = 0x0201;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
+        Engine.EQUAL = 0x0202;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
+        Engine.LEQUAL = 0x0203;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
+        Engine.GREATER = 0x0204;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
+        Engine.GEQUAL = 0x0206;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
+        Engine.NOTEQUAL = 0x0205;
         // Stencil Actions Constants.
-        Engine._KEEP = 0x1E00;
-        Engine._REPLACE = 0x1E01;
-        Engine._INCR = 0x1E02;
-        Engine._DECR = 0x1E03;
-        Engine._INVERT = 0x150A;
-        Engine._INCR_WRAP = 0x8507;
-        Engine._DECR_WRAP = 0x8508;
+        /** Passed to stencilOperation to specify that stencil value must be kept */
+        Engine.KEEP = 0x1E00;
+        /** Passed to stencilOperation to specify that stencil value must be replaced */
+        Engine.REPLACE = 0x1E01;
+        /** Passed to stencilOperation to specify that stencil value must be incremented */
+        Engine.INCR = 0x1E02;
+        /** Passed to stencilOperation to specify that stencil value must be decremented */
+        Engine.DECR = 0x1E03;
+        /** Passed to stencilOperation to specify that stencil value must be inverted */
+        Engine.INVERT = 0x150A;
+        /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
+        Engine.INCR_WRAP = 0x8507;
+        /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
+        Engine.DECR_WRAP = 0x8508;
+        /** Texture is not repeating outside of 0..1 UVs */
+        Engine.TEXTURE_CLAMP_ADDRESSMODE = 0;
+        /** Texture is repeating outside of 0..1 UVs */
+        Engine.TEXTURE_WRAP_ADDRESSMODE = 1;
+        /** Texture is repeating and mirrored */
+        Engine.TEXTURE_MIRROR_ADDRESSMODE = 2;
+        /** ALPHA */
+        Engine.TEXTUREFORMAT_ALPHA = 0;
+        /** LUMINANCE */
+        Engine.TEXTUREFORMAT_LUMINANCE = 1;
+        /** LUMINANCE_ALPHA */
+        Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
+        /** RGB */
+        Engine.TEXTUREFORMAT_RGB = 4;
+        /** RGBA */
+        Engine.TEXTUREFORMAT_RGBA = 5;
+        /** R */
+        Engine.TEXTUREFORMAT_R = 6;
+        /** RG */
+        Engine.TEXTUREFORMAT_RG = 7;
+        /** UNSIGNED_INT */
+        Engine.TEXTURETYPE_UNSIGNED_INT = 0;
+        /** FLOAT */
+        Engine.TEXTURETYPE_FLOAT = 1;
+        /** HALF_FLOAT */
+        Engine.TEXTURETYPE_HALF_FLOAT = 2;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
+        /** mag = nearest and min = nearest and mip = nearest */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
+        /** mag = nearest and min = linear and mip = nearest */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
+        /** mag = nearest and min = linear and mip = linear */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
+        /** mag = nearest and min = linear and mip = none */
+        Engine.TEXTURE_NEAREST_LINEAR = 7;
+        /** mag = nearest and min = nearest and mip = none */
+        Engine.TEXTURE_NEAREST_NEAREST = 8;
+        /** mag = linear and min = nearest and mip = nearest */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
+        /** mag = linear and min = nearest and mip = linear */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
+        /** mag = linear and min = linear and mip = none */
+        Engine.TEXTURE_LINEAR_LINEAR = 11;
+        /** mag = linear and min = nearest and mip = none */
+        Engine.TEXTURE_LINEAR_NEAREST = 12;
+        /** Explicit coordinates mode */
+        Engine.TEXTURE_EXPLICIT_MODE = 0;
+        /** Spherical coordinates mode */
+        Engine.TEXTURE_SPHERICAL_MODE = 1;
+        /** Planar coordinates mode */
+        Engine.TEXTURE_PLANAR_MODE = 2;
+        /** Cubic coordinates mode */
+        Engine.TEXTURE_CUBIC_MODE = 3;
+        /** Projection coordinates mode */
+        Engine.TEXTURE_PROJECTION_MODE = 4;
+        /** Skybox coordinates mode */
+        Engine.TEXTURE_SKYBOX_MODE = 5;
+        /** Inverse Cubic coordinates mode */
+        Engine.TEXTURE_INVCUBIC_MODE = 6;
+        /** Equirectangular coordinates mode */
+        Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7;
+        /** Equirectangular Fixed coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
+        /** Equirectangular Fixed Mirrored coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
         // Texture rescaling mode
-        Engine._SCALEMODE_FLOOR = 1;
-        Engine._SCALEMODE_NEAREST = 2;
-        Engine._SCALEMODE_CEILING = 3;
+        /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
+        Engine.SCALEMODE_FLOOR = 1;
+        /** Defines that texture rescaling will look for the nearest power of 2 size */
+        Engine.SCALEMODE_NEAREST = 2;
+        /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
+        Engine.SCALEMODE_CEILING = 3;
         // Updatable statics so stick with vars here
         /**
          * Gets or sets the epsilon value used by collision engine
@@ -31446,34 +31195,34 @@ var BABYLON;
             return new Texture(name, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format);
         };
         // Constants
-        Texture.NEAREST_SAMPLINGMODE = 1;
-        Texture.NEAREST_NEAREST_MIPLINEAR = 1; // nearest is mag = nearest and min = nearest and mip = linear
-        Texture.BILINEAR_SAMPLINGMODE = 2;
-        Texture.LINEAR_LINEAR_MIPNEAREST = 2; // Bilinear is mag = linear and min = linear and mip = nearest
-        Texture.TRILINEAR_SAMPLINGMODE = 3;
-        Texture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
-        Texture.NEAREST_NEAREST_MIPNEAREST = 4;
-        Texture.NEAREST_LINEAR_MIPNEAREST = 5;
-        Texture.NEAREST_LINEAR_MIPLINEAR = 6;
-        Texture.NEAREST_LINEAR = 7;
-        Texture.NEAREST_NEAREST = 8;
-        Texture.LINEAR_NEAREST_MIPNEAREST = 9;
-        Texture.LINEAR_NEAREST_MIPLINEAR = 10;
-        Texture.LINEAR_LINEAR = 11;
-        Texture.LINEAR_NEAREST = 12;
-        Texture.EXPLICIT_MODE = 0;
-        Texture.SPHERICAL_MODE = 1;
-        Texture.PLANAR_MODE = 2;
-        Texture.CUBIC_MODE = 3;
-        Texture.PROJECTION_MODE = 4;
-        Texture.SKYBOX_MODE = 5;
-        Texture.INVCUBIC_MODE = 6;
-        Texture.EQUIRECTANGULAR_MODE = 7;
-        Texture.FIXED_EQUIRECTANGULAR_MODE = 8;
-        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
-        Texture.CLAMP_ADDRESSMODE = 0;
-        Texture.WRAP_ADDRESSMODE = 1;
-        Texture.MIRROR_ADDRESSMODE = 2;
+        Texture.NEAREST_SAMPLINGMODE = BABYLON.Engine.TEXTURE_NEAREST_SAMPLINGMODE;
+        Texture.NEAREST_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear
+        Texture.BILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_BILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest
+        Texture.TRILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear
+        Texture.NEAREST_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
+        Texture.NEAREST_LINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR;
+        Texture.NEAREST_NEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST;
+        Texture.LINEAR_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
+        Texture.LINEAR_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+        Texture.LINEAR_LINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR;
+        Texture.LINEAR_NEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST;
+        Texture.EXPLICIT_MODE = BABYLON.Engine.TEXTURE_EXPLICIT_MODE;
+        Texture.SPHERICAL_MODE = BABYLON.Engine.TEXTURE_SPHERICAL_MODE;
+        Texture.PLANAR_MODE = BABYLON.Engine.TEXTURE_PLANAR_MODE;
+        Texture.CUBIC_MODE = BABYLON.Engine.TEXTURE_CUBIC_MODE;
+        Texture.PROJECTION_MODE = BABYLON.Engine.TEXTURE_PROJECTION_MODE;
+        Texture.SKYBOX_MODE = BABYLON.Engine.TEXTURE_SKYBOX_MODE;
+        Texture.INVCUBIC_MODE = BABYLON.Engine.TEXTURE_INVCUBIC_MODE;
+        Texture.EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
+        Texture.CLAMP_ADDRESSMODE = BABYLON.Engine.TEXTURE_CLAMP_ADDRESSMODE;
+        Texture.WRAP_ADDRESSMODE = BABYLON.Engine.TEXTURE_WRAP_ADDRESSMODE;
+        Texture.MIRROR_ADDRESSMODE = BABYLON.Engine.TEXTURE_MIRROR_ADDRESSMODE;
         /**
          * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
          */
@@ -101522,6 +101271,14 @@ var BABYLON;
         NullEngine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format) {
             if (premulAlpha === void 0) { premulAlpha = false; }
         };
+        /**
+         * Get the current error code of the webGL context
+         * @returns the error code
+         * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
+         */
+        NullEngine.prototype.getError = function () {
+            return 0;
+        };
         NullEngine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset) {
             if (offset === void 0) { offset = 0; }
         };

+ 223 - 466
dist/preview release/babylon.no-module.max.js

@@ -11132,7 +11132,7 @@ var BABYLON;
         var magFilter = gl.NEAREST;
         var minFilter = gl.NEAREST;
         switch (samplingMode) {
-            case BABYLON.Texture.BILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11141,7 +11141,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.TRILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_TRILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11150,7 +11150,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_SAMPLINGMODE:
+            case Engine.TEXTURE_NEAREST_SAMPLINGMODE:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11159,7 +11159,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11168,7 +11168,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11177,7 +11177,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11186,15 +11186,15 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11203,7 +11203,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPLINEAR:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11212,11 +11212,11 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_LINEAR:
+            case Engine.TEXTURE_LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
                 break;
@@ -11795,368 +11795,12 @@ var BABYLON;
                 }
             }
         };
-        Object.defineProperty(Engine, "NEVER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
-            get: function () {
-                return Engine._NEVER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALWAYS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
-            get: function () {
-                return Engine._ALWAYS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LESS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
-            get: function () {
-                return Engine._LESS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "EQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
-            get: function () {
-                return Engine._EQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
-            get: function () {
-                return Engine._LEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GREATER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
-            get: function () {
-                return Engine._GREATER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
-            get: function () {
-                return Engine._GEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "NOTEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
-            get: function () {
-                return Engine._NOTEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "KEEP", {
-            /** Passed to stencilOperation to specify that stencil value must be kept */
-            get: function () {
-                return Engine._KEEP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "REPLACE", {
-            /** Passed to stencilOperation to specify that stencil value must be replaced */
-            get: function () {
-                return Engine._REPLACE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented */
-            get: function () {
-                return Engine._INCR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented */
-            get: function () {
-                return Engine._DECR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INVERT", {
-            /** Passed to stencilOperation to specify that stencil value must be inverted */
-            get: function () {
-                return Engine._INVERT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
-            get: function () {
-                return Engine._INCR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
-            get: function () {
-                return Engine._DECR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_DISABLE", {
-            // Alpha
-            /** Defines that alpha blending is disabled */
-            get: function () {
-                return Engine._ALPHA_DISABLE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ONEONE", {
-            /** Defines that alpha blending to SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ONEONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ADD", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ADD;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_COMBINE", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_COMBINE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SUBTRACT", {
-            /** Defines that alpha blending to DEST - SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_SUBTRACT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MULTIPLY", {
-            /** Defines that alpha blending to SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_MULTIPLY;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MAXIMIZED", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
-            get: function () {
-                return Engine._ALPHA_MAXIMIZED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED", {
-            /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED_PORTERDUFF", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
-             * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED_PORTERDUFF;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_INTERPOLATE", {
-            /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
-            get: function () {
-                return Engine._ALPHA_INTERPOLATE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SCREENMODE", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC) * DEST
-             * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_SCREENMODE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NONE", {
-            // Delays
-            /** Defines that the ressource is not delayed*/
-            get: function () {
-                return Engine._DELAYLOADSTATE_NONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADED", {
-            /** Defines that the ressource was successfully delay loaded */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADING", {
-            /** Defines that the ressource is currently delay loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADING;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NOTLOADED", {
-            /** Defines that the ressource is delayed and has not started loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_NOTLOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_ALPHA", {
-            /** ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE", {
-            /** LUMINANCE */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
-            /**
-             * R
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_R;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
-            /**
-             * RG
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RG;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
-            /** LUMINANCE_ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB", {
-            /** RGB */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA", {
-            /** RGBA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_UNSIGNED_INT", {
-            /** UNSIGNED_INT */
-            get: function () {
-                return Engine._TEXTURETYPE_UNSIGNED_INT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_FLOAT", {
-            /** FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_HALF_FLOAT", {
-            /** HALF_FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_HALF_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_FLOOR", {
-            /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_FLOOR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_NEAREST", {
-            /** Defines that texture rescaling will look for the nearest power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_NEAREST;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_CEILING", {
-            /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_CEILING;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Engine, "Version", {
             /**
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-alpha.9";
+                return "3.3.0-alpha.10";
             },
             enumerable: true,
             configurable: true
@@ -12255,7 +11899,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture) {
-                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture;
             },
@@ -12268,7 +11912,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture3D) {
-                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture3D;
             },
@@ -12283,7 +11927,7 @@ var BABYLON;
                 if (!this._emptyCubeTexture) {
                     var faceData = new Uint8Array(4);
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyCubeTexture;
             },
@@ -14696,7 +14340,7 @@ var BABYLON;
          */
         Engine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
             if (buffer === void 0) { buffer = null; }
@@ -14874,12 +14518,12 @@ var BABYLON;
             }, {
                 generateMipMaps: false,
                 type: Engine.TEXTURETYPE_UNSIGNED_INT,
-                samplingMode: BABYLON.Texture.BILINEAR_SAMPLINGMODE,
+                samplingMode: Engine.TEXTURE_BILINEAR_SAMPLINGMODE,
                 generateDepthBuffer: false,
                 generateStencilBuffer: false
             });
             if (!this._rescalePostProcess) {
-                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
+                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, Engine.TEXTURE_BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
             }
             this._rescalePostProcess.getEffect().executeWhenCompiled(function () {
                 _this._rescalePostProcess.onApply = function (effect) {
@@ -15180,7 +14824,7 @@ var BABYLON;
             internalTexture.generateMipMaps = false;
             internalTexture._generateDepthBuffer = true;
             internalTexture._generateStencilBuffer = generateStencil;
-            internalTexture.samplingMode = bilinearFiltering ? BABYLON.Texture.BILINEAR_SAMPLINGMODE : BABYLON.Texture.NEAREST_SAMPLINGMODE;
+            internalTexture.samplingMode = bilinearFiltering ? Engine.TEXTURE_BILINEAR_SAMPLINGMODE : Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             internalTexture.type = Engine.TEXTURETYPE_UNSIGNED_INT;
             internalTexture._comparisonFunction = comparisonFunction;
             var gl = this._gl;
@@ -15325,7 +14969,7 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
                 fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
                 fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type;
-                fullOptions.samplingMode = options.samplingMode === undefined ? BABYLON.Texture.TRILINEAR_SAMPLINGMODE : options.samplingMode;
+                fullOptions.samplingMode = options.samplingMode === undefined ? Engine.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
                 fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format;
             }
             else {
@@ -15333,16 +14977,16 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = true;
                 fullOptions.generateStencilBuffer = false;
                 fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT;
-                fullOptions.samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
                 fullOptions.format = Engine.TEXTUREFORMAT_RGBA;
             }
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -15402,7 +15046,7 @@ var BABYLON;
             var generateDepthTexture = false;
             var textureCount = 1;
             var defaultType = Engine.TEXTURETYPE_UNSIGNED_INT;
-            var defaultSamplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+            var defaultSamplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
             var types = new Array();
             var samplingModes = new Array();
             if (options !== undefined) {
@@ -15432,11 +15076,11 @@ var BABYLON;
                 var type = types[i] || defaultType;
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                     // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                     // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {
@@ -15685,15 +15329,15 @@ var BABYLON;
          * @returns a new render target cube texture stored in an InternalTexture
          */
         Engine.prototype.createRenderTargetCubeTexture = function (size, options) {
-            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: BABYLON.Texture.TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
+            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
             fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -16158,7 +15802,7 @@ var BABYLON;
             var _this = this;
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (invertY === void 0) { invertY = false; }
             var gl = this._gl;
             var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode);
@@ -16323,7 +15967,7 @@ var BABYLON;
         };
         Engine.prototype._prepareWebGLTexture = function (texture, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             var maxTextureSize = this.getCaps().maxTextureSize;
             var potWidth = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(width, maxTextureSize) : width);
             var potHeight = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(height, maxTextureSize) : height);
@@ -16645,11 +16289,11 @@ var BABYLON;
         };
         Engine.prototype._getTextureWrapMode = function (mode) {
             switch (mode) {
-                case BABYLON.Texture.WRAP_ADDRESSMODE:
+                case Engine.TEXTURE_WRAP_ADDRESSMODE:
                     return this._gl.REPEAT;
-                case BABYLON.Texture.CLAMP_ADDRESSMODE:
+                case Engine.TEXTURE_CLAMP_ADDRESSMODE:
                     return this._gl.CLAMP_TO_EDGE;
-                case BABYLON.Texture.MIRROR_ADDRESSMODE:
+                case Engine.TEXTURE_MIRROR_ADDRESSMODE:
                     return this._gl.MIRRORED_REPEAT;
             }
             return this._gl.REPEAT;
@@ -16731,7 +16375,7 @@ var BABYLON;
                 if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                     internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                     // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
-                    var textureWrapMode = (texture.coordinatesMode !== BABYLON.Texture.CUBIC_MODE && texture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
+                    var textureWrapMode = (texture.coordinatesMode !== Engine.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Engine.TEXTURE_SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode, internalTexture);
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode);
                 }
@@ -16782,9 +16426,9 @@ var BABYLON;
             }
             var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;
             var value = texture.anisotropicFilteringLevel;
-            if (internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPNEAREST
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR) {
+            if (internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR) {
                 value = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear
             }
             if (anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== value) {
@@ -17637,52 +17281,157 @@ var BABYLON;
         /** Gets the list of created engines */
         Engine.Instances = new Array();
         // Const statics
-        Engine._ALPHA_DISABLE = 0;
-        Engine._ALPHA_ADD = 1;
-        Engine._ALPHA_COMBINE = 2;
-        Engine._ALPHA_SUBTRACT = 3;
-        Engine._ALPHA_MULTIPLY = 4;
-        Engine._ALPHA_MAXIMIZED = 5;
-        Engine._ALPHA_ONEONE = 6;
-        Engine._ALPHA_PREMULTIPLIED = 7;
-        Engine._ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
-        Engine._ALPHA_INTERPOLATE = 9;
-        Engine._ALPHA_SCREENMODE = 10;
-        Engine._DELAYLOADSTATE_NONE = 0;
-        Engine._DELAYLOADSTATE_LOADED = 1;
-        Engine._DELAYLOADSTATE_LOADING = 2;
-        Engine._DELAYLOADSTATE_NOTLOADED = 4;
-        Engine._TEXTUREFORMAT_ALPHA = 0;
-        Engine._TEXTUREFORMAT_LUMINANCE = 1;
-        Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
-        Engine._TEXTUREFORMAT_RGB = 4;
-        Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R = 6;
-        Engine._TEXTUREFORMAT_RG = 7;
-        Engine._TEXTURETYPE_UNSIGNED_INT = 0;
-        Engine._TEXTURETYPE_FLOAT = 1;
-        Engine._TEXTURETYPE_HALF_FLOAT = 2;
+        /** Defines that alpha blending is disabled */
+        Engine.ALPHA_DISABLE = 0;
+        /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
+        Engine.ALPHA_ADD = 1;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_COMBINE = 2;
+        /** Defines that alpha blending to DEST - SRC * DEST */
+        Engine.ALPHA_SUBTRACT = 3;
+        /** Defines that alpha blending to SRC * DEST */
+        Engine.ALPHA_MULTIPLY = 4;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
+        Engine.ALPHA_MAXIMIZED = 5;
+        /** Defines that alpha blending to SRC + DEST */
+        Engine.ALPHA_ONEONE = 6;
+        /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_PREMULTIPLIED = 7;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
+         * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
+        /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
+        Engine.ALPHA_INTERPOLATE = 9;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC) * DEST
+         * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_SCREENMODE = 10;
+        /** Defines that the ressource is not delayed*/
+        Engine.DELAYLOADSTATE_NONE = 0;
+        /** Defines that the ressource was successfully delay loaded */
+        Engine.DELAYLOADSTATE_LOADED = 1;
+        /** Defines that the ressource is currently delay loading */
+        Engine.DELAYLOADSTATE_LOADING = 2;
+        /** Defines that the ressource is delayed and has not started loading */
+        Engine.DELAYLOADSTATE_NOTLOADED = 4;
         // Depht or Stencil test Constants.
-        Engine._NEVER = 0x0200; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
-        Engine._ALWAYS = 0x0207; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
-        Engine._LESS = 0x0201; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
-        Engine._EQUAL = 0x0202; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
-        Engine._LEQUAL = 0x0203; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
-        Engine._GREATER = 0x0204; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
-        Engine._GEQUAL = 0x0206; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
-        Engine._NOTEQUAL = 0x0205; //  Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
+        Engine.NEVER = 0x0200;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
+        Engine.ALWAYS = 0x0207;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
+        Engine.LESS = 0x0201;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
+        Engine.EQUAL = 0x0202;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
+        Engine.LEQUAL = 0x0203;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
+        Engine.GREATER = 0x0204;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
+        Engine.GEQUAL = 0x0206;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
+        Engine.NOTEQUAL = 0x0205;
         // Stencil Actions Constants.
-        Engine._KEEP = 0x1E00;
-        Engine._REPLACE = 0x1E01;
-        Engine._INCR = 0x1E02;
-        Engine._DECR = 0x1E03;
-        Engine._INVERT = 0x150A;
-        Engine._INCR_WRAP = 0x8507;
-        Engine._DECR_WRAP = 0x8508;
+        /** Passed to stencilOperation to specify that stencil value must be kept */
+        Engine.KEEP = 0x1E00;
+        /** Passed to stencilOperation to specify that stencil value must be replaced */
+        Engine.REPLACE = 0x1E01;
+        /** Passed to stencilOperation to specify that stencil value must be incremented */
+        Engine.INCR = 0x1E02;
+        /** Passed to stencilOperation to specify that stencil value must be decremented */
+        Engine.DECR = 0x1E03;
+        /** Passed to stencilOperation to specify that stencil value must be inverted */
+        Engine.INVERT = 0x150A;
+        /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
+        Engine.INCR_WRAP = 0x8507;
+        /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
+        Engine.DECR_WRAP = 0x8508;
+        /** Texture is not repeating outside of 0..1 UVs */
+        Engine.TEXTURE_CLAMP_ADDRESSMODE = 0;
+        /** Texture is repeating outside of 0..1 UVs */
+        Engine.TEXTURE_WRAP_ADDRESSMODE = 1;
+        /** Texture is repeating and mirrored */
+        Engine.TEXTURE_MIRROR_ADDRESSMODE = 2;
+        /** ALPHA */
+        Engine.TEXTUREFORMAT_ALPHA = 0;
+        /** LUMINANCE */
+        Engine.TEXTUREFORMAT_LUMINANCE = 1;
+        /** LUMINANCE_ALPHA */
+        Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
+        /** RGB */
+        Engine.TEXTUREFORMAT_RGB = 4;
+        /** RGBA */
+        Engine.TEXTUREFORMAT_RGBA = 5;
+        /** R */
+        Engine.TEXTUREFORMAT_R = 6;
+        /** RG */
+        Engine.TEXTUREFORMAT_RG = 7;
+        /** UNSIGNED_INT */
+        Engine.TEXTURETYPE_UNSIGNED_INT = 0;
+        /** FLOAT */
+        Engine.TEXTURETYPE_FLOAT = 1;
+        /** HALF_FLOAT */
+        Engine.TEXTURETYPE_HALF_FLOAT = 2;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
+        /** mag = nearest and min = nearest and mip = nearest */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
+        /** mag = nearest and min = linear and mip = nearest */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
+        /** mag = nearest and min = linear and mip = linear */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
+        /** mag = nearest and min = linear and mip = none */
+        Engine.TEXTURE_NEAREST_LINEAR = 7;
+        /** mag = nearest and min = nearest and mip = none */
+        Engine.TEXTURE_NEAREST_NEAREST = 8;
+        /** mag = linear and min = nearest and mip = nearest */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
+        /** mag = linear and min = nearest and mip = linear */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
+        /** mag = linear and min = linear and mip = none */
+        Engine.TEXTURE_LINEAR_LINEAR = 11;
+        /** mag = linear and min = nearest and mip = none */
+        Engine.TEXTURE_LINEAR_NEAREST = 12;
+        /** Explicit coordinates mode */
+        Engine.TEXTURE_EXPLICIT_MODE = 0;
+        /** Spherical coordinates mode */
+        Engine.TEXTURE_SPHERICAL_MODE = 1;
+        /** Planar coordinates mode */
+        Engine.TEXTURE_PLANAR_MODE = 2;
+        /** Cubic coordinates mode */
+        Engine.TEXTURE_CUBIC_MODE = 3;
+        /** Projection coordinates mode */
+        Engine.TEXTURE_PROJECTION_MODE = 4;
+        /** Skybox coordinates mode */
+        Engine.TEXTURE_SKYBOX_MODE = 5;
+        /** Inverse Cubic coordinates mode */
+        Engine.TEXTURE_INVCUBIC_MODE = 6;
+        /** Equirectangular coordinates mode */
+        Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7;
+        /** Equirectangular Fixed coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
+        /** Equirectangular Fixed Mirrored coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
         // Texture rescaling mode
-        Engine._SCALEMODE_FLOOR = 1;
-        Engine._SCALEMODE_NEAREST = 2;
-        Engine._SCALEMODE_CEILING = 3;
+        /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
+        Engine.SCALEMODE_FLOOR = 1;
+        /** Defines that texture rescaling will look for the nearest power of 2 size */
+        Engine.SCALEMODE_NEAREST = 2;
+        /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
+        Engine.SCALEMODE_CEILING = 3;
         // Updatable statics so stick with vars here
         /**
          * Gets or sets the epsilon value used by collision engine
@@ -31413,34 +31162,34 @@ var BABYLON;
             return new Texture(name, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format);
         };
         // Constants
-        Texture.NEAREST_SAMPLINGMODE = 1;
-        Texture.NEAREST_NEAREST_MIPLINEAR = 1; // nearest is mag = nearest and min = nearest and mip = linear
-        Texture.BILINEAR_SAMPLINGMODE = 2;
-        Texture.LINEAR_LINEAR_MIPNEAREST = 2; // Bilinear is mag = linear and min = linear and mip = nearest
-        Texture.TRILINEAR_SAMPLINGMODE = 3;
-        Texture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
-        Texture.NEAREST_NEAREST_MIPNEAREST = 4;
-        Texture.NEAREST_LINEAR_MIPNEAREST = 5;
-        Texture.NEAREST_LINEAR_MIPLINEAR = 6;
-        Texture.NEAREST_LINEAR = 7;
-        Texture.NEAREST_NEAREST = 8;
-        Texture.LINEAR_NEAREST_MIPNEAREST = 9;
-        Texture.LINEAR_NEAREST_MIPLINEAR = 10;
-        Texture.LINEAR_LINEAR = 11;
-        Texture.LINEAR_NEAREST = 12;
-        Texture.EXPLICIT_MODE = 0;
-        Texture.SPHERICAL_MODE = 1;
-        Texture.PLANAR_MODE = 2;
-        Texture.CUBIC_MODE = 3;
-        Texture.PROJECTION_MODE = 4;
-        Texture.SKYBOX_MODE = 5;
-        Texture.INVCUBIC_MODE = 6;
-        Texture.EQUIRECTANGULAR_MODE = 7;
-        Texture.FIXED_EQUIRECTANGULAR_MODE = 8;
-        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
-        Texture.CLAMP_ADDRESSMODE = 0;
-        Texture.WRAP_ADDRESSMODE = 1;
-        Texture.MIRROR_ADDRESSMODE = 2;
+        Texture.NEAREST_SAMPLINGMODE = BABYLON.Engine.TEXTURE_NEAREST_SAMPLINGMODE;
+        Texture.NEAREST_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear
+        Texture.BILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_BILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest
+        Texture.TRILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear
+        Texture.NEAREST_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
+        Texture.NEAREST_LINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR;
+        Texture.NEAREST_NEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST;
+        Texture.LINEAR_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
+        Texture.LINEAR_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+        Texture.LINEAR_LINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR;
+        Texture.LINEAR_NEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST;
+        Texture.EXPLICIT_MODE = BABYLON.Engine.TEXTURE_EXPLICIT_MODE;
+        Texture.SPHERICAL_MODE = BABYLON.Engine.TEXTURE_SPHERICAL_MODE;
+        Texture.PLANAR_MODE = BABYLON.Engine.TEXTURE_PLANAR_MODE;
+        Texture.CUBIC_MODE = BABYLON.Engine.TEXTURE_CUBIC_MODE;
+        Texture.PROJECTION_MODE = BABYLON.Engine.TEXTURE_PROJECTION_MODE;
+        Texture.SKYBOX_MODE = BABYLON.Engine.TEXTURE_SKYBOX_MODE;
+        Texture.INVCUBIC_MODE = BABYLON.Engine.TEXTURE_INVCUBIC_MODE;
+        Texture.EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
+        Texture.CLAMP_ADDRESSMODE = BABYLON.Engine.TEXTURE_CLAMP_ADDRESSMODE;
+        Texture.WRAP_ADDRESSMODE = BABYLON.Engine.TEXTURE_WRAP_ADDRESSMODE;
+        Texture.MIRROR_ADDRESSMODE = BABYLON.Engine.TEXTURE_MIRROR_ADDRESSMODE;
         /**
          * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
          */
@@ -101489,6 +101238,14 @@ var BABYLON;
         NullEngine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format) {
             if (premulAlpha === void 0) { premulAlpha = false; }
         };
+        /**
+         * Get the current error code of the webGL context
+         * @returns the error code
+         * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
+         */
+        NullEngine.prototype.getError = function () {
+            return 0;
+        };
         NullEngine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset) {
             if (offset === void 0) { offset = 0; }
         };

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 52 - 52
dist/preview release/babylon.worker.js


+ 223 - 466
dist/preview release/es6.js

@@ -11132,7 +11132,7 @@ var BABYLON;
         var magFilter = gl.NEAREST;
         var minFilter = gl.NEAREST;
         switch (samplingMode) {
-            case BABYLON.Texture.BILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11141,7 +11141,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.TRILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_TRILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11150,7 +11150,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_SAMPLINGMODE:
+            case Engine.TEXTURE_NEAREST_SAMPLINGMODE:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11159,7 +11159,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11168,7 +11168,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -11177,7 +11177,7 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -11186,15 +11186,15 @@ var BABYLON;
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case BABYLON.Texture.NEAREST_LINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.NEAREST_NEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -11203,7 +11203,7 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST_MIPLINEAR:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -11212,11 +11212,11 @@ var BABYLON;
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case BABYLON.Texture.LINEAR_LINEAR:
+            case Engine.TEXTURE_LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
                 break;
-            case BABYLON.Texture.LINEAR_NEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
                 break;
@@ -11795,368 +11795,12 @@ var BABYLON;
                 }
             }
         };
-        Object.defineProperty(Engine, "NEVER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
-            get: function () {
-                return Engine._NEVER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALWAYS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
-            get: function () {
-                return Engine._ALWAYS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LESS", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
-            get: function () {
-                return Engine._LESS;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "EQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
-            get: function () {
-                return Engine._EQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "LEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
-            get: function () {
-                return Engine._LEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GREATER", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
-            get: function () {
-                return Engine._GREATER;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "GEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
-            get: function () {
-                return Engine._GEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "NOTEQUAL", {
-            /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
-            get: function () {
-                return Engine._NOTEQUAL;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "KEEP", {
-            /** Passed to stencilOperation to specify that stencil value must be kept */
-            get: function () {
-                return Engine._KEEP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "REPLACE", {
-            /** Passed to stencilOperation to specify that stencil value must be replaced */
-            get: function () {
-                return Engine._REPLACE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented */
-            get: function () {
-                return Engine._INCR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented */
-            get: function () {
-                return Engine._DECR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INVERT", {
-            /** Passed to stencilOperation to specify that stencil value must be inverted */
-            get: function () {
-                return Engine._INVERT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "INCR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
-            get: function () {
-                return Engine._INCR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DECR_WRAP", {
-            /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
-            get: function () {
-                return Engine._DECR_WRAP;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_DISABLE", {
-            // Alpha
-            /** Defines that alpha blending is disabled */
-            get: function () {
-                return Engine._ALPHA_DISABLE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ONEONE", {
-            /** Defines that alpha blending to SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ONEONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_ADD", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
-            get: function () {
-                return Engine._ALPHA_ADD;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_COMBINE", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_COMBINE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SUBTRACT", {
-            /** Defines that alpha blending to DEST - SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_SUBTRACT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MULTIPLY", {
-            /** Defines that alpha blending to SRC * DEST */
-            get: function () {
-                return Engine._ALPHA_MULTIPLY;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_MAXIMIZED", {
-            /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
-            get: function () {
-                return Engine._ALPHA_MAXIMIZED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED", {
-            /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_PREMULTIPLIED_PORTERDUFF", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
-             * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_PREMULTIPLIED_PORTERDUFF;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_INTERPOLATE", {
-            /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
-            get: function () {
-                return Engine._ALPHA_INTERPOLATE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "ALPHA_SCREENMODE", {
-            /**
-             * Defines that alpha blending to SRC + (1 - SRC) * DEST
-             * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
-             */
-            get: function () {
-                return Engine._ALPHA_SCREENMODE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NONE", {
-            // Delays
-            /** Defines that the ressource is not delayed*/
-            get: function () {
-                return Engine._DELAYLOADSTATE_NONE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADED", {
-            /** Defines that the ressource was successfully delay loaded */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_LOADING", {
-            /** Defines that the ressource is currently delay loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_LOADING;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "DELAYLOADSTATE_NOTLOADED", {
-            /** Defines that the ressource is delayed and has not started loading */
-            get: function () {
-                return Engine._DELAYLOADSTATE_NOTLOADED;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_ALPHA", {
-            /** ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE", {
-            /** LUMINANCE */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
-            /**
-             * R
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_R;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
-            /**
-             * RG
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RG;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
-            /** LUMINANCE_ALPHA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB", {
-            /** RGB */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA", {
-            /** RGBA */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_UNSIGNED_INT", {
-            /** UNSIGNED_INT */
-            get: function () {
-                return Engine._TEXTURETYPE_UNSIGNED_INT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_FLOAT", {
-            /** FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTURETYPE_HALF_FLOAT", {
-            /** HALF_FLOAT */
-            get: function () {
-                return Engine._TEXTURETYPE_HALF_FLOAT;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_FLOOR", {
-            /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_FLOOR;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_NEAREST", {
-            /** Defines that texture rescaling will look for the nearest power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_NEAREST;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "SCALEMODE_CEILING", {
-            /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
-            get: function () {
-                return Engine._SCALEMODE_CEILING;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Engine, "Version", {
             /**
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-alpha.9";
+                return "3.3.0-alpha.10";
             },
             enumerable: true,
             configurable: true
@@ -12255,7 +11899,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture) {
-                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture;
             },
@@ -12268,7 +11912,7 @@ var BABYLON;
              */
             get: function () {
                 if (!this._emptyTexture3D) {
-                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyTexture3D;
             },
@@ -12283,7 +11927,7 @@ var BABYLON;
                 if (!this._emptyCubeTexture) {
                     var faceData = new Uint8Array(4);
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
                 }
                 return this._emptyCubeTexture;
             },
@@ -14696,7 +14340,7 @@ var BABYLON;
          */
         Engine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
             if (buffer === void 0) { buffer = null; }
@@ -14874,12 +14518,12 @@ var BABYLON;
             }, {
                 generateMipMaps: false,
                 type: Engine.TEXTURETYPE_UNSIGNED_INT,
-                samplingMode: BABYLON.Texture.BILINEAR_SAMPLINGMODE,
+                samplingMode: Engine.TEXTURE_BILINEAR_SAMPLINGMODE,
                 generateDepthBuffer: false,
                 generateStencilBuffer: false
             });
             if (!this._rescalePostProcess) {
-                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
+                this._rescalePostProcess = new BABYLON.PassPostProcess("rescale", 1, null, Engine.TEXTURE_BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
             }
             this._rescalePostProcess.getEffect().executeWhenCompiled(function () {
                 _this._rescalePostProcess.onApply = function (effect) {
@@ -15180,7 +14824,7 @@ var BABYLON;
             internalTexture.generateMipMaps = false;
             internalTexture._generateDepthBuffer = true;
             internalTexture._generateStencilBuffer = generateStencil;
-            internalTexture.samplingMode = bilinearFiltering ? BABYLON.Texture.BILINEAR_SAMPLINGMODE : BABYLON.Texture.NEAREST_SAMPLINGMODE;
+            internalTexture.samplingMode = bilinearFiltering ? Engine.TEXTURE_BILINEAR_SAMPLINGMODE : Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             internalTexture.type = Engine.TEXTURETYPE_UNSIGNED_INT;
             internalTexture._comparisonFunction = comparisonFunction;
             var gl = this._gl;
@@ -15325,7 +14969,7 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
                 fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
                 fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type;
-                fullOptions.samplingMode = options.samplingMode === undefined ? BABYLON.Texture.TRILINEAR_SAMPLINGMODE : options.samplingMode;
+                fullOptions.samplingMode = options.samplingMode === undefined ? Engine.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
                 fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format;
             }
             else {
@@ -15333,16 +14977,16 @@ var BABYLON;
                 fullOptions.generateDepthBuffer = true;
                 fullOptions.generateStencilBuffer = false;
                 fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT;
-                fullOptions.samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
                 fullOptions.format = Engine.TEXTUREFORMAT_RGBA;
             }
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -15402,7 +15046,7 @@ var BABYLON;
             var generateDepthTexture = false;
             var textureCount = 1;
             var defaultType = Engine.TEXTURETYPE_UNSIGNED_INT;
-            var defaultSamplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE;
+            var defaultSamplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
             var types = new Array();
             var samplingModes = new Array();
             if (options !== undefined) {
@@ -15432,11 +15076,11 @@ var BABYLON;
                 var type = types[i] || defaultType;
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                     // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                     // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {
@@ -15685,15 +15329,15 @@ var BABYLON;
          * @returns a new render target cube texture stored in an InternalTexture
          */
         Engine.prototype.createRenderTargetCubeTexture = function (size, options) {
-            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: BABYLON.Texture.TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
+            var fullOptions = __assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, format: Engine.TEXTUREFORMAT_RGBA }, options);
             fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = BABYLON.Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RENDERTARGET);
@@ -16158,7 +15802,7 @@ var BABYLON;
             var _this = this;
             if (onLoad === void 0) { onLoad = null; }
             if (onError === void 0) { onError = null; }
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             if (invertY === void 0) { invertY = false; }
             var gl = this._gl;
             var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode);
@@ -16323,7 +15967,7 @@ var BABYLON;
         };
         Engine.prototype._prepareWebGLTexture = function (texture, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) {
             var _this = this;
-            if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (samplingMode === void 0) { samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE; }
             var maxTextureSize = this.getCaps().maxTextureSize;
             var potWidth = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(width, maxTextureSize) : width);
             var potHeight = Math.min(maxTextureSize, this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(height, maxTextureSize) : height);
@@ -16645,11 +16289,11 @@ var BABYLON;
         };
         Engine.prototype._getTextureWrapMode = function (mode) {
             switch (mode) {
-                case BABYLON.Texture.WRAP_ADDRESSMODE:
+                case Engine.TEXTURE_WRAP_ADDRESSMODE:
                     return this._gl.REPEAT;
-                case BABYLON.Texture.CLAMP_ADDRESSMODE:
+                case Engine.TEXTURE_CLAMP_ADDRESSMODE:
                     return this._gl.CLAMP_TO_EDGE;
-                case BABYLON.Texture.MIRROR_ADDRESSMODE:
+                case Engine.TEXTURE_MIRROR_ADDRESSMODE:
                     return this._gl.MIRRORED_REPEAT;
             }
             return this._gl.REPEAT;
@@ -16731,7 +16375,7 @@ var BABYLON;
                 if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                     internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                     // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
-                    var textureWrapMode = (texture.coordinatesMode !== BABYLON.Texture.CUBIC_MODE && texture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
+                    var textureWrapMode = (texture.coordinatesMode !== Engine.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Engine.TEXTURE_SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode, internalTexture);
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode);
                 }
@@ -16782,9 +16426,9 @@ var BABYLON;
             }
             var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;
             var value = texture.anisotropicFilteringLevel;
-            if (internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPNEAREST
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR
-                && internalTexture.samplingMode !== BABYLON.Texture.LINEAR_LINEAR) {
+            if (internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR) {
                 value = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear
             }
             if (anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== value) {
@@ -17637,52 +17281,157 @@ var BABYLON;
         /** Gets the list of created engines */
         Engine.Instances = new Array();
         // Const statics
-        Engine._ALPHA_DISABLE = 0;
-        Engine._ALPHA_ADD = 1;
-        Engine._ALPHA_COMBINE = 2;
-        Engine._ALPHA_SUBTRACT = 3;
-        Engine._ALPHA_MULTIPLY = 4;
-        Engine._ALPHA_MAXIMIZED = 5;
-        Engine._ALPHA_ONEONE = 6;
-        Engine._ALPHA_PREMULTIPLIED = 7;
-        Engine._ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
-        Engine._ALPHA_INTERPOLATE = 9;
-        Engine._ALPHA_SCREENMODE = 10;
-        Engine._DELAYLOADSTATE_NONE = 0;
-        Engine._DELAYLOADSTATE_LOADED = 1;
-        Engine._DELAYLOADSTATE_LOADING = 2;
-        Engine._DELAYLOADSTATE_NOTLOADED = 4;
-        Engine._TEXTUREFORMAT_ALPHA = 0;
-        Engine._TEXTUREFORMAT_LUMINANCE = 1;
-        Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
-        Engine._TEXTUREFORMAT_RGB = 4;
-        Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R = 6;
-        Engine._TEXTUREFORMAT_RG = 7;
-        Engine._TEXTURETYPE_UNSIGNED_INT = 0;
-        Engine._TEXTURETYPE_FLOAT = 1;
-        Engine._TEXTURETYPE_HALF_FLOAT = 2;
+        /** Defines that alpha blending is disabled */
+        Engine.ALPHA_DISABLE = 0;
+        /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
+        Engine.ALPHA_ADD = 1;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_COMBINE = 2;
+        /** Defines that alpha blending to DEST - SRC * DEST */
+        Engine.ALPHA_SUBTRACT = 3;
+        /** Defines that alpha blending to SRC * DEST */
+        Engine.ALPHA_MULTIPLY = 4;
+        /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
+        Engine.ALPHA_MAXIMIZED = 5;
+        /** Defines that alpha blending to SRC + DEST */
+        Engine.ALPHA_ONEONE = 6;
+        /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
+        Engine.ALPHA_PREMULTIPLIED = 7;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
+         * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
+        /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
+        Engine.ALPHA_INTERPOLATE = 9;
+        /**
+         * Defines that alpha blending to SRC + (1 - SRC) * DEST
+         * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
+         */
+        Engine.ALPHA_SCREENMODE = 10;
+        /** Defines that the ressource is not delayed*/
+        Engine.DELAYLOADSTATE_NONE = 0;
+        /** Defines that the ressource was successfully delay loaded */
+        Engine.DELAYLOADSTATE_LOADED = 1;
+        /** Defines that the ressource is currently delay loading */
+        Engine.DELAYLOADSTATE_LOADING = 2;
+        /** Defines that the ressource is delayed and has not started loading */
+        Engine.DELAYLOADSTATE_NOTLOADED = 4;
         // Depht or Stencil test Constants.
-        Engine._NEVER = 0x0200; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
-        Engine._ALWAYS = 0x0207; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
-        Engine._LESS = 0x0201; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
-        Engine._EQUAL = 0x0202; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
-        Engine._LEQUAL = 0x0203; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
-        Engine._GREATER = 0x0204; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
-        Engine._GEQUAL = 0x0206; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
-        Engine._NOTEQUAL = 0x0205; //  Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
+        Engine.NEVER = 0x0200;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
+        Engine.ALWAYS = 0x0207;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
+        Engine.LESS = 0x0201;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
+        Engine.EQUAL = 0x0202;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
+        Engine.LEQUAL = 0x0203;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
+        Engine.GREATER = 0x0204;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
+        Engine.GEQUAL = 0x0206;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
+        Engine.NOTEQUAL = 0x0205;
         // Stencil Actions Constants.
-        Engine._KEEP = 0x1E00;
-        Engine._REPLACE = 0x1E01;
-        Engine._INCR = 0x1E02;
-        Engine._DECR = 0x1E03;
-        Engine._INVERT = 0x150A;
-        Engine._INCR_WRAP = 0x8507;
-        Engine._DECR_WRAP = 0x8508;
+        /** Passed to stencilOperation to specify that stencil value must be kept */
+        Engine.KEEP = 0x1E00;
+        /** Passed to stencilOperation to specify that stencil value must be replaced */
+        Engine.REPLACE = 0x1E01;
+        /** Passed to stencilOperation to specify that stencil value must be incremented */
+        Engine.INCR = 0x1E02;
+        /** Passed to stencilOperation to specify that stencil value must be decremented */
+        Engine.DECR = 0x1E03;
+        /** Passed to stencilOperation to specify that stencil value must be inverted */
+        Engine.INVERT = 0x150A;
+        /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
+        Engine.INCR_WRAP = 0x8507;
+        /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
+        Engine.DECR_WRAP = 0x8508;
+        /** Texture is not repeating outside of 0..1 UVs */
+        Engine.TEXTURE_CLAMP_ADDRESSMODE = 0;
+        /** Texture is repeating outside of 0..1 UVs */
+        Engine.TEXTURE_WRAP_ADDRESSMODE = 1;
+        /** Texture is repeating and mirrored */
+        Engine.TEXTURE_MIRROR_ADDRESSMODE = 2;
+        /** ALPHA */
+        Engine.TEXTUREFORMAT_ALPHA = 0;
+        /** LUMINANCE */
+        Engine.TEXTUREFORMAT_LUMINANCE = 1;
+        /** LUMINANCE_ALPHA */
+        Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
+        /** RGB */
+        Engine.TEXTUREFORMAT_RGB = 4;
+        /** RGBA */
+        Engine.TEXTUREFORMAT_RGBA = 5;
+        /** R */
+        Engine.TEXTUREFORMAT_R = 6;
+        /** RG */
+        Engine.TEXTUREFORMAT_RG = 7;
+        /** UNSIGNED_INT */
+        Engine.TEXTURETYPE_UNSIGNED_INT = 0;
+        /** FLOAT */
+        Engine.TEXTURETYPE_FLOAT = 1;
+        /** HALF_FLOAT */
+        Engine.TEXTURETYPE_HALF_FLOAT = 2;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1;
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
+        /** mag = nearest and min = nearest and mip = nearest */
+        Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
+        /** mag = nearest and min = linear and mip = nearest */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
+        /** mag = nearest and min = linear and mip = linear */
+        Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
+        /** mag = nearest and min = linear and mip = none */
+        Engine.TEXTURE_NEAREST_LINEAR = 7;
+        /** mag = nearest and min = nearest and mip = none */
+        Engine.TEXTURE_NEAREST_NEAREST = 8;
+        /** mag = linear and min = nearest and mip = nearest */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
+        /** mag = linear and min = nearest and mip = linear */
+        Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
+        /** mag = linear and min = linear and mip = none */
+        Engine.TEXTURE_LINEAR_LINEAR = 11;
+        /** mag = linear and min = nearest and mip = none */
+        Engine.TEXTURE_LINEAR_NEAREST = 12;
+        /** Explicit coordinates mode */
+        Engine.TEXTURE_EXPLICIT_MODE = 0;
+        /** Spherical coordinates mode */
+        Engine.TEXTURE_SPHERICAL_MODE = 1;
+        /** Planar coordinates mode */
+        Engine.TEXTURE_PLANAR_MODE = 2;
+        /** Cubic coordinates mode */
+        Engine.TEXTURE_CUBIC_MODE = 3;
+        /** Projection coordinates mode */
+        Engine.TEXTURE_PROJECTION_MODE = 4;
+        /** Skybox coordinates mode */
+        Engine.TEXTURE_SKYBOX_MODE = 5;
+        /** Inverse Cubic coordinates mode */
+        Engine.TEXTURE_INVCUBIC_MODE = 6;
+        /** Equirectangular coordinates mode */
+        Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7;
+        /** Equirectangular Fixed coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
+        /** Equirectangular Fixed Mirrored coordinates mode */
+        Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
         // Texture rescaling mode
-        Engine._SCALEMODE_FLOOR = 1;
-        Engine._SCALEMODE_NEAREST = 2;
-        Engine._SCALEMODE_CEILING = 3;
+        /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
+        Engine.SCALEMODE_FLOOR = 1;
+        /** Defines that texture rescaling will look for the nearest power of 2 size */
+        Engine.SCALEMODE_NEAREST = 2;
+        /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
+        Engine.SCALEMODE_CEILING = 3;
         // Updatable statics so stick with vars here
         /**
          * Gets or sets the epsilon value used by collision engine
@@ -31413,34 +31162,34 @@ var BABYLON;
             return new Texture(name, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format);
         };
         // Constants
-        Texture.NEAREST_SAMPLINGMODE = 1;
-        Texture.NEAREST_NEAREST_MIPLINEAR = 1; // nearest is mag = nearest and min = nearest and mip = linear
-        Texture.BILINEAR_SAMPLINGMODE = 2;
-        Texture.LINEAR_LINEAR_MIPNEAREST = 2; // Bilinear is mag = linear and min = linear and mip = nearest
-        Texture.TRILINEAR_SAMPLINGMODE = 3;
-        Texture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
-        Texture.NEAREST_NEAREST_MIPNEAREST = 4;
-        Texture.NEAREST_LINEAR_MIPNEAREST = 5;
-        Texture.NEAREST_LINEAR_MIPLINEAR = 6;
-        Texture.NEAREST_LINEAR = 7;
-        Texture.NEAREST_NEAREST = 8;
-        Texture.LINEAR_NEAREST_MIPNEAREST = 9;
-        Texture.LINEAR_NEAREST_MIPLINEAR = 10;
-        Texture.LINEAR_LINEAR = 11;
-        Texture.LINEAR_NEAREST = 12;
-        Texture.EXPLICIT_MODE = 0;
-        Texture.SPHERICAL_MODE = 1;
-        Texture.PLANAR_MODE = 2;
-        Texture.CUBIC_MODE = 3;
-        Texture.PROJECTION_MODE = 4;
-        Texture.SKYBOX_MODE = 5;
-        Texture.INVCUBIC_MODE = 6;
-        Texture.EQUIRECTANGULAR_MODE = 7;
-        Texture.FIXED_EQUIRECTANGULAR_MODE = 8;
-        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
-        Texture.CLAMP_ADDRESSMODE = 0;
-        Texture.WRAP_ADDRESSMODE = 1;
-        Texture.MIRROR_ADDRESSMODE = 2;
+        Texture.NEAREST_SAMPLINGMODE = BABYLON.Engine.TEXTURE_NEAREST_SAMPLINGMODE;
+        Texture.NEAREST_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear
+        Texture.BILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_BILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest
+        Texture.TRILINEAR_SAMPLINGMODE = BABYLON.Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
+        Texture.LINEAR_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear
+        Texture.NEAREST_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPNEAREST = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
+        Texture.NEAREST_LINEAR_MIPLINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
+        Texture.NEAREST_LINEAR = BABYLON.Engine.TEXTURE_NEAREST_LINEAR;
+        Texture.NEAREST_NEAREST = BABYLON.Engine.TEXTURE_NEAREST_NEAREST;
+        Texture.LINEAR_NEAREST_MIPNEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
+        Texture.LINEAR_NEAREST_MIPLINEAR = BABYLON.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+        Texture.LINEAR_LINEAR = BABYLON.Engine.TEXTURE_LINEAR_LINEAR;
+        Texture.LINEAR_NEAREST = BABYLON.Engine.TEXTURE_LINEAR_NEAREST;
+        Texture.EXPLICIT_MODE = BABYLON.Engine.TEXTURE_EXPLICIT_MODE;
+        Texture.SPHERICAL_MODE = BABYLON.Engine.TEXTURE_SPHERICAL_MODE;
+        Texture.PLANAR_MODE = BABYLON.Engine.TEXTURE_PLANAR_MODE;
+        Texture.CUBIC_MODE = BABYLON.Engine.TEXTURE_CUBIC_MODE;
+        Texture.PROJECTION_MODE = BABYLON.Engine.TEXTURE_PROJECTION_MODE;
+        Texture.SKYBOX_MODE = BABYLON.Engine.TEXTURE_SKYBOX_MODE;
+        Texture.INVCUBIC_MODE = BABYLON.Engine.TEXTURE_INVCUBIC_MODE;
+        Texture.EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
+        Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = BABYLON.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
+        Texture.CLAMP_ADDRESSMODE = BABYLON.Engine.TEXTURE_CLAMP_ADDRESSMODE;
+        Texture.WRAP_ADDRESSMODE = BABYLON.Engine.TEXTURE_WRAP_ADDRESSMODE;
+        Texture.MIRROR_ADDRESSMODE = BABYLON.Engine.TEXTURE_MIRROR_ADDRESSMODE;
         /**
          * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
          */
@@ -101489,6 +101238,14 @@ var BABYLON;
         NullEngine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format) {
             if (premulAlpha === void 0) { premulAlpha = false; }
         };
+        /**
+         * Get the current error code of the webGL context
+         * @returns the error code
+         * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
+         */
+        NullEngine.prototype.getError = function () {
+            return 0;
+        };
         NullEngine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset) {
             if (offset === void 0) { offset = 0; }
         };

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
dist/preview release/inspector/babylon.inspector.bundle.js


+ 1 - 1
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-alpha.9"
+        "babylonjs-gltf2interface": "3.3.0-alpha.10"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

+ 1 - 1
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-alpha.9"
+        "babylonjs-gltf2interface": "3.3.0-alpha.10"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 65 - 65
dist/preview release/viewer/babylon.viewer.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 240 - 486
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 0
dist/preview release/what's new.md

@@ -64,6 +64,7 @@
 - Added canvas toBlob polyfill in tools ([sebavan](http://www.github.com/sebavan))
 - Added `RawCubeTexture` class with RGBD and mipmap support ([bghgary](http://www.github.com/bghgary))
 - Added effect layer per rendering group addressing [Issue 4463](https://github.com/BabylonJS/Babylon.js/issues/4463) ([sebavan](http://www.github.com/sebavan))
+- Added predicate function `targetMask` argument to `scene.beginWeightedAnimation`, `scene.beginAnimation`, `scene.stopAnimation`, and `animatable.stop` to allow for selective application of animations.  ([fmmoret](http://github.com/fmmoret))
 
 ### glTF Loader
 

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.3.0-alpha.9",
+    "version": "3.3.0-alpha.10",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 9 - 4
src/Animations/babylon.animatable.ts

@@ -282,9 +282,10 @@
         /**
          * Stop and delete the current animation
          * @param animationName defines a string used to only stop some of the runtime animations instead of all
+         * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
          */
-        public stop(animationName?: string): void {
-            if (animationName) {
+        public stop(animationName?: string, targetMask?: (target: any) => boolean): void {
+            if (animationName || targetMask) {
                 var idx = this._scene._activeAnimatables.indexOf(this);
 
                 if (idx > -1) {
@@ -292,11 +293,15 @@
                     var runtimeAnimations = this._runtimeAnimations;
 
                     for (var index = runtimeAnimations.length - 1; index >= 0; index--) {
-                        if (typeof animationName === "string" && runtimeAnimations[index].animation.name != animationName) {
+                        const runtimeAnimation = runtimeAnimations[index];
+                        if (animationName && runtimeAnimation.animation.name != animationName) {
+                            continue;
+                        }
+                        if (targetMask && !targetMask(runtimeAnimation.target)) {
                             continue;
                         }
 
-                        runtimeAnimations[index].dispose();
+                        runtimeAnimation.dispose();
                         runtimeAnimations.splice(index, 1);
                     }
 

+ 162 - 283
src/Engine/babylon.engine.ts

@@ -28,7 +28,7 @@
         var minFilter = gl.NEAREST;
 
         switch (samplingMode) {
-            case Texture.BILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -36,7 +36,7 @@
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case Texture.TRILINEAR_SAMPLINGMODE:
+            case Engine.TEXTURE_TRILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -44,7 +44,7 @@
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case Texture.NEAREST_SAMPLINGMODE:
+            case Engine.TEXTURE_NEAREST_SAMPLINGMODE:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -52,7 +52,7 @@
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case Texture.NEAREST_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -60,7 +60,7 @@
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case Texture.NEAREST_LINEAR_MIPNEAREST:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
@@ -68,7 +68,7 @@
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case Texture.NEAREST_LINEAR_MIPLINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
@@ -76,15 +76,15 @@
                     minFilter = gl.LINEAR;
                 }
                 break;
-            case Texture.NEAREST_LINEAR:
+            case Engine.TEXTURE_NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
                 break;
-            case Texture.NEAREST_NEAREST:
+            case Engine.TEXTURE_NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
                 break;
-            case Texture.LINEAR_NEAREST_MIPNEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
@@ -92,7 +92,7 @@
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case Texture.LINEAR_NEAREST_MIPLINEAR:
+            case Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
@@ -100,11 +100,11 @@
                     minFilter = gl.NEAREST;
                 }
                 break;
-            case Texture.LINEAR_LINEAR:
+            case Engine.TEXTURE_LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
                 break;
-            case Texture.LINEAR_NEAREST:
+            case Engine.TEXTURE_LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
                 break;
@@ -424,293 +424,172 @@
         }
 
         // Const statics
-        private static _ALPHA_DISABLE = 0;
-        private static _ALPHA_ADD = 1;
-        private static _ALPHA_COMBINE = 2;
-        private static _ALPHA_SUBTRACT = 3;
-        private static _ALPHA_MULTIPLY = 4;
-        private static _ALPHA_MAXIMIZED = 5;
-        private static _ALPHA_ONEONE = 6;
-        private static _ALPHA_PREMULTIPLIED = 7;
-        private static _ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
-        private static _ALPHA_INTERPOLATE = 9;
-        private static _ALPHA_SCREENMODE = 10;
-
-        private static _DELAYLOADSTATE_NONE = 0;
-        private static _DELAYLOADSTATE_LOADED = 1;
-        private static _DELAYLOADSTATE_LOADING = 2;
-        private static _DELAYLOADSTATE_NOTLOADED = 4;
-
-        private static _TEXTUREFORMAT_ALPHA = 0;
-        private static _TEXTUREFORMAT_LUMINANCE = 1;
-        private static _TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
-        private static _TEXTUREFORMAT_RGB = 4;
-        private static _TEXTUREFORMAT_RGBA = 5;
-        private static _TEXTUREFORMAT_R = 6;
-        private static _TEXTUREFORMAT_RG = 7;
-
-        private static _TEXTURETYPE_UNSIGNED_INT = 0;
-        private static _TEXTURETYPE_FLOAT = 1;
-        private static _TEXTURETYPE_HALF_FLOAT = 2;
-
-        // Depht or Stencil test Constants.
-        private static _NEVER = 0x0200; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
-        private static _ALWAYS = 0x0207; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
-        private static _LESS = 0x0201; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
-        private static _EQUAL = 0x0202; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
-        private static _LEQUAL = 0x0203; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
-        private static _GREATER = 0x0204; // Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
-        private static _GEQUAL = 0x0206; //	Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
-        private static _NOTEQUAL = 0x0205; //  Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
-        public static get NEVER(): number {
-            return Engine._NEVER;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
-        public static get ALWAYS(): number {
-            return Engine._ALWAYS;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
-        public static get LESS(): number {
-            return Engine._LESS;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
-        public static get EQUAL(): number {
-            return Engine._EQUAL;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
-        public static get LEQUAL(): number {
-            return Engine._LEQUAL;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
-        public static get GREATER(): number {
-            return Engine._GREATER;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
-        public static get GEQUAL(): number {
-            return Engine._GEQUAL;
-        }
-
-        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
-        public static get NOTEQUAL(): number {
-            return Engine._NOTEQUAL;
-        }
-
-        // Stencil Actions Constants.
-        private static _KEEP = 0x1E00;
-        private static _REPLACE = 0x1E01;
-        private static _INCR = 0x1E02;
-        private static _DECR = 0x1E03;
-        private static _INVERT = 0x150A;
-        private static _INCR_WRAP = 0x8507;
-        private static _DECR_WRAP = 0x8508;
-
-        /** Passed to stencilOperation to specify that stencil value must be kept */
-        public static get KEEP(): number {
-            return Engine._KEEP;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be replaced */
-        public static get REPLACE(): number {
-            return Engine._REPLACE;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be incremented */
-        public static get INCR(): number {
-            return Engine._INCR;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be decremented */
-        public static get DECR(): number {
-            return Engine._DECR;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be inverted */
-        public static get INVERT(): number {
-            return Engine._INVERT;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
-        public static get INCR_WRAP(): number {
-            return Engine._INCR_WRAP;
-        }
-
-        /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
-        public static get DECR_WRAP(): number {
-            return Engine._DECR_WRAP;
-        }
-
-        // Alpha
-
         /** Defines that alpha blending is disabled */
-        public static get ALPHA_DISABLE(): number {
-            return Engine._ALPHA_DISABLE;
-        }
-
-        /** Defines that alpha blending to SRC + DEST */
-        public static get ALPHA_ONEONE(): number {
-            return Engine._ALPHA_ONEONE;
-        }
-
+        public static readonly ALPHA_DISABLE = 0;
         /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
-        public static get ALPHA_ADD(): number {
-            return Engine._ALPHA_ADD;
-        }
-
+        public static readonly ALPHA_ADD = 1;
         /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
-        public static get ALPHA_COMBINE(): number {
-            return Engine._ALPHA_COMBINE;
-        }
-
+        public static readonly ALPHA_COMBINE = 2;
         /** Defines that alpha blending to DEST - SRC * DEST */
-        public static get ALPHA_SUBTRACT(): number {
-            return Engine._ALPHA_SUBTRACT;
-        }
-
+        public static readonly ALPHA_SUBTRACT = 3;
         /** Defines that alpha blending to SRC * DEST */
-        public static get ALPHA_MULTIPLY(): number {
-            return Engine._ALPHA_MULTIPLY;
-        }
-
+        public static readonly ALPHA_MULTIPLY = 4;
         /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
-        public static get ALPHA_MAXIMIZED(): number {
-            return Engine._ALPHA_MAXIMIZED;
-        }
-
+        public static readonly ALPHA_MAXIMIZED = 5;
+        /** Defines that alpha blending to SRC + DEST */
+        public static readonly ALPHA_ONEONE = 6;
         /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
-        public static get ALPHA_PREMULTIPLIED(): number {
-            return Engine._ALPHA_PREMULTIPLIED;
-        }
-
+        public static readonly ALPHA_PREMULTIPLIED = 7;
         /** 
          * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
          * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
          */
-        public static get ALPHA_PREMULTIPLIED_PORTERDUFF(): number {
-            return Engine._ALPHA_PREMULTIPLIED_PORTERDUFF;
-        }
-
+        public static readonly ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
         /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
-        public static get ALPHA_INTERPOLATE(): number {
-            return Engine._ALPHA_INTERPOLATE;
-        }
-
+        public static readonly ALPHA_INTERPOLATE = 9;
         /** 
          * Defines that alpha blending to SRC + (1 - SRC) * DEST 
          * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
          */
-        public static get ALPHA_SCREENMODE(): number {
-            return Engine._ALPHA_SCREENMODE;
-        }
-
-        // Delays
+        public static readonly ALPHA_SCREENMODE = 10;
 
         /** Defines that the ressource is not delayed*/
-        public static get DELAYLOADSTATE_NONE(): number {
-            return Engine._DELAYLOADSTATE_NONE;
-        }
-
+        public static readonly DELAYLOADSTATE_NONE = 0;
         /** Defines that the ressource was successfully delay loaded */
-        public static get DELAYLOADSTATE_LOADED(): number {
-            return Engine._DELAYLOADSTATE_LOADED;
-        }
-
+        public static readonly DELAYLOADSTATE_LOADED = 1;
         /** Defines that the ressource is currently delay loading */
-        public static get DELAYLOADSTATE_LOADING(): number {
-            return Engine._DELAYLOADSTATE_LOADING;
-        }
-
+        public static readonly DELAYLOADSTATE_LOADING = 2;
         /** Defines that the ressource is delayed and has not started loading */
-        public static get DELAYLOADSTATE_NOTLOADED(): number {
-            return Engine._DELAYLOADSTATE_NOTLOADED;
-        }
+        public static readonly DELAYLOADSTATE_NOTLOADED = 4;
 
-        /** ALPHA */
-        public static get TEXTUREFORMAT_ALPHA(): number {
-            return Engine._TEXTUREFORMAT_ALPHA;
-        }
+        // Depht or Stencil test Constants.
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
+        public static readonly NEVER = 0x0200;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
+        public static readonly ALWAYS = 0x0207;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
+        public static readonly LESS = 0x0201;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
+        public static readonly EQUAL = 0x0202;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
+        public static readonly LEQUAL = 0x0203;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
+        public static readonly GREATER = 0x0204;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
+        public static readonly GEQUAL = 0x0206;
+        /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
+        public static readonly NOTEQUAL = 0x0205;
 
-        /** LUMINANCE */
-        public static get TEXTUREFORMAT_LUMINANCE(): number {
-            return Engine._TEXTUREFORMAT_LUMINANCE;
-        }
+        // Stencil Actions Constants.
+        /** Passed to stencilOperation to specify that stencil value must be kept */
+        public static readonly KEEP = 0x1E00;
+        /** Passed to stencilOperation to specify that stencil value must be replaced */
+        public static readonly REPLACE = 0x1E01;
+        /** Passed to stencilOperation to specify that stencil value must be incremented */
+        public static readonly INCR = 0x1E02;
+        /** Passed to stencilOperation to specify that stencil value must be decremented */
+        public static readonly DECR = 0x1E03;
+        /** Passed to stencilOperation to specify that stencil value must be inverted */
+        public static readonly INVERT = 0x150A;
+        /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
+        public static readonly INCR_WRAP = 0x8507;
+        /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
+        public static readonly DECR_WRAP = 0x8508;
 
-        /**
-         * R
-         */
-        public static get TEXTUREFORMAT_R(): number {
-            return Engine._TEXTUREFORMAT_R;
-        }       
-        
-        /**
-         * RG
-         */
-        public static get TEXTUREFORMAT_RG(): number {
-            return Engine._TEXTUREFORMAT_RG;
-        }
+        /** Texture is not repeating outside of 0..1 UVs */
+        public static readonly TEXTURE_CLAMP_ADDRESSMODE = 0;
+        /** Texture is repeating outside of 0..1 UVs */
+        public static readonly TEXTURE_WRAP_ADDRESSMODE = 1;
+        /** Texture is repeating and mirrored */
+        public static readonly TEXTURE_MIRROR_ADDRESSMODE = 2;
 
+        /** ALPHA */
+        public static readonly TEXTUREFORMAT_ALPHA = 0;
+        /** LUMINANCE */
+        public static readonly TEXTUREFORMAT_LUMINANCE = 1;
         /** LUMINANCE_ALPHA */
-        public static get TEXTUREFORMAT_LUMINANCE_ALPHA(): number {
-            return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
-        }
-
+        public static readonly TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
         /** RGB */
-        public static get TEXTUREFORMAT_RGB(): number {
-            return Engine._TEXTUREFORMAT_RGB;
-        }
-
+        public static readonly TEXTUREFORMAT_RGB = 4;
         /** RGBA */
-        public static get TEXTUREFORMAT_RGBA(): number {
-            return Engine._TEXTUREFORMAT_RGBA;
-        }
+        public static readonly TEXTUREFORMAT_RGBA = 5;
+        /** R */
+        public static readonly TEXTUREFORMAT_R = 6;
+        /** RG */
+        public static readonly TEXTUREFORMAT_RG = 7;
 
         /** UNSIGNED_INT */
-        public static get TEXTURETYPE_UNSIGNED_INT(): number {
-            return Engine._TEXTURETYPE_UNSIGNED_INT;
-        }
-
+        public static readonly TEXTURETYPE_UNSIGNED_INT = 0;
         /** FLOAT */
-        public static get TEXTURETYPE_FLOAT(): number {
-            return Engine._TEXTURETYPE_FLOAT;
-        }
-
+        public static readonly TEXTURETYPE_FLOAT = 1;
         /** HALF_FLOAT */
-        public static get TEXTURETYPE_HALF_FLOAT(): number {
-            return Engine._TEXTURETYPE_HALF_FLOAT;
-        }
+        public static readonly TEXTURETYPE_HALF_FLOAT = 2;
+
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        public static readonly TEXTURE_NEAREST_SAMPLINGMODE = 1; 
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        public static readonly TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
+        /** nearest is mag = nearest and min = nearest and mip = linear */
+        public static readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1; 
+        /** Bilinear is mag = linear and min = linear and mip = nearest */
+        public static readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
+        /** Trilinear is mag = linear and min = linear and mip = linear */
+        public static readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
+        /** mag = nearest and min = nearest and mip = nearest */
+        public static readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
+        /** mag = nearest and min = linear and mip = nearest */
+        public static readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
+        /** mag = nearest and min = linear and mip = linear */
+        public static readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
+        /** mag = nearest and min = linear and mip = none */
+        public static readonly TEXTURE_NEAREST_LINEAR = 7;
+        /** mag = nearest and min = nearest and mip = none */
+        public static readonly TEXTURE_NEAREST_NEAREST = 8;
+        /** mag = linear and min = nearest and mip = nearest */
+        public static readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
+        /** mag = linear and min = nearest and mip = linear */
+        public static readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
+        /** mag = linear and min = linear and mip = none */
+        public static readonly TEXTURE_LINEAR_LINEAR = 11;
+        /** mag = linear and min = nearest and mip = none */
+        public static readonly TEXTURE_LINEAR_NEAREST = 12;
+
+        /** Explicit coordinates mode */
+        public static readonly TEXTURE_EXPLICIT_MODE = 0;
+        /** Spherical coordinates mode */
+        public static readonly TEXTURE_SPHERICAL_MODE = 1;
+        /** Planar coordinates mode */
+        public static readonly TEXTURE_PLANAR_MODE = 2;
+        /** Cubic coordinates mode */
+        public static readonly TEXTURE_CUBIC_MODE = 3;
+        /** Projection coordinates mode */
+        public static readonly TEXTURE_PROJECTION_MODE = 4;
+        /** Skybox coordinates mode */
+        public static readonly TEXTURE_SKYBOX_MODE = 5;
+        /** Inverse Cubic coordinates mode */
+        public static readonly TEXTURE_INVCUBIC_MODE = 6;
+        /** Equirectangular coordinates mode */
+        public static readonly TEXTURE_EQUIRECTANGULAR_MODE = 7;
+        /** Equirectangular Fixed coordinates mode */
+        public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
+        /** Equirectangular Fixed Mirrored coordinates mode */
+        public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
 
         // Texture rescaling mode
-        private static _SCALEMODE_FLOOR = 1;
-        private static _SCALEMODE_NEAREST = 2;
-        private static _SCALEMODE_CEILING = 3;
-
         /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
-        public static get SCALEMODE_FLOOR(): number {
-            return Engine._SCALEMODE_FLOOR;
-        }
-
+        public static readonly SCALEMODE_FLOOR = 1;
         /** Defines that texture rescaling will look for the nearest power of 2 size */
-        public static get SCALEMODE_NEAREST(): number {
-            return Engine._SCALEMODE_NEAREST;
-        }
-
+        public static readonly SCALEMODE_NEAREST = 2;
         /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
-        public static get SCALEMODE_CEILING(): number {
-            return Engine._SCALEMODE_CEILING;
-        }
+        public static readonly SCALEMODE_CEILING = 3;
 
         /**
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "3.3.0-alpha.9";
+            return "3.3.0-alpha.10";
         }
 
         // Updatable statics so stick with vars here
@@ -1101,7 +980,7 @@
          */
         public get emptyTexture(): InternalTexture {
             if (!this._emptyTexture) {
-                this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Texture.NEAREST_SAMPLINGMODE);
+                this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
             }
 
             return this._emptyTexture;
@@ -1112,7 +991,7 @@
          */        
         public get emptyTexture3D(): InternalTexture {
             if (!this._emptyTexture3D) {
-                this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Texture.NEAREST_SAMPLINGMODE);
+                this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
             }
 
             return this._emptyTexture3D;
@@ -1125,7 +1004,7 @@
             if (!this._emptyCubeTexture) {
                 var faceData = new Uint8Array(4);
                 var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Texture.NEAREST_SAMPLINGMODE);
+                this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, Engine.TEXTURE_NEAREST_SAMPLINGMODE);
             }
 
             return this._emptyCubeTexture;
@@ -4166,7 +4045,7 @@
          * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
          * @returns a InternalTexture for assignment back into BABYLON.Texture
          */
-        public createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,
+        public createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode: number = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
             onLoad: Nullable<() => void> = null, onError: Nullable<(message: string, exception: any) => void> = null,
             buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null): InternalTexture {
             var url = String(urlArg); // assign a new string, so that the original is still available in case of fallback
@@ -4366,14 +4245,14 @@
             }, {
                     generateMipMaps: false,
                     type: Engine.TEXTURETYPE_UNSIGNED_INT,
-                    samplingMode: Texture.BILINEAR_SAMPLINGMODE,
+                    samplingMode: Engine.TEXTURE_BILINEAR_SAMPLINGMODE,
                     generateDepthBuffer: false,
                     generateStencilBuffer: false
                 }
             );
 
             if (!this._rescalePostProcess) {
-                this._rescalePostProcess = new PassPostProcess("rescale", 1, null, Texture.BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
+                this._rescalePostProcess = new PassPostProcess("rescale", 1, null, Engine.TEXTURE_BILINEAR_SAMPLINGMODE, this, false, Engine.TEXTURETYPE_UNSIGNED_INT);
             }
 
             this._rescalePostProcess.getEffect().executeWhenCompiled(() => {
@@ -4716,7 +4595,7 @@
             internalTexture.generateMipMaps = false;
             internalTexture._generateDepthBuffer = true;
             internalTexture._generateStencilBuffer = generateStencil;
-            internalTexture.samplingMode = bilinearFiltering ? Texture.BILINEAR_SAMPLINGMODE : Texture.NEAREST_SAMPLINGMODE;
+            internalTexture.samplingMode = bilinearFiltering ? Engine.TEXTURE_BILINEAR_SAMPLINGMODE : Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             internalTexture.type = Engine.TEXTURETYPE_UNSIGNED_INT;
             internalTexture._comparisonFunction = comparisonFunction;
             
@@ -4895,24 +4774,24 @@
                 fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
                 fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
                 fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type;
-                fullOptions.samplingMode = options.samplingMode === undefined ? Texture.TRILINEAR_SAMPLINGMODE : options.samplingMode;
+                fullOptions.samplingMode = options.samplingMode === undefined ? Engine.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
                 fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format;
             } else {
                 fullOptions.generateMipMaps = <boolean>options;
                 fullOptions.generateDepthBuffer = true;
                 fullOptions.generateStencilBuffer = false;
                 fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT;
-                fullOptions.samplingMode = Texture.TRILINEAR_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
                 fullOptions.format = Engine.TEXTUREFORMAT_RGBA;
             }
 
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                 // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                 // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                fullOptions.samplingMode = Texture.NEAREST_SAMPLINGMODE;
+                fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl;
 
@@ -4988,7 +4867,7 @@
             var textureCount = 1;
 
             var defaultType = Engine.TEXTURETYPE_UNSIGNED_INT;
-            var defaultSamplingMode = Texture.TRILINEAR_SAMPLINGMODE;
+            var defaultSamplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
 
             var types = new Array<number>();
             var samplingModes = new Array<number>();
@@ -5027,11 +4906,11 @@
 
                 if (type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
                     // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
                 else if (type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
                     // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-                    samplingMode = Texture.NEAREST_SAMPLINGMODE;
+                    samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
                 }
 
                 var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);
@@ -5369,7 +5248,7 @@
               generateDepthBuffer: true,
               generateStencilBuffer: false,
               type: Engine.TEXTURETYPE_UNSIGNED_INT,
-              samplingMode: Texture.TRILINEAR_SAMPLINGMODE,
+              samplingMode: Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
               format: Engine.TEXTUREFORMAT_RGBA,
               ...options
             };
@@ -5377,11 +5256,11 @@
 
             if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
               // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-              fullOptions.samplingMode = Texture.NEAREST_SAMPLINGMODE;
+              fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             else if (fullOptions.type === Engine.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
               // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-              fullOptions.samplingMode = Texture.NEAREST_SAMPLINGMODE;
+              fullOptions.samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
             }
             var gl = this._gl
 
@@ -5936,7 +5815,7 @@
             mipmapGenerator: Nullable<((faces: ArrayBufferView[]) => ArrayBufferView[][])>,
             onLoad: Nullable<() => void> = null,
             onError: Nullable<(message?: string, exception?: any) => void> = null,
-            samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
+            samplingMode = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
             invertY = false): InternalTexture {
 
             var gl = this._gl;
@@ -6131,7 +6010,7 @@
         }
 
         private _prepareWebGLTexture(texture: InternalTexture, scene: Nullable<Scene>, width: number, height: number, invertY: boolean, noMipmap: boolean, isCompressed: boolean,
-            processFunction: (width: number, height: number, continuationCallback: () => void) => boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): void {
+            processFunction: (width: number, height: number, continuationCallback: () => void) => boolean, samplingMode: number = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE): void {
             var maxTextureSize = this.getCaps().maxTextureSize;    
             var potWidth = Math.min(maxTextureSize, this.needPOTTextures ? Tools.GetExponentOfTwo(width, maxTextureSize) : width);
             var potHeight = Math.min(maxTextureSize, this.needPOTTextures ? Tools.GetExponentOfTwo(height, maxTextureSize) : height);
@@ -6519,11 +6398,11 @@
 
         private _getTextureWrapMode(mode: number): number {
             switch(mode) {
-                case Texture.WRAP_ADDRESSMODE:
+                case Engine.TEXTURE_WRAP_ADDRESSMODE:
                     return this._gl.REPEAT;
-                case Texture.CLAMP_ADDRESSMODE:
+                case Engine.TEXTURE_CLAMP_ADDRESSMODE:
                     return this._gl.CLAMP_TO_EDGE;
-                case Texture.MIRROR_ADDRESSMODE:
+                case Engine.TEXTURE_MIRROR_ADDRESSMODE:
                     return this._gl.MIRRORED_REPEAT;
             }
             return this._gl.REPEAT;
@@ -6615,7 +6494,7 @@
                 if (internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                     internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                     // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
-                    var textureWrapMode = (texture.coordinatesMode !== Texture.CUBIC_MODE && texture.coordinatesMode !== Texture.SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
+                    var textureWrapMode = (texture.coordinatesMode !== Engine.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Engine.TEXTURE_SKYBOX_MODE) ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, textureWrapMode, internalTexture);
                     this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, textureWrapMode);
                 }
@@ -6677,9 +6556,9 @@
             var anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;
             var value = texture.anisotropicFilteringLevel;
 
-            if (internalTexture.samplingMode !== Texture.LINEAR_LINEAR_MIPNEAREST
-                && internalTexture.samplingMode !== Texture.LINEAR_LINEAR_MIPLINEAR
-                && internalTexture.samplingMode !== Texture.LINEAR_LINEAR) {
+            if (internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR
+                && internalTexture.samplingMode !== Engine.TEXTURE_LINEAR_LINEAR) {
                 value = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear
             }
 

+ 9 - 0
src/Engine/babylon.nullEngine.ts

@@ -401,6 +401,15 @@
 
         }
 
+        /**
+         * Get the current error code of the webGL context
+         * @returns the error code
+         * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
+         */
+        public getError(): number {
+            return 0;
+        }
+
         public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray, offset: number = 0): void {
         }
 

+ 33 - 33
src/Materials/Textures/babylon.texture.ts

@@ -1,39 +1,39 @@
 module BABYLON {
     export class Texture extends BaseTexture {
         // Constants
-        public static NEAREST_SAMPLINGMODE = 1;
-        public static NEAREST_NEAREST_MIPLINEAR = 1; // nearest is mag = nearest and min = nearest and mip = linear
-
-        public static BILINEAR_SAMPLINGMODE = 2;
-        public static LINEAR_LINEAR_MIPNEAREST = 2; // Bilinear is mag = linear and min = linear and mip = nearest
-
-        public static TRILINEAR_SAMPLINGMODE = 3;
-        public static LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
-
-        public static NEAREST_NEAREST_MIPNEAREST = 4;
-        public static NEAREST_LINEAR_MIPNEAREST = 5;
-        public static NEAREST_LINEAR_MIPLINEAR = 6;
-        public static NEAREST_LINEAR = 7;
-        public static NEAREST_NEAREST = 8;
-        public static LINEAR_NEAREST_MIPNEAREST = 9;
-        public static LINEAR_NEAREST_MIPLINEAR = 10;
-        public static LINEAR_LINEAR = 11;
-        public static LINEAR_NEAREST = 12;
-
-        public static EXPLICIT_MODE = 0;
-        public static SPHERICAL_MODE = 1;
-        public static PLANAR_MODE = 2;
-        public static CUBIC_MODE = 3;
-        public static PROJECTION_MODE = 4;
-        public static SKYBOX_MODE = 5;
-        public static INVCUBIC_MODE = 6;
-        public static EQUIRECTANGULAR_MODE = 7;
-        public static FIXED_EQUIRECTANGULAR_MODE = 8;
-        public static FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
-
-        public static CLAMP_ADDRESSMODE = 0;
-        public static WRAP_ADDRESSMODE = 1;
-        public static MIRROR_ADDRESSMODE = 2;
+        public static NEAREST_SAMPLINGMODE = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
+        public static NEAREST_NEAREST_MIPLINEAR = Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear
+
+        public static BILINEAR_SAMPLINGMODE = Engine.TEXTURE_BILINEAR_SAMPLINGMODE;
+        public static LINEAR_LINEAR_MIPNEAREST = Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest
+
+        public static TRILINEAR_SAMPLINGMODE = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE;
+        public static LINEAR_LINEAR_MIPLINEAR = Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear
+
+        public static NEAREST_NEAREST_MIPNEAREST = Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
+        public static NEAREST_LINEAR_MIPNEAREST = Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
+        public static NEAREST_LINEAR_MIPLINEAR = Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
+        public static NEAREST_LINEAR = Engine.TEXTURE_NEAREST_LINEAR;
+        public static NEAREST_NEAREST = Engine.TEXTURE_NEAREST_NEAREST;
+        public static LINEAR_NEAREST_MIPNEAREST = Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
+        public static LINEAR_NEAREST_MIPLINEAR = Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+        public static LINEAR_LINEAR = Engine.TEXTURE_LINEAR_LINEAR;
+        public static LINEAR_NEAREST = Engine.TEXTURE_LINEAR_NEAREST;
+
+        public static EXPLICIT_MODE = Engine.TEXTURE_EXPLICIT_MODE;
+        public static SPHERICAL_MODE = Engine.TEXTURE_SPHERICAL_MODE;
+        public static PLANAR_MODE = Engine.TEXTURE_PLANAR_MODE;
+        public static CUBIC_MODE = Engine.TEXTURE_CUBIC_MODE;
+        public static PROJECTION_MODE = Engine.TEXTURE_PROJECTION_MODE;
+        public static SKYBOX_MODE = Engine.TEXTURE_SKYBOX_MODE;
+        public static INVCUBIC_MODE = Engine.TEXTURE_INVCUBIC_MODE;
+        public static EQUIRECTANGULAR_MODE = Engine.TEXTURE_EQUIRECTANGULAR_MODE;
+        public static FIXED_EQUIRECTANGULAR_MODE = Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
+        public static FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
+
+        public static readonly CLAMP_ADDRESSMODE = Engine.TEXTURE_CLAMP_ADDRESSMODE;
+        public static readonly WRAP_ADDRESSMODE = Engine.TEXTURE_WRAP_ADDRESSMODE;
+        public static readonly MIRROR_ADDRESSMODE = Engine.TEXTURE_MIRROR_ADDRESSMODE;
 
         /**
          * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file

+ 9 - 5
src/Tools/babylon.database.ts

@@ -494,7 +494,7 @@ module BABYLON {
 
             var saveAndLoadFile = () => {
                 // the scene is not yet in the DB, let's try to save it
-                this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack);
+                this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);
             };
 
             this._checkVersionFromDB(completeUrl, version => {
@@ -503,7 +503,7 @@ module BABYLON {
                         this._loadFileFromDBAsync(completeUrl, sceneLoaded, saveAndLoadFile, useArrayBuffer);
                     }
                     else {
-                        this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer);
+                        this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);
                     }
                 }
                 else {
@@ -557,7 +557,7 @@ module BABYLON {
             }
         }
 
-        private _saveFileIntoDBAsync(url: string, callback: (data?: any) => void, progressCallback?: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any, useArrayBuffer?: boolean) {
+        private _saveFileIntoDBAsync(url: string, callback: (data?: any) => void, progressCallback?: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any, useArrayBuffer?: boolean, errorCallback?: (data?: any) => void) {
             if (this.isSupported) {
                 var targetStore: string;
                 if (url.indexOf(".babylon") !== -1) {
@@ -581,7 +581,7 @@ module BABYLON {
                 }
 
                 xhr.addEventListener("load", () => {
-                    if (xhr.status === 200 || Tools.ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6)) {
+                    if (xhr.status === 200 || (xhr.status < 400 && Tools.ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6))) {
                         // Blob as response (XHR2)
                         //fileData = xhr.responseText;
                         fileData = !useArrayBuffer ? xhr.responseText : xhr.response;
@@ -633,7 +633,11 @@ module BABYLON {
                         }
                     }
                     else {
-                        callback();
+                        if(xhr.status >= 400 && errorCallback){
+                            errorCallback(xhr);
+                        }else{
+                            callback();
+                        }
                     }
                 }, false);
 

+ 9 - 3
src/Tools/babylon.tools.ts

@@ -769,9 +769,15 @@
 
             // Caching all files
             if (database && database.enableSceneOffline) {
-                const noIndexedDB = () => {
-                    if (!aborted) {
-                        requestFile();
+                const noIndexedDB = (request?: any) => {
+                    if(request && request.status > 400){
+                        if(onError){
+                            onError(request);
+                        }
+                    } else {
+                        if (!aborted) {
+                            requestFile();
+                        }
                     }
                 };
 

+ 13 - 9
src/babylon.scene.ts

@@ -2523,10 +2523,11 @@
          * @param speedRatio defines the speed in which to run the animation (1.0 by default)
          * @param onAnimationEnd defines the function to be executed when the animation ends
          * @param animatable defines an animatable object. If not provided a new one will be created from the given params
+         * @param targetMask defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value)
          * @returns the animatable object created for this animation
          */
-        public beginWeightedAnimation(target: any, from: number, to: number, weight = 1.0, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable): Animatable {
-            let returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false);
+        public beginWeightedAnimation(target: any, from: number, to: number, weight = 1.0, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable, targetMask?: (target: any) => boolean): Animatable { 
+            let returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask);
             returnedAnimatable.weight = weight;
 
             return returnedAnimatable;
@@ -2542,24 +2543,26 @@
          * @param onAnimationEnd defines the function to be executed when the animation ends
          * @param animatable defines an animatable object. If not provided a new one will be created from the given params
          * @param stopCurrent defines if the current animations must be stopped first (true by default)
+         * @param targetMask defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value)
          * @returns the animatable object created for this animation
          */
-        public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable, stopCurrent = true): Animatable {
+        public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable, stopCurrent = true, targetMask?: (target: any) => boolean): Animatable {
 
             if (from > to && speedRatio > 0) {
                 speedRatio *= -1;
             }
 
             if (stopCurrent) {
-                this.stopAnimation(target);
+                this.stopAnimation(target, undefined, targetMask);
             }
 
             if (!animatable) {
                 animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd);
             }
 
+            const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;
             // Local animations
-            if (target.animations) {
+            if (target.animations && shouldRunTargetAnimations) {
                 animatable.appendAnimations(target, target.animations);
             }
 
@@ -2567,7 +2570,7 @@
             if (target.getAnimatables) {
                 var animatables = target.getAnimatables();
                 for (var index = 0; index < animatables.length; index++) {
-                    this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent);
+                    this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask);
                 }
             }
 
@@ -2662,13 +2665,14 @@
         /**
          * Will stop the animation of the given target
          * @param target - the target
-         * @param animationName - the name of the animation to stop (all animations will be stopped if empty)
+         * @param animationName - the name of the animation to stop (all animations will be stopped if both this and targetMask are empty)
+         * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
          */
-        public stopAnimation(target: any, animationName?: string): void {
+        public stopAnimation(target: any, animationName?: string, targetMask?: (target: any) => boolean): void {
             var animatables = this.getAllAnimatablesByTarget(target);
 
             for (var animatable of animatables) {
-                animatable.stop(animationName);
+                animatable.stop(animationName, targetMask);
             }
         }