David Catuhe 6 tahun lalu
induk
melakukan
0f31c20fe1
100 mengubah file dengan 15501 tambahan dan 13740 penghapusan
  1. 923 713
      Playground/babylon.d.txt
  2. 936 725
      dist/preview release/babylon.d.ts
  3. 2 2
      dist/preview release/babylon.js
  4. 7270 7047
      dist/preview release/babylon.max.js
  5. 1 1
      dist/preview release/babylon.max.js.map
  6. 1924 1485
      dist/preview release/babylon.module.d.ts
  7. 936 725
      dist/preview release/documentation.d.ts
  8. 1 1
      dist/preview release/packagesSizeBaseLine.json
  9. 1924 1485
      dist/preview release/viewer/babylon.module.d.ts
  10. 1 1
      dist/preview release/viewer/babylon.viewer.d.ts
  11. 104 92
      dist/preview release/viewer/babylon.viewer.js
  12. 1 1
      dist/preview release/viewer/babylon.viewer.max.js
  13. 2 2
      dist/preview release/viewer/babylon.viewer.module.d.ts
  14. 74 0
      src/Engines/Extensions/engine.dynamicTexture.ts
  15. 11 11
      src/Engines/Extensions/engine.rawTexture.ts
  16. 141 0
      src/Engines/Extensions/engine.uniformBuffer.ts
  17. 74 0
      src/Engines/Extensions/engine.videoTexture.ts
  18. 4 1
      src/Engines/Extensions/index.ts
  19. 1019 11
      src/Engines/engine.ts
  20. 0 1
      src/Engines/index.ts
  21. 4 5
      src/Engines/nullEngine.ts
  22. 129 1341
      src/Engines/thinEngine.ts
  23. 0 1
      src/Events/pointerEvents.ts
  24. 0 1
      src/Gamepads/Controllers/daydreamController.ts
  25. 0 2
      src/Gamepads/Controllers/gearVRController.ts
  26. 0 1
      src/Gamepads/Controllers/genericController.ts
  27. 0 2
      src/Gamepads/Controllers/oculusTouchController.ts
  28. 0 1
      src/Gamepads/Controllers/poseEnabledController.ts
  29. 0 2
      src/Gamepads/Controllers/viveController.ts
  30. 0 1
      src/Gamepads/Controllers/webVRController.ts
  31. 0 2
      src/Gamepads/Controllers/windowsMotionController.ts
  32. 0 1
      src/Gamepads/dualShockGamepad.ts
  33. 0 2
      src/Gamepads/gamepad.ts
  34. 0 2
      src/Gamepads/gamepadManager.ts
  35. 0 2
      src/Gamepads/gamepadSceneComponent.ts
  36. 0 1
      src/Gamepads/xboxGamepad.ts
  37. 0 1
      src/Gizmos/axisDragGizmo.ts
  38. 0 1
      src/Gizmos/axisScaleGizmo.ts
  39. 0 1
      src/Gizmos/boundingBoxGizmo.ts
  40. 0 1
      src/Gizmos/gizmo.ts
  41. 0 1
      src/Gizmos/gizmoManager.ts
  42. 0 1
      src/Gizmos/planeDragGizmo.ts
  43. 0 1
      src/Gizmos/planeRotationGizmo.ts
  44. 0 1
      src/Gizmos/positionGizmo.ts
  45. 0 1
      src/Gizmos/rotationGizmo.ts
  46. 0 1
      src/Helpers/environmentHelper.ts
  47. 0 1
      src/Helpers/photoDome.ts
  48. 0 1
      src/Helpers/videoDome.ts
  49. 0 1
      src/Instrumentation/engineInstrumentation.ts
  50. 0 1
      src/Instrumentation/sceneInstrumentation.ts
  51. 0 1
      src/Instrumentation/timeToken.ts
  52. 0 1
      src/Layers/effectLayer.ts
  53. 0 1
      src/Layers/effectLayerSceneComponent.ts
  54. 0 1
      src/Layers/highlightLayer.ts
  55. 0 1
      src/Layers/layer.ts
  56. 0 1
      src/Layers/layerSceneComponent.ts
  57. 0 1
      src/LensFlares/lensFlare.ts
  58. 0 1
      src/LensFlares/lensFlareSystem.ts
  59. 0 1
      src/LensFlares/lensFlareSystemSceneComponent.ts
  60. 0 1
      src/Lights/Shadows/shadowGenerator.ts
  61. 0 1
      src/Lights/Shadows/shadowGeneratorSceneComponent.ts
  62. 0 1
      src/Lights/directionalLight.ts
  63. 0 1
      src/Lights/hemisphericLight.ts
  64. 0 1
      src/Lights/pointLight.ts
  65. 0 1
      src/Lights/shadowLight.ts
  66. 0 1
      src/Lights/spotLight.ts
  67. 0 1
      src/Loading/Plugins/babylonFileLoader.ts
  68. 0 1
      src/Loading/loadingScreen.ts
  69. 0 1
      src/Loading/sceneLoader.ts
  70. 0 1
      src/Materials/Background/backgroundMaterial.ts
  71. 0 1
      src/Materials/PBR/pbrBaseMaterial.ts
  72. 0 1
      src/Materials/PBR/pbrBaseSimpleMaterial.ts
  73. 0 1
      src/Materials/PBR/pbrMaterial.ts
  74. 0 1
      src/Materials/PBR/pbrMetallicRoughnessMaterial.ts
  75. 0 1
      src/Materials/PBR/pbrSpecularGlossinessMaterial.ts
  76. 0 1
      src/Materials/Textures/Loaders/basisTextureLoader.ts
  77. 2 3
      src/Materials/Textures/Loaders/ddsTextureLoader.ts
  78. 0 1
      src/Materials/Textures/Loaders/envTextureLoader.ts
  79. 0 1
      src/Materials/Textures/Loaders/ktxTextureLoader.ts
  80. 0 1
      src/Materials/Textures/Loaders/tgaTextureLoader.ts
  81. 0 1
      src/Materials/Textures/Procedurals/customProceduralTexture.ts
  82. 0 1
      src/Materials/Textures/Procedurals/noiseProceduralTexture.ts
  83. 0 1
      src/Materials/Textures/Procedurals/proceduralTexture.ts
  84. 0 1
      src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts
  85. 0 1
      src/Materials/Textures/baseTexture.ts
  86. 3 4
      src/Materials/Textures/colorGradingTexture.ts
  87. 0 1
      src/Materials/Textures/cubeTexture.ts
  88. 2 1
      src/Materials/Textures/dynamicTexture.ts
  89. 0 1
      src/Materials/Textures/hdrCubeTexture.ts
  90. 2 2
      src/Materials/Textures/internalTexture.ts
  91. 0 1
      src/Materials/Textures/internalTextureLoader.ts
  92. 2 1
      src/Materials/Textures/rawCubeTexture.ts
  93. 1 1
      src/Materials/Textures/rawTexture3D.ts
  94. 0 1
      src/Materials/Textures/texture.ts
  95. 3 0
      src/Materials/Textures/videoTexture.ts
  96. 1 1
      src/Materials/effect.ts
  97. 3 0
      src/Materials/uniformBuffer.ts
  98. 0 3
      src/Misc/performanceMonitor.ts
  99. 1 1
      src/States/alphaCullingState.ts
  100. 0 0
      src/States/depthCullingState.ts

File diff ditekan karena terlalu besar
+ 923 - 713
Playground/babylon.d.txt


File diff ditekan karena terlalu besar
+ 936 - 725
dist/preview release/babylon.d.ts


File diff ditekan karena terlalu besar
+ 2 - 2
dist/preview release/babylon.js


File diff ditekan karena terlalu besar
+ 7270 - 7047
dist/preview release/babylon.max.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/babylon.max.js.map


File diff ditekan karena terlalu besar
+ 1924 - 1485
dist/preview release/babylon.module.d.ts


File diff ditekan karena terlalu besar
+ 936 - 725
dist/preview release/documentation.d.ts


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

@@ -1 +1 @@
-{"baseEngineOnly":151029,"engineOnly":163849,"sceneOnly":505806,"minGridMaterial":636048,"minStandardMaterial":765522}
+{"thinEngineOnly":132349,"engineOnly":167699,"sceneOnly":511354,"minGridMaterial":641596,"minStandardMaterial":771070}

File diff ditekan karena terlalu besar
+ 1924 - 1485
dist/preview release/viewer/babylon.module.d.ts


+ 1 - 1
dist/preview release/viewer/babylon.viewer.d.ts

@@ -20,7 +20,7 @@
 //   ../../../../../Tools/Gulp/babylonjs/Maths/math
 //   ../../../../../Tools/Gulp/babylonjs-loaders/glTF/glTFFileLoader
 //   ../../../../../Tools/Gulp/babylonjs/Materials/Textures/baseTexture
-//   ../../../../../Tools/Gulp/babylonjs/Engines/baseEngine
+//   ../../../../../Tools/Gulp/babylonjs/Engines/thinEngine
 //   ../../../../../Tools/Gulp/babylonjs/Misc/sceneOptimizer
 //   ../../../../../Tools/Gulp/babylonjs/Cameras/arcRotateCamera
 //   ../../../../../Tools/Gulp/babylonjs/Lights/light

File diff ditekan karena terlalu besar
+ 104 - 92
dist/preview release/viewer/babylon.viewer.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -21,7 +21,7 @@
 //   ../../../../../Tools/Gulp/babylonjs/Maths/math
 //   ../../../../../Tools/Gulp/babylonjs-loaders/glTF/glTFFileLoader
 //   ../../../../../Tools/Gulp/babylonjs/Materials/Textures/baseTexture
-//   ../../../../../Tools/Gulp/babylonjs/Engines/baseEngine
+//   ../../../../../Tools/Gulp/babylonjs/Engines/thinEngine
 //   ../../../../../Tools/Gulp/babylonjs/Misc/sceneOptimizer
 //   ../../../../../Tools/Gulp/babylonjs/Cameras/arcRotateCamera
 //   ../../../../../Tools/Gulp/babylonjs/Lights/light
@@ -1064,7 +1064,7 @@ declare module 'babylonjs-viewer/configuration' {
 declare module 'babylonjs-viewer/configuration/configuration' {
     import { ICameraConfiguration, IDefaultRenderingPipelineConfiguration, IGroundConfiguration, ILightConfiguration, IModelConfiguration, IObserversConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ISkyboxConfiguration, ITemplateConfiguration, IVRConfiguration } from 'babylonjs-viewer/configuration/interfaces';
     import { IEnvironmentMapConfiguration } from 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration';
-    import { EngineOptions } from 'babylonjs/Engines/baseEngine';
+    import { EngineOptions } from 'babylonjs/Engines/thinEngine';
     export function getConfigurationKey(key: string, configObject: any): any;
     export interface ViewerConfiguration {
             version?: string;

+ 74 - 0
src/Engines/Extensions/engine.dynamicTexture.ts

@@ -0,0 +1,74 @@
+import { ThinEngine } from "../../Engines/thinEngine";
+import { InternalTexture } from '../../Materials/Textures/internalTexture';
+import { Nullable } from '../../types';
+
+declare module "../../Engines/thinEngine" {
+    export interface ThinEngine {
+        /**
+         * Creates a dynamic texture
+         * @param width defines the width of the texture
+         * @param height defines the height of the texture
+         * @param generateMipMaps defines if the engine should generate the mip levels
+         * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
+         * @returns the dynamic texture inside an InternalTexture
+         */
+        createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
+
+        /**
+         * Update the content of a dynamic texture
+         * @param texture defines the texture to update
+         * @param canvas defines the canvas containing the source
+         * @param invertY defines if data must be stored with Y axis inverted
+         * @param premulAlpha defines if alpha is stored as premultiplied
+         * @param format defines the format of the data
+         * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
+         */
+        updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean): void;
+    }
+}
+
+ThinEngine.prototype.createDynamicTexture = function(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture {
+    var texture = new InternalTexture(this, InternalTexture.DATASOURCE_DYNAMIC);
+    texture.baseWidth = width;
+    texture.baseHeight = height;
+
+    if (generateMipMaps) {
+        width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(width, this._caps.maxTextureSize) : width;
+        height = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(height, this._caps.maxTextureSize) : height;
+    }
+
+    //  this.resetTextureCache();
+    texture.width = width;
+    texture.height = height;
+    texture.isReady = false;
+    texture.generateMipMaps = generateMipMaps;
+    texture.samplingMode = samplingMode;
+
+    this.updateTextureSamplingMode(samplingMode, texture);
+
+    this._internalTexturesCache.push(texture);
+
+    return texture;
+};
+
+ThinEngine.prototype.updateDynamicTexture = function(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha: boolean = false, format?: number, forceBindTexture: boolean = false): void {
+    if (!texture) {
+        return;
+    }
+
+    this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true, forceBindTexture);
+    this._unpackFlipY(invertY);
+    if (premulAlpha) {
+        this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
+    }
+    let internalFormat = format ? this._getInternalFormat(format) : this._gl.RGBA;
+    this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, internalFormat, this._gl.UNSIGNED_BYTE, canvas);
+    if (texture.generateMipMaps) {
+        this._gl.generateMipmap(this._gl.TEXTURE_2D);
+    }
+    this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
+    if (premulAlpha) {
+        this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
+    }
+    texture.isReady = true;
+};

+ 11 - 11
src/Engines/Extensions/engine.rawTexture.ts

@@ -6,10 +6,10 @@ import { Tools } from '../../Misc/tools';
 import { Scene } from '../../scene';
 import { WebRequest } from '../../Misc/webRequest';
 import { Constants } from '../constants';
-import { ThinEngine } from '../thinEngine';
+import { Engine } from '../engine';
 
-declare module "../../Engines/thinEngine" {
-    export interface ThinEngine {
+declare module "../../Engines/engine" {
+    export interface Engine {
         /**
          * Creates a raw texture
          * @param data defines the data to store in the texture
@@ -174,7 +174,7 @@ declare module "../../Engines/thinEngine" {
     }
 }
 
-ThinEngine.prototype.updateRawTexture = function(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string> = null, type: number = Constants.TEXTURETYPE_UNSIGNED_INT): void {
+Engine.prototype.updateRawTexture = function(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string> = null, type: number = Constants.TEXTURETYPE_UNSIGNED_INT): void {
     if (!texture) {
         return;
     }
@@ -213,7 +213,7 @@ ThinEngine.prototype.updateRawTexture = function(texture: Nullable<InternalTextu
     texture.isReady = true;
 };
 
-ThinEngine.prototype.createRawTexture = function(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string> = null, type: number = Constants.TEXTURETYPE_UNSIGNED_INT): InternalTexture {
+Engine.prototype.createRawTexture = function(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string> = null, type: number = Constants.TEXTURETYPE_UNSIGNED_INT): InternalTexture {
     var texture = new InternalTexture(this, InternalTexture.DATASOURCE_RAW);
     texture.baseWidth = width;
     texture.baseHeight = height;
@@ -250,7 +250,7 @@ ThinEngine.prototype.createRawTexture = function(data: Nullable<ArrayBufferView>
     return texture;
 };
 
-ThinEngine.prototype.createRawCubeTexture = function(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number,
+Engine.prototype.createRawCubeTexture = function(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number,
     generateMipMaps: boolean, invertY: boolean, samplingMode: number,
     compression: Nullable<string> = null): InternalTexture {
     var gl = this._gl;
@@ -326,7 +326,7 @@ ThinEngine.prototype.createRawCubeTexture = function(data: Nullable<ArrayBufferV
     return texture;
 };
 
-ThinEngine.prototype.updateRawCubeTexture = function(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string> = null, level: number = 0): void {
+Engine.prototype.updateRawCubeTexture = function(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string> = null, level: number = 0): void {
     texture._bufferViewArray = data;
     texture.format = format;
     texture.type = type;
@@ -375,7 +375,7 @@ ThinEngine.prototype.updateRawCubeTexture = function(texture: InternalTexture, d
     texture.isReady = true;
 };
 
-ThinEngine.prototype.createRawCubeTextureFromUrl = function(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
+Engine.prototype.createRawCubeTextureFromUrl = function(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
     callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,
     mipmapGenerator: Nullable<((faces: ArrayBufferView[]) => ArrayBufferView[][])>,
     onLoad: Nullable<() => void> = null,
@@ -384,7 +384,7 @@ ThinEngine.prototype.createRawCubeTextureFromUrl = function(url: string, scene:
     invertY: boolean = false): InternalTexture {
 
     var gl = this._gl;
-    var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode);
+    var texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);
     scene._addPendingData(texture);
     texture.url = url;
     this._internalTexturesCache.push(texture);
@@ -453,7 +453,7 @@ ThinEngine.prototype.createRawCubeTextureFromUrl = function(url: string, scene:
     return texture;
 };
 
-ThinEngine.prototype.createRawTexture3D = function(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string> = null, textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT): InternalTexture {
+Engine.prototype.createRawTexture3D = function(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string> = null, textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT): InternalTexture {
     var texture = new InternalTexture(this, InternalTexture.DATASOURCE_RAW3D);
     texture.baseWidth = width;
     texture.baseHeight = height;
@@ -491,7 +491,7 @@ ThinEngine.prototype.createRawTexture3D = function(data: Nullable<ArrayBufferVie
     return texture;
 };
 
-ThinEngine.prototype.updateRawTexture3D = function(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string> = null, textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT): void {
+Engine.prototype.updateRawTexture3D = function(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string> = null, textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT): void {
     var internalType = this._getWebGLTextureType(textureType);
     var internalFormat = this._getInternalFormat(format);
     var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);

+ 141 - 0
src/Engines/Extensions/engine.uniformBuffer.ts

@@ -0,0 +1,141 @@
+import { ThinEngine } from "../../Engines/thinEngine";
+import { FloatArray, Nullable } from '../../types';
+import { DataBuffer } from '../../Meshes/dataBuffer';
+import { WebGLDataBuffer } from '../../Meshes/WebGL/webGLDataBuffer';
+import { IPipelineContext } from '../IPipelineContext';
+import { WebGLPipelineContext } from '../WebGL/webGLPipelineContext';
+
+declare module "../../Engines/thinEngine" {
+    export interface ThinEngine {
+        /**
+         * Create an uniform buffer
+         * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets
+         * @param elements defines the content of the uniform buffer
+         * @returns the webGL uniform buffer
+         */
+        createUniformBuffer(elements: FloatArray): DataBuffer;
+
+        /**
+         * Create a dynamic uniform buffer
+         * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets
+         * @param elements defines the content of the uniform buffer
+         * @returns the webGL uniform buffer
+         */
+        createDynamicUniformBuffer(elements: FloatArray): DataBuffer;
+
+        /**
+         * Update an existing uniform buffer
+         * @see http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets
+         * @param uniformBuffer defines the target uniform buffer
+         * @param elements defines the content to update
+         * @param offset defines the offset in the uniform buffer where update should start
+         * @param count defines the size of the data to update
+         */
+        updateUniformBuffer(uniformBuffer: DataBuffer, elements: FloatArray, offset?: number, count?: number): void;
+
+        /**
+         * Bind an uniform buffer to the current webGL context
+         * @param buffer defines the buffer to bind
+         */
+        bindUniformBuffer(buffer: Nullable<DataBuffer>): void;
+
+        /**
+         * Bind a buffer to the current webGL context at a given location
+         * @param buffer defines the buffer to bind
+         * @param location defines the index where to bind the buffer
+         */
+        bindUniformBufferBase(buffer: DataBuffer, location: number): void;
+
+         /**
+          * Bind a specific block at a given index in a specific shader program
+          * @param pipelineContext defines the pipeline context to use
+          * @param blockName defines the block name
+          * @param index defines the index where to bind the block
+          */
+        bindUniformBlock(pipelineContext: IPipelineContext, blockName: string, index: number): void;
+    }
+}
+
+ThinEngine.prototype.createUniformBuffer = function(elements: FloatArray): DataBuffer {
+    var ubo = this._gl.createBuffer();
+
+    if (!ubo) {
+        throw new Error("Unable to create uniform buffer");
+    }
+    let result = new WebGLDataBuffer(ubo);
+
+    this.bindUniformBuffer(result);
+
+    if (elements instanceof Float32Array) {
+        this._gl.bufferData(this._gl.UNIFORM_BUFFER, <Float32Array>elements, this._gl.STATIC_DRAW);
+    } else {
+        this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(<number[]>elements), this._gl.STATIC_DRAW);
+    }
+
+    this.bindUniformBuffer(null);
+
+    result.references = 1;
+    return result;
+};
+
+ThinEngine.prototype.createDynamicUniformBuffer = function(elements: FloatArray): DataBuffer {
+    var ubo = this._gl.createBuffer();
+
+    if (!ubo) {
+        throw new Error("Unable to create dynamic uniform buffer");
+    }
+
+    let result = new WebGLDataBuffer(ubo);
+    this.bindUniformBuffer(result);
+
+    if (elements instanceof Float32Array) {
+        this._gl.bufferData(this._gl.UNIFORM_BUFFER, <Float32Array>elements, this._gl.DYNAMIC_DRAW);
+    } else {
+        this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(<number[]>elements), this._gl.DYNAMIC_DRAW);
+    }
+
+    this.bindUniformBuffer(null);
+
+    result.references = 1;
+    return result;
+};
+
+ThinEngine.prototype.updateUniformBuffer = function(uniformBuffer: DataBuffer, elements: FloatArray, offset?: number, count?: number): void {
+   this.bindUniformBuffer(uniformBuffer);
+
+   if (offset === undefined) {
+       offset = 0;
+   }
+
+   if (count === undefined) {
+       if (elements instanceof Float32Array) {
+           this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, <Float32Array>elements);
+       } else {
+           this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(<number[]>elements));
+       }
+   } else {
+       if (elements instanceof Float32Array) {
+           this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, <Float32Array>elements.subarray(offset, offset + count));
+       } else {
+           this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(<number[]>elements).subarray(offset, offset + count));
+       }
+   }
+
+   this.bindUniformBuffer(null);
+};
+
+ThinEngine.prototype.bindUniformBuffer = function(buffer: Nullable<DataBuffer>): void {
+    this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer ? buffer.underlyingResource : null);
+};
+
+ThinEngine.prototype.bindUniformBufferBase = function(buffer: DataBuffer, location: number): void {
+    this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location, buffer ? buffer.underlyingResource : null);
+};
+
+ThinEngine.prototype.bindUniformBlock = function(pipelineContext: IPipelineContext, blockName: string, index: number): void {
+    let program = (pipelineContext as WebGLPipelineContext).program!;
+
+    var uniformLocation = this._gl.getUniformBlockIndex(program, blockName);
+
+    this._gl.uniformBlockBinding(program, uniformLocation, index);
+};

+ 74 - 0
src/Engines/Extensions/engine.videoTexture.ts

@@ -0,0 +1,74 @@
+import { ThinEngine } from "../../Engines/thinEngine";
+import { InternalTexture } from '../../Materials/Textures/internalTexture';
+import { Nullable } from '../../types';
+
+declare module "../../Engines/thinEngine" {
+    export interface ThinEngine {
+        /**
+         * Update a video texture
+         * @param texture defines the texture to update
+         * @param video defines the video element to use
+         * @param invertY defines if data must be stored with Y axis inverted
+         */
+        updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;
+    }
+}
+
+ThinEngine.prototype.updateVideoTexture = function(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void {
+    if (!texture || texture._isDisabled) {
+        return;
+    }
+
+    var wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
+    this._unpackFlipY(!invertY); // Video are upside down by default
+
+    try {
+        // Testing video texture support
+        if (this._videoTextureSupported === undefined) {
+            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video);
+
+            if (this._gl.getError() !== 0) {
+                this._videoTextureSupported = false;
+            } else {
+                this._videoTextureSupported = true;
+            }
+        }
+
+        // Copy video through the current working canvas if video texture is not supported
+        if (!this._videoTextureSupported) {
+            if (!texture._workingCanvas) {
+                texture._workingCanvas = document.createElement("canvas");
+                let context = texture._workingCanvas.getContext("2d");
+
+                if (!context) {
+                    throw new Error("Unable to get 2d context");
+                }
+
+                texture._workingContext = context;
+                texture._workingCanvas.width = texture.width;
+                texture._workingCanvas.height = texture.height;
+            }
+
+            texture._workingContext!.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height);
+
+            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, texture._workingCanvas);
+        } else {
+            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, video);
+        }
+
+        if (texture.generateMipMaps) {
+            this._gl.generateMipmap(this._gl.TEXTURE_2D);
+        }
+
+        if (!wasPreviouslyBound) {
+            this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
+        }
+        //    this.resetTextureCache();
+        texture.isReady = true;
+
+    } catch (ex) {
+        // Something unexpected
+        // Let's disable the texture
+        texture._isDisabled = true;
+    }
+};

+ 4 - 1
src/Engines/Extensions/index.ts

@@ -2,7 +2,10 @@ export * from "./engine.occlusionQuery";
 export * from "./engine.transformFeedback";
 export * from "./engine.multiview";
 export * from "./engine.rawTexture";
+export * from "./engine.dynamicTexture";
+export * from "./engine.videoTexture";
 export * from "./engine.multiRender";
 export * from "./engine.cubeTexture";
 export * from "./engine.renderTarget";
-export * from "./engine.webVR";
+export * from "./engine.webVR";
+export * from "./engine.uniformBuffer";

File diff ditekan karena terlalu besar
+ 1019 - 11
src/Engines/engine.ts


+ 0 - 1
src/Engines/index.ts

@@ -3,7 +3,6 @@ export * from "./engineCapabilities";
 export * from "./instancingAttributeInfo";
 export * from "./thinEngine";
 export * from "./engine";
-export * from "./engine.backwardCompatibility";
 export * from "./engineStore";
 export * from "./nullEngine";
 export * from "./Extensions/index";

+ 4 - 5
src/Engines/nullEngine.ts

@@ -7,7 +7,6 @@ import { VertexBuffer } from "../Meshes/buffer";
 import { InternalTexture } from "../Materials/Textures/internalTexture";
 import { Effect } from "../Materials/effect";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Constants } from "./constants";
 import { IPipelineContext } from './IPipelineContext';
 import { DataBuffer } from '../Meshes/dataBuffer';
@@ -460,7 +459,7 @@ export class NullEngine extends Engine {
             return;
         }
 
-        this._alphaState.alphaBlend = (mode !== Constants.ALPHA_DISABLE);
+        this.alphaState.alphaBlend = (mode !== Constants.ALPHA_DISABLE);
 
         if (!noDepthWriteChange) {
             this.setDepthWrite(mode === Constants.ALPHA_DISABLE);
@@ -494,9 +493,9 @@ export class NullEngine extends Engine {
         if (bruteForce) {
             this._currentProgram = null;
 
-            this._stencilState.reset();
-            this._depthCullingState.reset();
-            this._alphaState.reset();
+            this.stencilState.reset();
+            this.depthCullingState.reset();
+            this.alphaState.reset();
         }
 
         this._cachedVertexBuffers = null;

File diff ditekan karena terlalu besar
+ 129 - 1341
src/Engines/thinEngine.ts


+ 0 - 1
src/Events/pointerEvents.ts

@@ -2,7 +2,6 @@ import { Nullable } from "../types";
 import { Vector2 } from "../Maths/math.vector";
 import { PickingInfo } from "../Collisions/pickingInfo";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 
 declare type Ray = import("../Culling/ray").Ray;
 

+ 0 - 1
src/Gamepads/Controllers/daydreamController.ts

@@ -3,7 +3,6 @@ import { Scene } from "../../scene";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 
 import { GamepadButtonChanges } from "../../Gamepads/gamepad";
 import { WebVRController } from "./webVRController";

+ 0 - 2
src/Gamepads/Controllers/gearVRController.ts

@@ -4,8 +4,6 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { Mesh } from "../../Meshes/mesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
-
 import { GamepadButtonChanges } from "../../Gamepads/gamepad";
 import { WebVRController } from "./webVRController";
 import { PoseEnabledControllerType, ExtendedGamepadButton, PoseEnabledControllerHelper } from "./poseEnabledController";

+ 0 - 1
src/Gamepads/Controllers/genericController.ts

@@ -2,7 +2,6 @@ import { Scene } from "../../scene";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 
 import { WebVRController } from "./webVRController";
 import { ExtendedGamepadButton, PoseEnabledControllerHelper } from "./poseEnabledController";

+ 0 - 2
src/Gamepads/Controllers/oculusTouchController.ts

@@ -3,8 +3,6 @@ import { Scene } from "../../scene";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
-
 import { WebVRController } from "./webVRController";
 import { PoseEnabledControllerType, ExtendedGamepadButton, PoseEnabledControllerHelper } from "./poseEnabledController";
 import { GamepadButtonChanges } from "../../Gamepads/gamepad";

+ 0 - 1
src/Gamepads/Controllers/poseEnabledController.ts

@@ -6,7 +6,6 @@ import { TransformNode } from "../../Meshes/transformNode";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { Ray } from "../../Culling/ray";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { EngineStore } from "../../Engines/engineStore";
 
 import { Gamepad } from "../../Gamepads/gamepad";

+ 0 - 2
src/Gamepads/Controllers/viveController.ts

@@ -2,8 +2,6 @@ import { Scene } from "../../scene";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
-
 import { WebVRController } from "./webVRController";
 import { PoseEnabledControllerType, ExtendedGamepadButton, PoseEnabledControllerHelper } from "./poseEnabledController";
 import { GamepadButtonChanges } from "../../Gamepads/gamepad";

+ 0 - 1
src/Gamepads/Controllers/webVRController.ts

@@ -2,7 +2,6 @@ import { Observable } from "../../Misc/observable";
 import { Scene } from "../../scene";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { PoseEnabledController, ExtendedGamepadButton, MutableGamepadButton } from "./poseEnabledController";
 import { StickValues, GamepadButtonChanges } from "../../Gamepads/gamepad";
 import { Nullable } from '../../types';

+ 0 - 2
src/Gamepads/Controllers/windowsMotionController.ts

@@ -10,8 +10,6 @@ import { TransformNode } from "../../Meshes/transformNode";
 import { Ray } from "../../Culling/ray";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
-
 import { WebVRController } from "./webVRController";
 import { GenericController } from "./genericController";
 import { PoseEnabledController, PoseEnabledControllerType, ExtendedGamepadButton, PoseEnabledControllerHelper } from "./poseEnabledController";

+ 0 - 1
src/Gamepads/dualShockGamepad.ts

@@ -1,7 +1,6 @@
 import { Observable } from "../Misc/observable";
 import { Gamepad } from "./gamepad";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 
 /**
  * Defines supported buttons for DualShock compatible gamepads

+ 0 - 2
src/Gamepads/gamepad.ts

@@ -1,7 +1,5 @@
 import { Observable } from "../Misc/observable";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
-
 /**
  * Represents a gamepad control stick position
  */

+ 0 - 2
src/Gamepads/gamepadManager.ts

@@ -3,8 +3,6 @@ import { DomManagement } from "../Misc/domManagement";
 import { Nullable } from "../types";
 import { Scene } from "../scene";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
-
 import { PoseEnabledControllerHelper } from "../Gamepads/Controllers/poseEnabledController";
 import { Xbox360Pad } from "./xboxGamepad";
 import { Gamepad, GenericPad } from "./gamepad";

+ 0 - 2
src/Gamepads/gamepadSceneComponent.ts

@@ -2,8 +2,6 @@ import { Nullable } from "../types";
 import { Scene } from "../scene";
 import { SceneComponentConstants, ISceneComponent } from "../sceneComponent";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
-
 import { GamepadManager } from "./gamepadManager";
 
 import { FreeCameraInputsManager } from "../Cameras/freeCameraInputsManager";

+ 0 - 1
src/Gamepads/xboxGamepad.ts

@@ -1,7 +1,6 @@
 import { Observable } from "../Misc/observable";
 import { Gamepad } from "../Gamepads/gamepad";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 /**
  * Defines supported buttons for XBox360 compatible gamepads
  */

+ 0 - 1
src/Gizmos/axisDragGizmo.ts

@@ -9,7 +9,6 @@ import { LinesMesh } from "../Meshes/linesMesh";
 import { CylinderBuilder } from "../Meshes/Builders/cylinderBuilder";
 import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { StandardMaterial } from "../Materials/standardMaterial";

+ 0 - 1
src/Gizmos/axisScaleGizmo.ts

@@ -10,7 +10,6 @@ import { CylinderBuilder } from "../Meshes/Builders/cylinderBuilder";
 import { StandardMaterial } from "../Materials/standardMaterial";
 import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { ScaleGizmo } from "./scaleGizmo";

+ 0 - 1
src/Gizmos/boundingBoxGizmo.ts

@@ -11,7 +11,6 @@ import { BoxBuilder } from "../Meshes/Builders/boxBuilder";
 import { LinesBuilder } from "../Meshes/Builders/linesBuilder";
 import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { StandardMaterial } from "../Materials/standardMaterial";

+ 0 - 1
src/Gizmos/gizmo.ts

@@ -6,7 +6,6 @@ import { Quaternion, Vector3 } from "../Maths/math.vector";
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Mesh } from "../Meshes/mesh";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 /**
  * Renders gizmos on top of an existing scene which provide controls for position, rotation, etc.

+ 0 - 1
src/Gizmos/gizmoManager.ts

@@ -5,7 +5,6 @@ import { Scene, IDisposable } from "../scene";
 import { Node } from "../node";
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { Color3 } from '../Maths/math.color';
 import { SixDofDragBehavior } from "../Behaviors/Meshes/sixDofDragBehavior";

+ 0 - 1
src/Gizmos/planeDragGizmo.ts

@@ -9,7 +9,6 @@ import { Mesh } from "../Meshes/mesh";
 import { PlaneBuilder } from "../Meshes/Builders/planeBuilder";
 import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { StandardMaterial } from "../Materials/standardMaterial";

+ 0 - 1
src/Gizmos/planeRotationGizmo.ts

@@ -8,7 +8,6 @@ import { Mesh } from "../Meshes/mesh";
 import { LinesMesh } from "../Meshes/linesMesh";
 import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";
 import { StandardMaterial } from "../Materials/standardMaterial";

+ 0 - 1
src/Gizmos/positionGizmo.ts

@@ -6,7 +6,6 @@ import { Color3 } from '../Maths/math.color';
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Mesh } from "../Meshes/mesh";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { AxisDragGizmo } from "./axisDragGizmo";
 import { PlaneDragGizmo } from "./planeDragGizmo";

+ 0 - 1
src/Gizmos/rotationGizmo.ts

@@ -6,7 +6,6 @@ import { Color3 } from '../Maths/math.color';
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Mesh } from "../Meshes/mesh";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Gizmo } from "./gizmo";
 import { PlaneRotationGizmo } from "./planeRotationGizmo";
 import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer";

+ 0 - 1
src/Helpers/environmentHelper.ts

@@ -12,7 +12,6 @@ import { MirrorTexture } from "../Materials/Textures/mirrorTexture";
 import { CubeTexture } from "../Materials/Textures/cubeTexture";
 import { BackgroundMaterial } from "../Materials/Background/backgroundMaterial";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Constants } from "../Engines/constants";
 
 import "../Meshes/Builders/planeBuilder";

+ 0 - 1
src/Helpers/photoDome.ts

@@ -6,7 +6,6 @@ import { Mesh } from "../Meshes/mesh";
 import { Texture } from "../Materials/Textures/texture";
 import { BackgroundMaterial } from "../Materials/Background/backgroundMaterial";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import "../Meshes/Builders/sphereBuilder";
 import { Vector3 } from '../Maths/math.vector';
 import { Camera } from '../Cameras/camera';

+ 0 - 1
src/Helpers/videoDome.ts

@@ -2,7 +2,6 @@ import { Scene } from "../scene";
 import { TransformNode } from "../Meshes/transformNode";
 import { Mesh } from "../Meshes/mesh";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Texture } from "../Materials/Textures/texture";
 import { VideoTexture, VideoTextureSettings } from "../Materials/Textures/videoTexture";
 import { BackgroundMaterial } from "../Materials/Background/backgroundMaterial";

+ 0 - 1
src/Instrumentation/engineInstrumentation.ts

@@ -4,7 +4,6 @@ import { Nullable } from "../types";
 import { IDisposable } from "../scene";
 import { Engine } from "../Engines/engine";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 /**
  * This class can be used to get instrumentation data from a Babylon engine
  * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#engineinstrumentation

+ 0 - 1
src/Instrumentation/sceneInstrumentation.ts

@@ -4,7 +4,6 @@ import { Nullable } from "../types";
 import { Camera } from "../Cameras/camera";
 import { Scene, IDisposable } from "../scene";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { PerfCounter } from '../Misc/perfCounter';
 /**
  * This class can be used to get instrumentation data from a Babylon engine

+ 0 - 1
src/Instrumentation/timeToken.ts

@@ -1,5 +1,4 @@
 import { Nullable } from "../types";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 /**
  * @hidden
  **/

+ 0 - 1
src/Layers/effectLayer.ts

@@ -15,7 +15,6 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Mesh } from "../Meshes/mesh";
 import { PostProcess } from "../PostProcesses/postProcess";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { BaseTexture } from "../Materials/Textures/baseTexture";
 import { Texture } from "../Materials/Textures/texture";
 import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";

+ 0 - 1
src/Layers/effectLayerSceneComponent.ts

@@ -5,7 +5,6 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
 import { SceneComponentConstants, ISceneSerializableComponent } from "../sceneComponent";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { EffectLayer } from "./effectLayer";
 import { AbstractScene } from "../abstractScene";
 import { AssetContainer } from "../assetContainer";

+ 0 - 1
src/Layers/highlightLayer.ts

@@ -17,7 +17,6 @@ import { PostProcess, PostProcessOptions } from "../PostProcesses/postProcess";
 import { PassPostProcess } from "../PostProcesses/passPostProcess";
 import { BlurPostProcess } from "../PostProcesses/blurPostProcess";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { EffectLayer } from "./effectLayer";
 import { AbstractScene } from "../abstractScene";
 import { Constants } from "../Engines/constants";

+ 0 - 1
src/Layers/layer.ts

@@ -10,7 +10,6 @@ import { Material } from "../Materials/material";
 import { Texture } from "../Materials/Textures/texture";
 import { SceneComponentConstants } from "../sceneComponent";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { LayerSceneComponent } from "./layerSceneComponent";
 import { Constants } from "../Engines/constants";
 import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";

+ 0 - 1
src/Layers/layerSceneComponent.ts

@@ -3,7 +3,6 @@ import { Scene } from "../scene";
 import { Engine } from "../Engines/engine";
 import { SceneComponentConstants, ISceneComponent } from "../sceneComponent";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Layer } from "./layer";
 import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
 import { AbstractScene } from '../abstractScene';

+ 0 - 1
src/LensFlares/lensFlare.ts

@@ -2,7 +2,6 @@ import { Nullable } from "../types";
 import { Color3 } from "../Maths/math.color";
 import { Texture } from "../Materials/Textures/texture";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { LensFlareSystem } from "./lensFlareSystem";
 import { Constants } from "../Engines/constants";
 /**

+ 0 - 1
src/LensFlares/lensFlareSystem.ts

@@ -10,7 +10,6 @@ import { Ray } from "../Culling/ray";
 import { Effect } from "../Materials/effect";
 import { Material } from "../Materials/material";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { LensFlare } from "./lensFlare";
 import { Constants } from "../Engines/constants";
 

+ 0 - 1
src/LensFlares/lensFlareSystemSceneComponent.ts

@@ -4,7 +4,6 @@ import { Camera } from "../Cameras/camera";
 import { Scene } from "../scene";
 import { SceneComponentConstants, ISceneSerializableComponent } from "../sceneComponent";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { AbstractScene } from "../abstractScene";
 import { AssetContainer } from "../assetContainer";
 import { LensFlareSystem } from "./lensFlareSystem";

+ 0 - 1
src/Lights/Shadows/shadowGenerator.ts

@@ -21,7 +21,6 @@ import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTextur
 import { PostProcess } from "../../PostProcesses/postProcess";
 import { BlurPostProcess } from "../../PostProcesses/blurPostProcess";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 
 import "../../Shaders/shadowMap.fragment";

+ 0 - 1
src/Lights/Shadows/shadowGeneratorSceneComponent.ts

@@ -4,7 +4,6 @@ import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTextur
 import { ShadowGenerator } from "./shadowGenerator";
 import { SceneComponentConstants, ISceneSerializableComponent } from "../../sceneComponent";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { AbstractScene } from "../../abstractScene";
 // Adds the parser to the scene parsers.
 AbstractScene.AddParser(SceneComponentConstants.NAME_SHADOWGENERATOR, (parsedData: any, scene: Scene) => {

+ 0 - 1
src/Lights/directionalLight.ts

@@ -7,7 +7,6 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Light } from "./light";
 import { ShadowLight } from "./shadowLight";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Effect } from "../Materials/effect";
 Node.AddNodeConstructor("Light_Type_1", (name, scene) => {
     return () => new DirectionalLight(name, Vector3.Zero(), scene);

+ 0 - 1
src/Lights/hemisphericLight.ts

@@ -8,7 +8,6 @@ import { Effect } from "../Materials/effect";
 import { Light } from "./light";
 import { IShadowGenerator } from "./Shadows/shadowGenerator";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 
 Node.AddNodeConstructor("Light_Type_3", (name, scene) => {
     return () => new HemisphericLight(name, Vector3.Zero(), scene);

+ 0 - 1
src/Lights/pointLight.ts

@@ -6,7 +6,6 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Light } from "./light";
 import { ShadowLight } from "./shadowLight";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Effect } from "../Materials/effect";
 
 Node.AddNodeConstructor("Light_Type_0", (name, scene) => {

+ 0 - 1
src/Lights/shadowLight.ts

@@ -5,7 +5,6 @@ import { Matrix, Vector3 } from "../Maths/math.vector";
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Light } from "./light";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Axis } from '../Maths/math.axis';
 /**
  * Interface describing all the common properties and methods a shadow light needs to implement.

+ 0 - 1
src/Lights/spotLight.ts

@@ -9,7 +9,6 @@ import { BaseTexture } from "../Materials/Textures/baseTexture";
 import { Light } from "./light";
 import { ShadowLight } from "./shadowLight";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Texture } from '../Materials/Textures/texture';
 
 Node.AddNodeConstructor("Light_Type_2", (name, scene) => {

+ 0 - 1
src/Loading/Plugins/babylonFileLoader.ts

@@ -17,7 +17,6 @@ import { Light } from "../../Lights/light";
 import { SceneComponentConstants } from "../../sceneComponent";
 import { _TimeToken } from "../../Instrumentation/timeToken";
 import { SceneLoader } from "../../Loading/sceneLoader";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { AbstractScene } from "../../abstractScene";
 import { AssetContainer } from "../../assetContainer";
 import { ActionManager } from "../../Actions/actionManager";

+ 0 - 1
src/Loading/loadingScreen.ts

@@ -1,6 +1,5 @@
 import { Nullable } from "../types";
 import { _TimeToken } from "../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { Engine } from "../Engines/engine";
 /**
  * Interface used to present a loading screen while loading a scene

+ 0 - 1
src/Loading/sceneLoader.ts

@@ -9,7 +9,6 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { AnimationGroup } from "../Animations/animationGroup";
 import { _TimeToken } from "../Instrumentation/timeToken";
 import { IOfflineProvider } from "../Offline/IOfflineProvider";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index";
 import { AssetContainer } from "../assetContainer";
 import { IParticleSystem } from "../Particles/IParticleSystem";
 import { Skeleton } from "../Bones/skeleton";

+ 0 - 1
src/Materials/Background/backgroundMaterial.ts

@@ -20,7 +20,6 @@ import { Texture } from "../../Materials/Textures/texture";
 import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture";
 import { IShadowLight } from "../../Lights/shadowLight";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 import { _TypeStore } from "../../Misc/typeStore";
 import { MaterialFlags } from "../materialFlags";

+ 0 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -12,7 +12,6 @@ import { SubMesh } from "../../Meshes/subMesh";
 import { AbstractMesh } from "../../Meshes/abstractMesh";
 import { Mesh } from "../../Meshes/mesh";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { IMaterialClearCoatDefines, PBRClearCoatConfiguration } from "./pbrClearCoatConfiguration";
 import { IMaterialAnisotropicDefines, PBRAnisotropicConfiguration } from "./pbrAnisotropicConfiguration";
 import { IMaterialBRDFDefines, PBRBRDFConfiguration } from "./pbrBRDFConfiguration";

+ 0 - 1
src/Materials/PBR/pbrBaseSimpleMaterial.ts

@@ -5,7 +5,6 @@ import { PBRBaseMaterial } from "./pbrBaseMaterial";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 /**
  * The Physically based simple base material of BJS.
  *

+ 0 - 1
src/Materials/PBR/pbrMaterial.ts

@@ -4,7 +4,6 @@ import { Nullable } from "../../types";
 import { Scene } from "../../scene";
 import { Color3 } from "../../Maths/math.color";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { ImageProcessingConfiguration } from "../../Materials/imageProcessingConfiguration";
 import { ColorCurves } from "../../Materials/colorCurves";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";

+ 0 - 1
src/Materials/PBR/pbrMetallicRoughnessMaterial.ts

@@ -2,7 +2,6 @@ import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, se
 import { Scene } from "../../scene";
 import { Color3 } from "../../Maths/math.color";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
 import { _TypeStore } from '../../Misc/typeStore';

+ 0 - 1
src/Materials/PBR/pbrSpecularGlossinessMaterial.ts

@@ -2,7 +2,6 @@ import { serialize, SerializationHelper, serializeAsColor3, expandToProperty, se
 import { Scene } from "../../scene";
 import { Color3 } from "../../Maths/math.color";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { PBRBaseSimpleMaterial } from "./pbrBaseSimpleMaterial";
 import { _TypeStore } from '../../Misc/typeStore';

+ 0 - 1
src/Materials/Textures/Loaders/basisTextureLoader.ts

@@ -3,7 +3,6 @@ import { Engine } from "../../../Engines/engine";
 import { InternalTexture } from "../../../Materials/Textures/internalTexture";
 import { IInternalTextureLoader } from "../../../Materials/Textures/internalTextureLoader";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 import { BasisTools } from "../../../Misc/basis";
 import { Tools } from '../../../Misc/tools';
 

+ 2 - 3
src/Materials/Textures/Loaders/ddsTextureLoader.ts

@@ -4,7 +4,6 @@ import { Engine } from "../../../Engines/engine";
 import { InternalTexture } from "../../../Materials/Textures/internalTexture";
 import { IInternalTextureLoader } from "../../../Materials/Textures/internalTextureLoader";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 import { DDSTools, DDSInfo } from "../../../Misc/dds";
 /**
  * Implementation of the DDS Texture Loader.
@@ -76,7 +75,7 @@ export class _DDSTextureLoader implements IInternalTextureLoader {
                 DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6, -1, index);
 
                 if (!info.isFourCC && info.mipmapCount === 1) {
-                    engine.generateMipMapsForCubemap(texture);
+                    (engine as Engine).generateMipMapsForCubemap(texture);
                 }
             }
         }
@@ -97,7 +96,7 @@ export class _DDSTextureLoader implements IInternalTextureLoader {
             DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6);
 
             if (!info.isFourCC && info.mipmapCount === 1) {
-                engine.generateMipMapsForCubemap(texture);
+                (engine as Engine).generateMipMapsForCubemap(texture);
             }
         }
 

+ 0 - 1
src/Materials/Textures/Loaders/envTextureLoader.ts

@@ -4,7 +4,6 @@ import { Engine } from "../../../Engines/engine";
 import { InternalTexture } from "../../../Materials/Textures/internalTexture";
 import { IInternalTextureLoader } from "../../../Materials/Textures/internalTextureLoader";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 /**
  * Implementation of the ENV Texture Loader.
  * @hidden

+ 0 - 1
src/Materials/Textures/Loaders/ktxTextureLoader.ts

@@ -4,7 +4,6 @@ import { Engine } from "../../../Engines/engine";
 import { InternalTexture } from "../../../Materials/Textures/internalTexture";
 import { IInternalTextureLoader } from "../../../Materials/Textures/internalTextureLoader";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 /**
  * Implementation of the KTX Texture Loader.
  * @hidden

+ 0 - 1
src/Materials/Textures/Loaders/tgaTextureLoader.ts

@@ -4,7 +4,6 @@ import { Engine } from "../../../Engines/engine";
 import { InternalTexture } from "../../../Materials/Textures/internalTexture";
 import { IInternalTextureLoader } from "../../../Materials/Textures/internalTextureLoader";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 /**
  * Implementation of the TGA Texture Loader.
  * @hidden

+ 0 - 1
src/Materials/Textures/Procedurals/customProceduralTexture.ts

@@ -3,7 +3,6 @@ import { Scene } from "../../../scene";
 import { Vector3, Vector2 } from "../../../Maths/math.vector";
 import { Color4, Color3 } from '../../../Maths/math.color';
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 import { Texture } from "../../../Materials/Textures/texture";
 import { ProceduralTexture } from "./proceduralTexture";
 import { WebRequest } from '../../../Misc/webRequest';

+ 0 - 1
src/Materials/Textures/Procedurals/noiseProceduralTexture.ts

@@ -2,7 +2,6 @@ import { Nullable } from "../../../types";
 import { Scene } from "../../../scene";
 import { EngineStore } from "../../../Engines/engineStore";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 import { Texture } from "../../../Materials/Textures/texture";
 import { ProceduralTexture } from "./proceduralTexture";
 import { _TypeStore } from '../../../Misc/typeStore';

+ 0 - 1
src/Materials/Textures/Procedurals/proceduralTexture.ts

@@ -8,7 +8,6 @@ import { Engine } from "../../../Engines/engine";
 import { VertexBuffer } from "../../../Meshes/buffer";
 import { SceneComponentConstants } from "../../../sceneComponent";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 
 import { Material } from "../../../Materials/material";
 import { Effect } from "../../../Materials/effect";

+ 0 - 1
src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts

@@ -2,7 +2,6 @@ import { Tools } from "../../../Misc/tools";
 import { Scene } from "../../../scene";
 import { SceneComponentConstants, ISceneComponent } from "../../../sceneComponent";
 import { _TimeToken } from "../../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../../States/index";
 
 import { ProceduralTexture } from "./proceduralTexture";
 

+ 0 - 1
src/Materials/Textures/baseTexture.ts

@@ -8,7 +8,6 @@ import { SphericalPolynomial } from "../../Maths/sphericalPolynomial";
 import { EngineStore } from "../../Engines/engineStore";
 import { InternalTexture } from "../../Materials/Textures/internalTexture";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 import { IAnimatable } from '../../Animations/animatable.interface';
 import { GUID } from '../../Misc/guid';

+ 3 - 4
src/Materials/Textures/colorGradingTexture.ts

@@ -5,7 +5,6 @@ import { Engine } from "../../Engines/engine";
 import { InternalTexture } from "../../Materials/Textures/internalTexture";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 import { _TypeStore } from '../../Misc/typeStore';
 
@@ -84,13 +83,13 @@ export class ColorGradingTexture extends BaseTexture {
      * Occurs when the file being loaded is a .3dl LUT file.
      */
     private load3dlTexture() {
-        var engine = this._engine;
+        var engine = this._engine as Engine;
         var texture: InternalTexture;
         if (engine.webGLVersion === 1) {
-            texture = engine.createRawTexture(null, 1, 1, Constants.TEXTUREFORMAT_RGBA, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);
+            texture = engine.createRawTexture(null, 1, 1, Constants.TEXTUREFORMAT_RGBA, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, null, Constants.TEXTURETYPE_UNSIGNED_INT);
         }
         else {
-            texture = engine.createRawTexture3D(null, 1, 1, 1, Constants.TEXTUREFORMAT_RGBA, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);
+            texture = engine.createRawTexture3D(null, 1, 1, 1, Constants.TEXTUREFORMAT_RGBA, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, null, Constants.TEXTURETYPE_UNSIGNED_INT);
         }
 
         this._texture = texture;

+ 0 - 1
src/Materials/Textures/cubeTexture.ts

@@ -6,7 +6,6 @@ import { Matrix, Vector3 } from "../../Maths/math.vector";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { Texture } from "../../Materials/Textures/texture";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 import { _TypeStore } from '../../Misc/typeStore';
 

+ 2 - 1
src/Materials/Textures/dynamicTexture.ts

@@ -5,8 +5,9 @@ import { ISize } from "../../Maths/math.size";
 import { Engine } from "../../Engines/engine";
 import { Texture } from "../../Materials/Textures/texture";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
+import "../../Engines/Extensions/engine.dynamicTexture";
+
 /**
  * A class extending Texture allowing drawing on a texture
  * @see http://doc.babylonjs.com/how_to/dynamictexture

+ 0 - 1
src/Materials/Textures/hdrCubeTexture.ts

@@ -5,7 +5,6 @@ import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { Texture } from "../../Materials/Textures/texture";
 import { Constants } from "../../Engines/constants";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { HDRTools } from "../../Misc/HighDynamicRange/hdr";
 import { CubeMapToSphericalPolynomialTools } from "../../Misc/HighDynamicRange/cubemapToSphericalPolynomial";
 import { _TypeStore } from '../../Misc/typeStore';

+ 2 - 2
src/Materials/Textures/internalTexture.ts

@@ -3,9 +3,9 @@ import { Nullable, int } from "../../types";
 import { SphericalPolynomial } from "../../Maths/sphericalPolynomial";
 import { RenderTargetCreationOptions } from "../../Materials/Textures/renderTargetCreationOptions";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 import { Constants } from "../../Engines/constants";
 import { _DevTools } from '../../Misc/devTools';
+import { Engine } from '../../Engines/engine';
 
 declare type ThinEngine = import("../../Engines/thinEngine").ThinEngine;
 declare type BaseTexture = import("../../Materials/Textures/baseTexture").BaseTexture;
@@ -354,7 +354,7 @@ export class InternalTexture {
                         height: this.height
                     };
 
-                    proxy = this._engine.createRenderTargetTexture(size, options);
+                    proxy = (this._engine as Engine).createRenderTargetTexture(size, options);
                 }
                 proxy._swapAndDie(this);
 

+ 0 - 1
src/Materials/Textures/internalTextureLoader.ts

@@ -1,7 +1,6 @@
 import { Nullable } from "../../types";
 import { InternalTexture } from "../../Materials/Textures/internalTexture";
 import { _TimeToken } from "../../Instrumentation/timeToken";
-import { _DepthCullingState, _StencilState, _AlphaState } from "../../States/index";
 /**
  * This represents the required contract to create a new type of texture loader.
  */

+ 2 - 1
src/Materials/Textures/rawCubeTexture.ts

@@ -7,6 +7,7 @@ import { InternalTexture } from "./internalTexture";
 import { CubeTexture } from "./cubeTexture";
 import { Constants } from "../../Engines/constants";
 import "../../Engines/Extensions/engine.rawTexture";
+import { Engine } from '../../Engines/engine';
 
 /**
  * Raw cube texture where the raw buffers are passed in
@@ -43,7 +44,7 @@ export class RawCubeTexture extends CubeTexture {
      * @param level defines which level of the texture to update
      */
     public update(data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string> = null): void {
-        this._texture!.getEngine().updateRawCubeTexture(this._texture!, data, format, type, invertY, compression);
+        (this._texture!.getEngine() as Engine).updateRawCubeTexture(this._texture!, data, format, type, invertY, compression);
     }
 
     /**

+ 1 - 1
src/Materials/Textures/rawTexture3D.ts

@@ -41,7 +41,7 @@ export class RawTexture3D extends Texture {
             generateMipMaps,
             invertY,
             samplingMode,
-            undefined,
+            null,
             textureType
         );
 

+ 0 - 1
src/Materials/Textures/texture.ts

@@ -5,7 +5,6 @@ import { Scene } from "../../scene";
 import { Matrix, Vector3 } from "../../Maths/math.vector";
 import { BaseTexture } from "../../Materials/Textures/baseTexture";
 import { Constants } from "../../Engines/constants";
-import { _AlphaState } from "../../States/index";
 import { _TypeStore } from '../../Misc/typeStore';
 import { _DevTools } from '../../Misc/devTools';
 import { IInspectable } from '../../Misc/iInspectable';

+ 3 - 0
src/Materials/Textures/videoTexture.ts

@@ -5,6 +5,9 @@ import { Nullable } from "../../types";
 import { Scene } from "../../scene";
 import { Engine } from "../../Engines/engine";
 import { Texture } from "../../Materials/Textures/texture";
+
+import "../../Engines/Extensions/engine.videoTexture";
+
 /**
  * Settings for finer control over video usage
  */

+ 1 - 1
src/Materials/effect.ts

@@ -290,7 +290,7 @@ export class Effect implements IDisposable {
      * @param onError Callback that will be called if an error occurs during shader compilation.
      * @param indexParameters Parameters to be used with Babylons include syntax to iterate over an array (eg. {lights: 10})
      */
-    constructor(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | ThinEngine, samplers: Nullable<string[]> = null, 
+    constructor(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | ThinEngine, samplers: Nullable<string[]> = null,
         engine?: ThinEngine, defines: Nullable<string> = null,
         fallbacks: Nullable<EffectFallbacks> = null, onCompiled: Nullable<(effect: Effect) => void> = null, onError: Nullable<(effect: Effect, errors: string) => void> = null, indexParameters?: any) {
         this.name = baseName;

+ 3 - 0
src/Materials/uniformBuffer.ts

@@ -7,6 +7,9 @@ import { BaseTexture } from "../Materials/Textures/baseTexture";
 import { DataBuffer } from '../Meshes/dataBuffer';
 import { Color3 } from '../Maths/math.color';
 import { IMatrixLike } from '../Maths/math.like';
+
+import "../Engines/Extensions/engine.uniformBuffer";
+
 /**
  * Uniform buffer objects.
  *

+ 0 - 3
src/Misc/performanceMonitor.ts

@@ -1,6 +1,5 @@
 import { Nullable } from "../types";
 import { PrecisionDate } from "./precisionDate";
-import { Engine } from '../Engines/engine';
 
 /**
  * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
@@ -224,5 +223,3 @@ export class RollingAverage {
         return ((i % max) + max) % max;
     }
 }
-
-Engine.DefaultPerformanceMonitorFactory = () => { return new PerformanceMonitor(); };

+ 1 - 1
src/States/alphaCullingState.ts

@@ -3,7 +3,7 @@ import { Nullable } from "../types";
 /**
  * @hidden
  **/
-export class _AlphaState {
+export class AlphaState {
     private _isAlphaBlendDirty = false;
     private _isBlendFunctionParametersDirty = false;
     private _isBlendEquationParametersDirty = false;

+ 0 - 0
src/States/depthCullingState.ts


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini