瀏覽代碼

First version of baseEngine

David Catuhe 6 年之前
父節點
當前提交
eae262efcd

+ 8 - 0
Playground/babylon.d.txt

@@ -30601,6 +30601,14 @@ declare module BABYLON {
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
      */
     export class Engine extends BaseEngine {
+        /**
+         * Returns the current npm package of the sdk
+         */
+        static readonly NpmPackage: string;
+        /**
+         * Returns the current version of the framework
+         */
+        static readonly Version: string;
         /** Gets the list of created engines */
         static readonly Instances: Engine[];
         /**

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


File diff suppressed because it is too large
+ 46 - 46
dist/preview release/babylon.max.js


+ 8 - 0
dist/preview release/documentation.d.ts

@@ -31215,6 +31215,14 @@ declare module BABYLON {
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
      */
     export class Engine extends BaseEngine {
+        /**
+         * Returns the current npm package of the sdk
+         */
+        static readonly NpmPackage: string;
+        /**
+         * Returns the current version of the framework
+         */
+        static readonly Version: string;
         /** Gets the list of created engines */
         static readonly Instances: Engine[];
         /**

+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"baseEngineOnly":161797, "engineOnly":161797,"sceneOnly":503756,"minGridMaterial":633998,"minStandardMaterial":763472}
+{"baseEngineOnly":151029,"engineOnly":163849,"sceneOnly":505806,"minGridMaterial":636048,"minStandardMaterial":765522}

+ 16 - 0
dist/preview release/viewer/babylon.module.d.ts

@@ -32098,6 +32098,14 @@ declare module "babylonjs/Engines/engine" {
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
      */
     export class Engine extends BaseEngine {
+        /**
+         * Returns the current npm package of the sdk
+         */
+        static readonly NpmPackage: string;
+        /**
+         * Returns the current version of the framework
+         */
+        static readonly Version: string;
         /** Gets the list of created engines */
         static readonly Instances: Engine[];
         /**
@@ -97309,6 +97317,14 @@ declare module BABYLON {
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
      */
     export class Engine extends BaseEngine {
+        /**
+         * Returns the current npm package of the sdk
+         */
+        static readonly NpmPackage: string;
+        /**
+         * Returns the current version of the framework
+         */
+        static readonly Version: string;
         /** Gets the list of created engines */
         static readonly Instances: Engine[];
         /**

File diff suppressed because it is too large
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 0 - 207
src/Engines/engine.backwardCompatibility.ts

@@ -1,207 +0,0 @@
-import { Engine } from "./engine";
-import { Constants } from './constants';
-
-let EngineAsAny = Engine as any;
-
-// Const statics
-
-/** Defines that alpha blending is disabled */
-EngineAsAny.ALPHA_DISABLE = Constants.ALPHA_DISABLE;
-/** Defines that alpha blending to SRC ALPHA * SRC + DEST */
-EngineAsAny.ALPHA_ADD = Constants.ALPHA_ADD;
-/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
-EngineAsAny.ALPHA_COMBINE = Constants.ALPHA_COMBINE;
-/** Defines that alpha blending to DEST - SRC * DEST */
-EngineAsAny.ALPHA_SUBTRACT = Constants.ALPHA_SUBTRACT;
-/** Defines that alpha blending to SRC * DEST */
-EngineAsAny.ALPHA_MULTIPLY = Constants.ALPHA_MULTIPLY;
-/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
-EngineAsAny.ALPHA_MAXIMIZED = Constants.ALPHA_MAXIMIZED;
-/** Defines that alpha blending to SRC + DEST */
-EngineAsAny.ALPHA_ONEONE = Constants.ALPHA_ONEONE;
-/** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
-EngineAsAny.ALPHA_PREMULTIPLIED = Constants.ALPHA_PREMULTIPLIED;
-/**
- * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
- * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
- */
-EngineAsAny.ALPHA_PREMULTIPLIED_PORTERDUFF = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;
-/** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
-EngineAsAny.ALPHA_INTERPOLATE = Constants.ALPHA_INTERPOLATE;
-/**
- * Defines that alpha blending to SRC + (1 - SRC) * DEST
- * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
- */
-EngineAsAny.ALPHA_SCREENMODE = Constants.ALPHA_SCREENMODE;
-
-/** Defines that the ressource is not delayed*/
-EngineAsAny.DELAYLOADSTATE_NONE = Constants.DELAYLOADSTATE_NONE;
-/** Defines that the ressource was successfully delay loaded */
-EngineAsAny.DELAYLOADSTATE_LOADED = Constants.DELAYLOADSTATE_LOADED;
-/** Defines that the ressource is currently delay loading */
-EngineAsAny.DELAYLOADSTATE_LOADING = Constants.DELAYLOADSTATE_LOADING;
-/** Defines that the ressource is delayed and has not started loading */
-EngineAsAny.DELAYLOADSTATE_NOTLOADED = Constants.DELAYLOADSTATE_NOTLOADED;
-
-// 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 */
-EngineAsAny.NEVER = Constants.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 */
-EngineAsAny.ALWAYS = Constants.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 */
-EngineAsAny.LESS = Constants.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 */
-EngineAsAny.EQUAL = Constants.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 */
-EngineAsAny.LEQUAL = Constants.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 */
-EngineAsAny.GREATER = Constants.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 */
-EngineAsAny.GEQUAL = Constants.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 */
-EngineAsAny.NOTEQUAL = Constants.NOTEQUAL;
-
-// Stencil Actions Constants.
-/** Passed to stencilOperation to specify that stencil value must be kept */
-EngineAsAny.KEEP = Constants.KEEP;
-/** Passed to stencilOperation to specify that stencil value must be replaced */
-EngineAsAny.REPLACE = Constants.REPLACE;
-/** Passed to stencilOperation to specify that stencil value must be incremented */
-EngineAsAny.INCR = Constants.INCR;
-/** Passed to stencilOperation to specify that stencil value must be decremented */
-EngineAsAny.DECR = Constants.DECR;
-/** Passed to stencilOperation to specify that stencil value must be inverted */
-EngineAsAny.INVERT = Constants.INVERT;
-/** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
-EngineAsAny.INCR_WRAP = Constants.INCR_WRAP;
-/** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
-EngineAsAny.DECR_WRAP = Constants.DECR_WRAP;
-
-/** Texture is not repeating outside of 0..1 UVs */
-EngineAsAny.TEXTURE_CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;
-/** Texture is repeating outside of 0..1 UVs */
-EngineAsAny.TEXTURE_WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;
-/** Texture is repeating and mirrored */
-EngineAsAny.TEXTURE_MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;
-
-/** ALPHA */
-EngineAsAny.TEXTUREFORMAT_ALPHA = Constants.TEXTUREFORMAT_ALPHA;
-/** LUMINANCE */
-EngineAsAny.TEXTUREFORMAT_LUMINANCE = Constants.TEXTUREFORMAT_LUMINANCE;
-/** LUMINANCE_ALPHA */
-EngineAsAny.TEXTUREFORMAT_LUMINANCE_ALPHA = Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;
-/** RGB */
-EngineAsAny.TEXTUREFORMAT_RGB = Constants.TEXTUREFORMAT_RGB;
-/** RGBA */
-EngineAsAny.TEXTUREFORMAT_RGBA = Constants.TEXTUREFORMAT_RGBA;
-/** RED */
-EngineAsAny.TEXTUREFORMAT_RED = Constants.TEXTUREFORMAT_RED;
-/** RED (2nd reference) */
-EngineAsAny.TEXTUREFORMAT_R = Constants.TEXTUREFORMAT_R;
-/** RG */
-EngineAsAny.TEXTUREFORMAT_RG = Constants.TEXTUREFORMAT_RG;
-/** RED_INTEGER */
-EngineAsAny.TEXTUREFORMAT_RED_INTEGER = Constants.TEXTUREFORMAT_RED_INTEGER;
-/** RED_INTEGER (2nd reference) */
-EngineAsAny.TEXTUREFORMAT_R_INTEGER = Constants.TEXTUREFORMAT_R_INTEGER;
-/** RG_INTEGER */
-EngineAsAny.TEXTUREFORMAT_RG_INTEGER = Constants.TEXTUREFORMAT_RG_INTEGER;
-/** RGB_INTEGER */
-EngineAsAny.TEXTUREFORMAT_RGB_INTEGER = Constants.TEXTUREFORMAT_RGB_INTEGER;
-/** RGBA_INTEGER */
-EngineAsAny.TEXTUREFORMAT_RGBA_INTEGER = Constants.TEXTUREFORMAT_RGBA_INTEGER;
-
-/** UNSIGNED_BYTE */
-EngineAsAny.TEXTURETYPE_UNSIGNED_BYTE = Constants.TEXTURETYPE_UNSIGNED_BYTE;
-/** UNSIGNED_BYTE (2nd reference) */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INT = Constants.TEXTURETYPE_UNSIGNED_INT;
-/** FLOAT */
-EngineAsAny.TEXTURETYPE_FLOAT = Constants.TEXTURETYPE_FLOAT;
-/** HALF_FLOAT */
-EngineAsAny.TEXTURETYPE_HALF_FLOAT = Constants.TEXTURETYPE_HALF_FLOAT;
-/** BYTE */
-EngineAsAny.TEXTURETYPE_BYTE = Constants.TEXTURETYPE_BYTE;
-/** SHORT */
-EngineAsAny.TEXTURETYPE_SHORT = Constants.TEXTURETYPE_SHORT;
-/** UNSIGNED_SHORT */
-EngineAsAny.TEXTURETYPE_UNSIGNED_SHORT = Constants.TEXTURETYPE_UNSIGNED_SHORT;
-/** INT */
-EngineAsAny.TEXTURETYPE_INT = Constants.TEXTURETYPE_INT;
-/** UNSIGNED_INT */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INTEGER = Constants.TEXTURETYPE_UNSIGNED_INTEGER;
-/** UNSIGNED_SHORT_4_4_4_4 */
-EngineAsAny.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4;
-/** UNSIGNED_SHORT_5_5_5_1 */
-EngineAsAny.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1;
-/** UNSIGNED_SHORT_5_6_5 */
-EngineAsAny.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;
-/** UNSIGNED_INT_2_10_10_10_REV */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV;
-/** UNSIGNED_INT_24_8 */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INT_24_8 = Constants.TEXTURETYPE_UNSIGNED_INT_24_8;
-/** UNSIGNED_INT_10F_11F_11F_REV */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV;
-/** UNSIGNED_INT_5_9_9_9_REV */
-EngineAsAny.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV;
-/** FLOAT_32_UNSIGNED_INT_24_8_REV */
-EngineAsAny.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV;
-
-/** nearest is mag = nearest and min = nearest and mip = linear */
-EngineAsAny.TEXTURE_NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
-/** Bilinear is mag = linear and min = linear and mip = nearest */
-EngineAsAny.TEXTURE_BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;
-/** Trilinear is mag = linear and min = linear and mip = linear */
-EngineAsAny.TEXTURE_TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;
-/** nearest is mag = nearest and min = nearest and mip = linear */
-EngineAsAny.TEXTURE_NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR;
-/** Bilinear is mag = linear and min = linear and mip = nearest */
-EngineAsAny.TEXTURE_LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;
-/** Trilinear is mag = linear and min = linear and mip = linear */
-EngineAsAny.TEXTURE_LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;
-/** mag = nearest and min = nearest and mip = nearest */
-EngineAsAny.TEXTURE_NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
-/** mag = nearest and min = linear and mip = nearest */
-EngineAsAny.TEXTURE_NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
-/** mag = nearest and min = linear and mip = linear */
-EngineAsAny.TEXTURE_NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
-/** mag = nearest and min = linear and mip = none */
-EngineAsAny.TEXTURE_NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;
-/** mag = nearest and min = nearest and mip = none */
-EngineAsAny.TEXTURE_NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;
-/** mag = linear and min = nearest and mip = nearest */
-EngineAsAny.TEXTURE_LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
-/** mag = linear and min = nearest and mip = linear */
-EngineAsAny.TEXTURE_LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
-/** mag = linear and min = linear and mip = none */
-EngineAsAny.TEXTURE_LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;
-/** mag = linear and min = nearest and mip = none */
-EngineAsAny.TEXTURE_LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;
-
-/** Explicit coordinates mode */
-EngineAsAny.TEXTURE_EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;
-/** Spherical coordinates mode */
-EngineAsAny.TEXTURE_SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;
-/** Planar coordinates mode */
-EngineAsAny.TEXTURE_PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;
-/** Cubic coordinates mode */
-EngineAsAny.TEXTURE_CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;
-/** Projection coordinates mode */
-EngineAsAny.TEXTURE_PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;
-/** Skybox coordinates mode */
-EngineAsAny.TEXTURE_SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;
-/** Inverse Cubic coordinates mode */
-EngineAsAny.TEXTURE_INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;
-/** Equirectangular coordinates mode */
-EngineAsAny.TEXTURE_EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;
-/** Equirectangular Fixed coordinates mode */
-EngineAsAny.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
-/** Equirectangular Fixed Mirrored coordinates mode */
-EngineAsAny.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
-
-// Texture rescaling mode
-/** Defines that texture rescaling will use a floor to find the closer power of 2 size */
-EngineAsAny.SCALEMODE_FLOOR = Constants.SCALEMODE_FLOOR;
-/** Defines that texture rescaling will look for the nearest power of 2 size */
-EngineAsAny.SCALEMODE_NEAREST = Constants.SCALEMODE_NEAREST;
-/** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
-EngineAsAny.SCALEMODE_CEILING = Constants.SCALEMODE_CEILING;

+ 207 - 19
src/Engines/engine.ts

@@ -13,9 +13,9 @@ import { _DevTools } from '../Misc/devTools';
 import { WebGLPipelineContext } from './WebGL/webGLPipelineContext';
 import { IPipelineContext } from './IPipelineContext';
 import { ICustomAnimationFrameRequester } from '../Misc/customAnimationFrameRequester';
-import { IPerformanceMonitor } from '../Misc/IPerformanceMonitor';
 import { BaseEngine, EngineOptions } from './baseEngine';
 import { Constants } from './constants';
+import { PerformanceMonitor } from '../Misc';
 
 declare type Material = import("../Materials/material").Material;
 declare type PostProcess = import("../PostProcesses/postProcess").PostProcess;
@@ -35,6 +35,208 @@ export interface IDisplayChangedEventArgs {
  * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
  */
 export class Engine extends BaseEngine {
+    // Const statics
+
+    /** Defines that alpha blending is disabled */
+    public static readonly ALPHA_DISABLE = Constants.ALPHA_DISABLE;
+    /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
+    public static readonly ALPHA_ADD = Constants.ALPHA_ADD;
+    /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
+    public static readonly ALPHA_COMBINE = Constants.ALPHA_COMBINE;
+    /** Defines that alpha blending to DEST - SRC * DEST */
+    public static readonly ALPHA_SUBTRACT = Constants.ALPHA_SUBTRACT;
+    /** Defines that alpha blending to SRC * DEST */
+    public static readonly ALPHA_MULTIPLY = Constants.ALPHA_MULTIPLY;
+    /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
+    public static readonly ALPHA_MAXIMIZED = Constants.ALPHA_MAXIMIZED;
+    /** Defines that alpha blending to SRC + DEST */
+    public static readonly ALPHA_ONEONE = Constants.ALPHA_ONEONE;
+    /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
+    public static readonly ALPHA_PREMULTIPLIED = Constants.ALPHA_PREMULTIPLIED;
+    /**
+     * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
+     * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
+     */
+    public static readonly ALPHA_PREMULTIPLIED_PORTERDUFF = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;
+    /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
+    public static readonly ALPHA_INTERPOLATE = Constants.ALPHA_INTERPOLATE;
+    /**
+     * Defines that alpha blending to SRC + (1 - SRC) * DEST
+     * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
+     */
+    public static readonly ALPHA_SCREENMODE = Constants.ALPHA_SCREENMODE;
+
+    /** Defines that the ressource is not delayed*/
+    public static readonly DELAYLOADSTATE_NONE = Constants.DELAYLOADSTATE_NONE;
+    /** Defines that the ressource was successfully delay loaded */
+    public static readonly DELAYLOADSTATE_LOADED = Constants.DELAYLOADSTATE_LOADED;
+    /** Defines that the ressource is currently delay loading */
+    public static readonly DELAYLOADSTATE_LOADING = Constants.DELAYLOADSTATE_LOADING;
+    /** Defines that the ressource is delayed and has not started loading */
+    public static readonly DELAYLOADSTATE_NOTLOADED = Constants.DELAYLOADSTATE_NOTLOADED;
+
+    // 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 = Constants.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 readonly ALWAYS = Constants.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 readonly LESS = Constants.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 readonly EQUAL = Constants.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 readonly LEQUAL = Constants.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 readonly GREATER = Constants.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 readonly GEQUAL = Constants.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 readonly NOTEQUAL = Constants.NOTEQUAL;
+
+    // Stencil Actions Constants.
+    /** Passed to stencilOperation to specify that stencil value must be kept */
+    public static readonly KEEP = Constants.KEEP;
+    /** Passed to stencilOperation to specify that stencil value must be replaced */
+    public static readonly REPLACE = Constants.REPLACE;
+    /** Passed to stencilOperation to specify that stencil value must be incremented */
+    public static readonly INCR = Constants.INCR;
+    /** Passed to stencilOperation to specify that stencil value must be decremented */
+    public static readonly DECR = Constants.DECR;
+    /** Passed to stencilOperation to specify that stencil value must be inverted */
+    public static readonly INVERT = Constants.INVERT;
+    /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
+    public static readonly INCR_WRAP = Constants.INCR_WRAP;
+    /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
+    public static readonly DECR_WRAP = Constants.DECR_WRAP;
+
+    /** Texture is not repeating outside of 0..1 UVs */
+    public static readonly TEXTURE_CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;
+    /** Texture is repeating outside of 0..1 UVs */
+    public static readonly TEXTURE_WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;
+    /** Texture is repeating and mirrored */
+    public static readonly TEXTURE_MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;
+
+    /** ALPHA */
+    public static readonly TEXTUREFORMAT_ALPHA = Constants.TEXTUREFORMAT_ALPHA;
+    /** LUMINANCE */
+    public static readonly TEXTUREFORMAT_LUMINANCE = Constants.TEXTUREFORMAT_LUMINANCE;
+    /** LUMINANCE_ALPHA */
+    public static readonly TEXTUREFORMAT_LUMINANCE_ALPHA = Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;
+    /** RGB */
+    public static readonly TEXTUREFORMAT_RGB = Constants.TEXTUREFORMAT_RGB;
+    /** RGBA */
+    public static readonly TEXTUREFORMAT_RGBA = Constants.TEXTUREFORMAT_RGBA;
+    /** RED */
+    public static readonly TEXTUREFORMAT_RED = Constants.TEXTUREFORMAT_RED;
+    /** RED (2nd reference) */
+    public static readonly TEXTUREFORMAT_R = Constants.TEXTUREFORMAT_R;
+    /** RG */
+    public static readonly TEXTUREFORMAT_RG = Constants.TEXTUREFORMAT_RG;
+    /** RED_INTEGER */
+    public static readonly TEXTUREFORMAT_RED_INTEGER = Constants.TEXTUREFORMAT_RED_INTEGER;
+    /** RED_INTEGER (2nd reference) */
+    public static readonly TEXTUREFORMAT_R_INTEGER = Constants.TEXTUREFORMAT_R_INTEGER;
+    /** RG_INTEGER */
+    public static readonly TEXTUREFORMAT_RG_INTEGER = Constants.TEXTUREFORMAT_RG_INTEGER;
+    /** RGB_INTEGER */
+    public static readonly TEXTUREFORMAT_RGB_INTEGER = Constants.TEXTUREFORMAT_RGB_INTEGER;
+    /** RGBA_INTEGER */
+    public static readonly TEXTUREFORMAT_RGBA_INTEGER = Constants.TEXTUREFORMAT_RGBA_INTEGER;
+
+    /** UNSIGNED_BYTE */
+    public static readonly TEXTURETYPE_UNSIGNED_BYTE = Constants.TEXTURETYPE_UNSIGNED_BYTE;
+    /** UNSIGNED_BYTE (2nd reference) */
+    public static readonly TEXTURETYPE_UNSIGNED_INT = Constants.TEXTURETYPE_UNSIGNED_INT;
+    /** FLOAT */
+    public static readonly TEXTURETYPE_FLOAT = Constants.TEXTURETYPE_FLOAT;
+    /** HALF_FLOAT */
+    public static readonly TEXTURETYPE_HALF_FLOAT = Constants.TEXTURETYPE_HALF_FLOAT;
+    /** BYTE */
+    public static readonly TEXTURETYPE_BYTE = Constants.TEXTURETYPE_BYTE;
+    /** SHORT */
+    public static readonly TEXTURETYPE_SHORT = Constants.TEXTURETYPE_SHORT;
+    /** UNSIGNED_SHORT */
+    public static readonly TEXTURETYPE_UNSIGNED_SHORT = Constants.TEXTURETYPE_UNSIGNED_SHORT;
+    /** INT */
+    public static readonly TEXTURETYPE_INT = Constants.TEXTURETYPE_INT;
+    /** UNSIGNED_INT */
+    public static readonly TEXTURETYPE_UNSIGNED_INTEGER = Constants.TEXTURETYPE_UNSIGNED_INTEGER;
+    /** UNSIGNED_SHORT_4_4_4_4 */
+    public static readonly TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4;
+    /** UNSIGNED_SHORT_5_5_5_1 */
+    public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1;
+    /** UNSIGNED_SHORT_5_6_5 */
+    public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;
+    /** UNSIGNED_INT_2_10_10_10_REV */
+    public static readonly TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV;
+    /** UNSIGNED_INT_24_8 */
+    public static readonly TEXTURETYPE_UNSIGNED_INT_24_8 = Constants.TEXTURETYPE_UNSIGNED_INT_24_8;
+    /** UNSIGNED_INT_10F_11F_11F_REV */
+    public static readonly TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV;
+    /** UNSIGNED_INT_5_9_9_9_REV */
+    public static readonly TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV;
+    /** FLOAT_32_UNSIGNED_INT_24_8_REV */
+    public static readonly TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV;
+
+    /** nearest is mag = nearest and min = nearest and mip = linear */
+    public static readonly TEXTURE_NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
+    /** Bilinear is mag = linear and min = linear and mip = nearest */
+    public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;
+    /** Trilinear is mag = linear and min = linear and mip = linear */
+    public static readonly TEXTURE_TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;
+    /** nearest is mag = nearest and min = nearest and mip = linear */
+    public static readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR;
+    /** Bilinear is mag = linear and min = linear and mip = nearest */
+    public static readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;
+    /** Trilinear is mag = linear and min = linear and mip = linear */
+    public static readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;
+    /** mag = nearest and min = nearest and mip = nearest */
+    public static readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
+    /** mag = nearest and min = linear and mip = nearest */
+    public static readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
+    /** mag = nearest and min = linear and mip = linear */
+    public static readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
+    /** mag = nearest and min = linear and mip = none */
+    public static readonly TEXTURE_NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;
+    /** mag = nearest and min = nearest and mip = none */
+    public static readonly TEXTURE_NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;
+    /** mag = linear and min = nearest and mip = nearest */
+    public static readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
+    /** mag = linear and min = nearest and mip = linear */
+    public static readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+    /** mag = linear and min = linear and mip = none */
+    public static readonly TEXTURE_LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;
+    /** mag = linear and min = nearest and mip = none */
+    public static readonly TEXTURE_LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;
+
+    /** Explicit coordinates mode */
+    public static readonly TEXTURE_EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;
+    /** Spherical coordinates mode */
+    public static readonly TEXTURE_SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;
+    /** Planar coordinates mode */
+    public static readonly TEXTURE_PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;
+    /** Cubic coordinates mode */
+    public static readonly TEXTURE_CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;
+    /** Projection coordinates mode */
+    public static readonly TEXTURE_PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;
+    /** Skybox coordinates mode */
+    public static readonly TEXTURE_SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;
+    /** Inverse Cubic coordinates mode */
+    public static readonly TEXTURE_INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;
+    /** Equirectangular coordinates mode */
+    public static readonly TEXTURE_EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;
+    /** Equirectangular Fixed coordinates mode */
+    public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;
+    /** Equirectangular Fixed Mirrored coordinates mode */
+    public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;
+
+    // Texture rescaling mode
+    /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
+    public static readonly SCALEMODE_FLOOR = Constants.SCALEMODE_FLOOR;
+    /** Defines that texture rescaling will look for the nearest power of 2 size */
+    public static readonly SCALEMODE_NEAREST = Constants.SCALEMODE_NEAREST;
+    /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
+    public static readonly SCALEMODE_CEILING = Constants.SCALEMODE_CEILING;    
 
     /**
      * Returns the current npm package of the sdk
@@ -86,14 +288,6 @@ export class Engine extends BaseEngine {
     }
 
     /**
-     * Factory used to create the performance monitor
-     * @returns a new PerformanceMonitor
-     */
-    public static DefaultPerformanceMonitorFactory(): IPerformanceMonitor {
-        throw _DevTools.WarnImport("PerformanceMonitor");
-    }
-
-    /**
      * Method called to create the default loading screen.
      * This can be overriden in your own app.
      * @param canvas The rendering canvas element
@@ -223,15 +417,12 @@ export class Engine extends BaseEngine {
      */
     public disablePerformanceMonitorInBackground = false;
 
-    private _performanceMonitor: Nullable<IPerformanceMonitor> = null;
+    private _performanceMonitor = new PerformanceMonitor();
     /**
      * Gets the performance monitor attached to this engine
      * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#engineinstrumentation
      */
-    public get performanceMonitor(): IPerformanceMonitor {
-        if (!this._performanceMonitor) {
-            this._performanceMonitor = Engine.DefaultPerformanceMonitorFactory();
-        }
+    public get performanceMonitor(): PerformanceMonitor {
         return this._performanceMonitor;
     }
 
@@ -278,14 +469,14 @@ export class Engine extends BaseEngine {
             canvas.addEventListener("blur", this._onCanvasBlur);
 
             this._onBlur = () => {
-                if (this.disablePerformanceMonitorInBackground && this._performanceMonitor) {
+                if (this.disablePerformanceMonitorInBackground) {
                     this._performanceMonitor.disable();
                 }
                 this._windowIsBackground = true;
             };
 
             this._onFocus = () => {
-                if (this.disablePerformanceMonitorInBackground && this._performanceMonitor) {
+                if (this.disablePerformanceMonitorInBackground) {
                     this._performanceMonitor.enable();
                 }
                 this._windowIsBackground = false;
@@ -701,9 +892,6 @@ export class Engine extends BaseEngine {
     }
 
     private _measureFps(): void {
-        if (!this._performanceMonitor) {
-            return;
-        }
         this._performanceMonitor.sampleFrame();
         this._fps = this._performanceMonitor.averageFPS;
         this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;

+ 0 - 46
src/Misc/iPerformanceMonitor.ts

@@ -1,46 +0,0 @@
-/**
- * Interface for performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
- */
-export interface IPerformanceMonitor {
-    /**
-     * Enables contributions to the sliding window sample set
-     */
-    enable(): void;
-
-    /**
-     * Disables contributions to the sliding window sample set
-     * Samples will not be interpolated over the disabled period
-     */
-    disable(): void;
-
-    /**
-     * Samples current frame
-     * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames
-     */
-    sampleFrame(timeMs?: number): void;
-
-    /**
-     * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
-     */
-    averageFrameTime: number;
-
-    /**
-     * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
-     */
-    averageFrameTimeVariance: number;
-
-    /**
-     * Returns the frame time of the most recent frame
-     */
-    instantaneousFrameTime: number;
-
-    /**
-     * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
-     */
-    averageFPS: number;
-
-    /**
-     * Returns the average framerate in frames per second using the most recent frame time
-     */
-    instantaneousFPS: number;
-}

+ 1 - 2
src/Misc/performanceMonitor.ts

@@ -1,12 +1,11 @@
 import { Nullable } from "../types";
 import { PrecisionDate } from "./precisionDate";
-import { IPerformanceMonitor } from './IPerformanceMonitor';
 import { Engine } from '../Engines/engine';
 
 /**
  * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
  */
-export class PerformanceMonitor implements IPerformanceMonitor {
+export class PerformanceMonitor {
 
     private _enabled: boolean = true;
     private _rollingFrameTime: RollingAverage;

File diff suppressed because it is too large
+ 4186 - 4670
tests/es6Modules/webpack-stats.json


+ 5 - 5
tests/es6Modules/webpack.config.js

@@ -5,10 +5,10 @@ module.exports = {
     context: path.resolve(__dirname),
     entry: {
         baseEngineOnly: path.resolve(__dirname, 'baseEngineOnly.ts'),
-        engineOnly: path.resolve(__dirname, 'engineOnly.ts'),
-        sceneOnly: path.resolve(__dirname, 'sceneOnly.ts'),
-        minGridMaterial: path.resolve(__dirname, 'minGridMaterial.ts'),
-        minStandardMaterial: path.resolve(__dirname, 'minStandardMaterial.ts')
+        // engineOnly: path.resolve(__dirname, 'engineOnly.ts'),
+        // sceneOnly: path.resolve(__dirname, 'sceneOnly.ts'),
+        // minGridMaterial: path.resolve(__dirname, 'minGridMaterial.ts'),
+        // minStandardMaterial: path.resolve(__dirname, 'minStandardMaterial.ts')
     },
     output: {
         filename: '[name].js',
@@ -24,5 +24,5 @@ module.exports = {
             loader: 'ts-loader'
         }]
     },
-    mode: "production"
+    mode: "development"
 };