David `Deltakosh` Catuhe 4 lat temu
rodzic
commit
fc63e32487

+ 6 - 4
dist/preview release/babylon.d.ts

@@ -11796,8 +11796,9 @@ declare module BABYLON {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -44330,7 +44331,6 @@ declare module BABYLON {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -53201,8 +53201,6 @@ declare module BABYLON {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -53235,6 +53233,10 @@ declare module BABYLON {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module BABYLON {

Plik diff jest za duży
+ 1 - 1
dist/preview release/babylon.js


+ 185 - 205
dist/preview release/babylon.max.js

@@ -15043,11 +15043,6 @@ var FlyCameraMouseInput = /** @class */ (function () {
                 _this.camera.restoreRoll(_this.camera.rollCorrect);
             }
         });
-        // Helper function to keep 'this'.
-        this._mousemoveCallback = function (e) {
-            _this._onMouseMove(e);
-        };
-        element.addEventListener("mousemove", this._mousemoveCallback, false);
     };
     /**
      * Detach the current controls from the specified dom element.
@@ -15057,9 +15052,6 @@ var FlyCameraMouseInput = /** @class */ (function () {
         if (this._observer && element) {
             this.camera.getScene().onPointerObservable.remove(this._observer);
             this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver);
-            if (this._mousemoveCallback) {
-                element.removeEventListener("mousemove", this._mousemoveCallback);
-            }
             this._observer = null;
             this._rollObserver = null;
             this.previousPosition = null;
@@ -15113,6 +15105,10 @@ var FlyCameraMouseInput = /** @class */ (function () {
                 e.preventDefault();
                 this.element.focus();
             }
+            // This is required to move while pointer button is down
+            if (engine.isPointerLock) {
+                this._onMouseMove(p.event);
+            }
         }
         else 
         // Mouse up.
@@ -15132,7 +15128,10 @@ var FlyCameraMouseInput = /** @class */ (function () {
         else 
         // Mouse move.
         if (p.type === _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_3__["PointerEventTypes"].POINTERMOVE) {
-            if (!this.previousPosition || engine.isPointerLock) {
+            if (!this.previousPosition) {
+                if (engine.isPointerLock) {
+                    this._onMouseMove(p.event);
+                }
                 return;
             }
             var offsetX = e.clientX - this.previousPosition.x;
@@ -16611,7 +16610,10 @@ var FreeCameraMouseInput = /** @class */ (function () {
                     }
                 }
                 else if (p.type === _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_4__["PointerEventTypes"].POINTERMOVE) {
-                    if (!_this.previousPosition || engine.isPointerLock) {
+                    if (!_this.previousPosition) {
+                        if (engine.isPointerLock && _this._onMouseMove) {
+                            _this._onMouseMove(p.event);
+                        }
                         return;
                     }
                     var offsetX = evt.clientX - _this.previousPosition.x;
@@ -16660,7 +16662,6 @@ var FreeCameraMouseInput = /** @class */ (function () {
             }
         };
         this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_4__["PointerEventTypes"].POINTERDOWN | _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_4__["PointerEventTypes"].POINTERUP | _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_4__["PointerEventTypes"].POINTERMOVE);
-        element.addEventListener("mousemove", this._onMouseMove, false);
         element.addEventListener("contextmenu", this.onContextMenu.bind(this), false);
     };
     /**
@@ -16677,9 +16678,6 @@ var FreeCameraMouseInput = /** @class */ (function () {
     FreeCameraMouseInput.prototype.detachControl = function (element) {
         if (this._observer && element) {
             this.camera.getScene().onPointerObservable.remove(this._observer);
-            if (this._onMouseMove) {
-                element.removeEventListener("mousemove", this._onMouseMove);
-            }
             if (this.onContextMenu) {
                 element.removeEventListener("contextmenu", this.onContextMenu);
             }
@@ -37310,18 +37308,20 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NativeEngine", function() { return NativeEngine; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
 /* harmony import */ var _Engines_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Engines/engine */ "./Engines/engine.ts");
-/* harmony import */ var _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Materials/Textures/internalTexture */ "./Materials/Textures/internalTexture.ts");
-/* harmony import */ var _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Materials/Textures/texture */ "./Materials/Textures/texture.ts");
-/* harmony import */ var _Meshes_dataBuffer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Meshes/dataBuffer */ "./Meshes/dataBuffer.ts");
-/* harmony import */ var _Misc_tools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Misc/tools */ "./Misc/tools.ts");
-/* harmony import */ var _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Misc/environmentTextureTools */ "./Misc/environmentTextureTools.ts");
-/* harmony import */ var _Materials_Textures_renderTargetCreationOptions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Materials/Textures/renderTargetCreationOptions */ "./Materials/Textures/renderTargetCreationOptions.ts");
-/* harmony import */ var _Misc_logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Misc/logger */ "./Misc/logger.ts");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./Engines/constants.ts");
-/* harmony import */ var _thinEngine__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./thinEngine */ "./Engines/thinEngine.ts");
-/* harmony import */ var _engineStore__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./engineStore */ "./Engines/engineStore.ts");
-/* harmony import */ var _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Processors/shaderCodeInliner */ "./Engines/Processors/shaderCodeInliner.ts");
-/* harmony import */ var _Engines_WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Engines/WebGL/webGL2ShaderProcessors */ "./Engines/WebGL/webGL2ShaderProcessors.ts");
+/* harmony import */ var _Meshes_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Meshes/buffer */ "./Meshes/buffer.ts");
+/* harmony import */ var _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Materials/Textures/internalTexture */ "./Materials/Textures/internalTexture.ts");
+/* harmony import */ var _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Materials/Textures/texture */ "./Materials/Textures/texture.ts");
+/* harmony import */ var _Meshes_dataBuffer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Meshes/dataBuffer */ "./Meshes/dataBuffer.ts");
+/* harmony import */ var _Misc_tools__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Misc/tools */ "./Misc/tools.ts");
+/* harmony import */ var _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Misc/environmentTextureTools */ "./Misc/environmentTextureTools.ts");
+/* harmony import */ var _Materials_Textures_renderTargetCreationOptions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Materials/Textures/renderTargetCreationOptions */ "./Materials/Textures/renderTargetCreationOptions.ts");
+/* harmony import */ var _Misc_logger__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Misc/logger */ "./Misc/logger.ts");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./constants */ "./Engines/constants.ts");
+/* harmony import */ var _thinEngine__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./thinEngine */ "./Engines/thinEngine.ts");
+/* harmony import */ var _engineStore__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./engineStore */ "./Engines/engineStore.ts");
+/* harmony import */ var _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Processors/shaderCodeInliner */ "./Engines/Processors/shaderCodeInliner.ts");
+/* harmony import */ var _Engines_WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Engines/WebGL/webGL2ShaderProcessors */ "./Engines/WebGL/webGL2ShaderProcessors.ts");
+
 
 
 
@@ -37363,72 +37363,7 @@ var NativeDataBuffer = /** @class */ (function (_super) {
         return _super !== null && _super.apply(this, arguments) || this;
     }
     return NativeDataBuffer;
-}(_Meshes_dataBuffer__WEBPACK_IMPORTED_MODULE_4__["DataBuffer"]));
-// TODO: change this to match bgfx.
-// Must match Filter enum in SpectreEngine.h.
-var NativeFilter = /** @class */ (function () {
-    function NativeFilter() {
-    }
-    NativeFilter.POINT = 0;
-    NativeFilter.MINPOINT_MAGPOINT_MIPPOINT = NativeFilter.POINT;
-    NativeFilter.BILINEAR = 1;
-    NativeFilter.MINLINEAR_MAGLINEAR_MIPPOINT = NativeFilter.BILINEAR;
-    NativeFilter.TRILINEAR = 2;
-    NativeFilter.MINLINEAR_MAGLINEAR_MIPLINEAR = NativeFilter.TRILINEAR;
-    NativeFilter.ANISOTROPIC = 3;
-    NativeFilter.POINT_COMPARE = 4;
-    NativeFilter.TRILINEAR_COMPARE = 5;
-    NativeFilter.MINBILINEAR_MAGPOINT = 6;
-    NativeFilter.MINLINEAR_MAGPOINT_MIPLINEAR = NativeFilter.MINBILINEAR_MAGPOINT;
-    NativeFilter.MINPOINT_MAGPOINT_MIPLINEAR = 7;
-    NativeFilter.MINPOINT_MAGLINEAR_MIPPOINT = 8;
-    NativeFilter.MINPOINT_MAGLINEAR_MIPLINEAR = 9;
-    NativeFilter.MINLINEAR_MAGPOINT_MIPPOINT = 10;
-    return NativeFilter;
-}());
-// depth test values
-// Values match bgfx defines
-var DepthTest = /** @class */ (function () {
-    function DepthTest() {
-    }
-    DepthTest.DEPTH_TEST_LESS = 16;
-    DepthTest.DEPTH_TEST_LEQUAL = 32;
-    DepthTest.DEPTH_TEST_EQUAL = 48;
-    DepthTest.DEPTH_TEST_GEQUAL = 64;
-    DepthTest.DEPTH_TEST_GREATER = 80;
-    DepthTest.DEPTH_TEST_NOTEQUAL = 96;
-    DepthTest.DEPTH_TEST_NEVER = 112;
-    DepthTest.DEPTH_TEST_ALWAYS = 128;
-    return DepthTest;
-}());
-// these flags match bgfx.
-var NativeClearFlags = /** @class */ (function () {
-    function NativeClearFlags() {
-    }
-    NativeClearFlags.CLEAR_COLOR = 1;
-    NativeClearFlags.CLEAR_DEPTH = 2;
-    NativeClearFlags.CLEAR_STENCIL = 4;
-    return NativeClearFlags;
-}());
-// TODO: change this to match bgfx.
-// Must match AddressMode enum in SpectreEngine.h.
-var NativeAddressMode = /** @class */ (function () {
-    function NativeAddressMode() {
-    }
-    NativeAddressMode.WRAP = 0;
-    NativeAddressMode.MIRROR = 1;
-    NativeAddressMode.CLAMP = 2;
-    NativeAddressMode.BORDER = 3;
-    NativeAddressMode.MIRROR_ONCE = 4;
-    return NativeAddressMode;
-}());
-var NativeTextureFormat = /** @class */ (function () {
-    function NativeTextureFormat() {
-    }
-    NativeTextureFormat.RGBA8 = 0;
-    NativeTextureFormat.RGBA32F = 1;
-    return NativeTextureFormat;
-}());
+}(_Meshes_dataBuffer__WEBPACK_IMPORTED_MODULE_5__["DataBuffer"]));
 /** @hidden */
 var NativeTexture = /** @class */ (function (_super) {
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NativeTexture, _super);
@@ -37442,7 +37377,7 @@ var NativeTexture = /** @class */ (function (_super) {
         return 1;
     };
     return NativeTexture;
-}(_Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTexture"]));
+}(_Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTexture"]));
 /** @hidden */
 var NativeEngine = /** @class */ (function (_super) {
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NativeEngine, _super);
@@ -37452,7 +37387,7 @@ var NativeEngine = /** @class */ (function (_super) {
         /** Defines the invalid handle returned by bgfx when resource creation goes wrong */
         _this.INVALID_HANDLE = 65535;
         _this._boundBuffersVertexArray = null;
-        _this._currentDepthTest = DepthTest.DEPTH_TEST_LEQUAL;
+        _this._currentDepthTest = _this._native.DEPTH_TEST_LEQUAL;
         _this._webGLVersion = 2;
         _this.disableUniformBuffers = true;
         // TODO: Initialize this more correctly based on the hardware capabilities.
@@ -37494,9 +37429,9 @@ var NativeEngine = /** @class */ (function (_super) {
             blendMinMax: false,
             maxMSAASamples: 1
         };
-        _Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].Log("Babylon Native (v" + _Engines_engine__WEBPACK_IMPORTED_MODULE_1__["Engine"].Version + ") launched");
-        _Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].LoadScript = function (scriptUrl, onSuccess, onError, scriptId) {
-            _Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].LoadFile(scriptUrl, function (data) {
+        _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].Log("Babylon Native (v" + _Engines_engine__WEBPACK_IMPORTED_MODULE_1__["Engine"].Version + ") launched");
+        _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].LoadScript = function (scriptUrl, onSuccess, onError, scriptId) {
+            _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].LoadFile(scriptUrl, function (data) {
                 Function(data).apply(null);
                 if (onSuccess) {
                     onSuccess();
@@ -37518,7 +37453,7 @@ var NativeEngine = /** @class */ (function (_super) {
             window.Blob = function () { };
         }
         // Shader processor
-        _this._shaderProcessor = new _Engines_WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_13__["WebGL2ShaderProcessor"]();
+        _this._shaderProcessor = new _Engines_WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_14__["WebGL2ShaderProcessor"]();
         return _this;
     }
     NativeEngine.prototype.getHardwareScalingLevel = function () {
@@ -37575,15 +37510,15 @@ var NativeEngine = /** @class */ (function (_super) {
         var mode = 0;
         if (backBuffer && color) {
             this._native.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
-            mode |= NativeClearFlags.CLEAR_COLOR;
+            mode |= this._native.CLEAR_FLAG_COLOR;
         }
         if (depth) {
             this._native.clearDepth(1.0);
-            mode |= NativeClearFlags.CLEAR_DEPTH;
+            mode |= this._native.CLEAR_FLAG_DEPTH;
         }
         if (stencil) {
             this._native.clearStencil(0);
-            mode |= NativeClearFlags.CLEAR_STENCIL;
+            mode |= this._native.CLEAR_FLAG_STENCIL;
         }
         this._native.clear(mode);
     };
@@ -37625,7 +37560,7 @@ var NativeEngine = /** @class */ (function (_super) {
                 if (vertexBuffer) {
                     var buffer = vertexBuffer.getBuffer();
                     if (buffer) {
-                        this._native.recordVertexBuffer(vertexArray, buffer.nativeVertexBuffer, location_1, vertexBuffer.byteOffset, vertexBuffer.byteStride, vertexBuffer.getSize(), vertexBuffer.type, vertexBuffer.normalized);
+                        this._native.recordVertexBuffer(vertexArray, buffer.nativeVertexBuffer, location_1, vertexBuffer.byteOffset, vertexBuffer.byteStride, vertexBuffer.getSize(), this._getNativeAttribType(vertexBuffer.type), vertexBuffer.normalized);
                     }
                 }
             }
@@ -37720,14 +37655,14 @@ var NativeEngine = /** @class */ (function (_super) {
     NativeEngine.prototype.createShaderProgram = function (pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings) {
         if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; }
         this.onBeforeShaderCompilationObservable.notifyObservers(this);
-        var vertexInliner = new _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_12__["ShaderCodeInliner"](vertexCode);
+        var vertexInliner = new _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_13__["ShaderCodeInliner"](vertexCode);
         vertexInliner.processCode();
         vertexCode = vertexInliner.code;
-        var fragmentInliner = new _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_12__["ShaderCodeInliner"](fragmentCode);
+        var fragmentInliner = new _Processors_shaderCodeInliner__WEBPACK_IMPORTED_MODULE_13__["ShaderCodeInliner"](fragmentCode);
         fragmentInliner.processCode();
         fragmentCode = fragmentInliner.code;
-        vertexCode = _thinEngine__WEBPACK_IMPORTED_MODULE_10__["ThinEngine"]._ConcatenateShader(vertexCode, defines);
-        fragmentCode = _thinEngine__WEBPACK_IMPORTED_MODULE_10__["ThinEngine"]._ConcatenateShader(fragmentCode, defines);
+        vertexCode = _thinEngine__WEBPACK_IMPORTED_MODULE_11__["ThinEngine"]._ConcatenateShader(vertexCode, defines);
+        fragmentCode = _thinEngine__WEBPACK_IMPORTED_MODULE_11__["ThinEngine"]._ConcatenateShader(fragmentCode, defines);
         var program = this._native.createProgram(vertexCode, fragmentCode);
         this.onAfterShaderCompilationObservable.notifyObservers(this);
         return program;
@@ -37813,7 +37748,7 @@ var NativeEngine = /** @class */ (function (_super) {
      * @param enable defines the state to set
      */
     NativeEngine.prototype.setDepthBuffer = function (enable) {
-        this._native.setDepthTest(enable ? this._currentDepthTest : DepthTest.DEPTH_TEST_ALWAYS);
+        this._native.setDepthTest(enable ? this._currentDepthTest : this._native.DEPTH_TEST_ALWAYS);
     };
     /**
      * Gets a boolean indicating if depth writing is enabled
@@ -37823,19 +37758,19 @@ var NativeEngine = /** @class */ (function (_super) {
         return this._native.getDepthWrite();
     };
     NativeEngine.prototype.setDepthFunctionToGreater = function () {
-        this._currentDepthTest = DepthTest.DEPTH_TEST_GREATER;
+        this._currentDepthTest = this._native.DEPTH_TEST_GREATER;
         this._native.setDepthTest(this._currentDepthTest);
     };
     NativeEngine.prototype.setDepthFunctionToGreaterOrEqual = function () {
-        this._currentDepthTest = DepthTest.DEPTH_TEST_GEQUAL;
+        this._currentDepthTest = this._native.DEPTH_TEST_GEQUAL;
         this._native.setDepthTest(this._currentDepthTest);
     };
     NativeEngine.prototype.setDepthFunctionToLess = function () {
-        this._currentDepthTest = DepthTest.DEPTH_TEST_LESS;
+        this._currentDepthTest = this._native.DEPTH_TEST_LESS;
         this._native.setDepthTest(this._currentDepthTest);
     };
     NativeEngine.prototype.setDepthFunctionToLessOrEqual = function () {
-        this._currentDepthTest = DepthTest.DEPTH_TEST_LEQUAL;
+        this._currentDepthTest = this._native.DEPTH_TEST_LEQUAL;
         this._native.setDepthTest(this._currentDepthTest);
     };
     /**
@@ -37881,9 +37816,10 @@ var NativeEngine = /** @class */ (function (_super) {
         if (this._alphaMode === mode) {
             return;
         }
+        mode = this._getNativeAlphaMode(mode);
         this._native.setBlendMode(mode);
         if (!noDepthWriteChange) {
-            this.setDepthWrite(mode === _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].ALPHA_DISABLE);
+            this.setDepthWrite(mode === _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_DISABLE);
         }
         this._alphaMode = mode;
     };
@@ -38094,7 +38030,7 @@ var NativeEngine = /** @class */ (function (_super) {
      */
     NativeEngine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format, forcedExtension, mimeType) {
         var _this = this;
-        if (samplingMode === void 0) { samplingMode = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE; }
+        if (samplingMode === void 0) { samplingMode = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE; }
         if (onLoad === void 0) { onLoad = null; }
         if (onError === void 0) { onError = null; }
         if (buffer === void 0) { buffer = null; }
@@ -38105,7 +38041,7 @@ var NativeEngine = /** @class */ (function (_super) {
         var fromData = url.substr(0, 5) === "data:";
         //const fromBlob = url.substr(0, 5) === "blob:";
         var isBase64 = fromData && url.indexOf(";base64,") !== -1;
-        var texture = fallback ? fallback : new _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTexture"](this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTextureSource"].Url);
+        var texture = fallback ? fallback : new _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTexture"](this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTextureSource"].Url);
         var originalUrl = url;
         if (this._transformTextureUrl && !isBase64 && !fallback && !buffer) {
             url = this._transformTextureUrl(url);
@@ -38147,16 +38083,16 @@ var NativeEngine = /** @class */ (function (_super) {
                 if (onLoadObserver) {
                     texture.onLoadedObservable.remove(onLoadObserver);
                 }
-                if (_engineStore__WEBPACK_IMPORTED_MODULE_11__["EngineStore"].UseFallbackTexture) {
-                    _this.createTexture(_engineStore__WEBPACK_IMPORTED_MODULE_11__["EngineStore"].FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, buffer, texture);
+                if (_engineStore__WEBPACK_IMPORTED_MODULE_12__["EngineStore"].UseFallbackTexture) {
+                    _this.createTexture(_engineStore__WEBPACK_IMPORTED_MODULE_12__["EngineStore"].FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, buffer, texture);
                 }
                 if (onError) {
-                    onError((message || "Unknown error") + (_engineStore__WEBPACK_IMPORTED_MODULE_11__["EngineStore"].UseFallbackTexture ? " - Fallback texture was used" : ""), exception);
+                    onError((message || "Unknown error") + (_engineStore__WEBPACK_IMPORTED_MODULE_12__["EngineStore"].UseFallbackTexture ? " - Fallback texture was used" : ""), exception);
                 }
             }
             else {
                 // fall back to the original url if the transformed url fails to load
-                _Misc_logger__WEBPACK_IMPORTED_MODULE_8__["Logger"].Warn("Failed to load " + url + ", falling back to " + originalUrl);
+                _Misc_logger__WEBPACK_IMPORTED_MODULE_9__["Logger"].Warn("Failed to load " + url + ", falling back to " + originalUrl);
                 _this.createTexture(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, buffer, texture, format, forcedExtension, mimeType);
             }
         };
@@ -38179,7 +38115,7 @@ var NativeEngine = /** @class */ (function (_super) {
                     texture.width = texture.baseWidth;
                     texture.height = texture.baseHeight;
                     texture.isReady = true;
-                    var filter = _this._getSamplingFilter(samplingMode);
+                    var filter = _this._getNativeSamplingMode(samplingMode);
                     _this._native.setTextureSampling(webGLTexture, filter);
                     if (scene) {
                         scene._removePendingData(texture);
@@ -38198,7 +38134,7 @@ var NativeEngine = /** @class */ (function (_super) {
                     onload_1(buffer);
                 }
                 else if (typeof buffer === "string") {
-                    onload_1(new Uint8Array(_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].DecodeBase64(buffer)));
+                    onload_1(new Uint8Array(_Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].DecodeBase64(buffer)));
                 }
                 else {
                     throw new Error("Unsupported buffer type");
@@ -38206,7 +38142,7 @@ var NativeEngine = /** @class */ (function (_super) {
             }
             else {
                 if (isBase64) {
-                    onload_1(new Uint8Array(_Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].DecodeBase64(url)));
+                    onload_1(new Uint8Array(_Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].DecodeBase64(url)));
                 }
                 else {
                     this._loadFile(url, function (data) { return onload_1(new Uint8Array(data)); }, undefined, undefined, true, function (request, exception) {
@@ -38242,7 +38178,7 @@ var NativeEngine = /** @class */ (function (_super) {
         if (lodScale === void 0) { lodScale = 0; }
         if (lodOffset === void 0) { lodOffset = 0; }
         if (fallback === void 0) { fallback = null; }
-        var texture = fallback ? fallback : new _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTexture"](this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTextureSource"].Cube);
+        var texture = fallback ? fallback : new _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTexture"](this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTextureSource"].Cube);
         texture.isCube = true;
         texture.url = rootUrl;
         texture.generateMipMaps = !noMipmap;
@@ -38257,10 +38193,10 @@ var NativeEngine = /** @class */ (function (_super) {
         // TODO: use texture loader to load env files?
         if (extension === ".env") {
             var onloaddata_1 = function (data) {
-                var info = _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_6__["EnvironmentTextureTools"].GetEnvInfo(data);
+                var info = _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_7__["EnvironmentTextureTools"].GetEnvInfo(data);
                 texture.width = info.width;
                 texture.height = info.width;
-                _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_6__["EnvironmentTextureTools"].UploadEnvSpherical(texture, info);
+                _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_7__["EnvironmentTextureTools"].UploadEnvSpherical(texture, info);
                 if (info.version !== 1) {
                     throw new Error("Unsupported babylon environment map version \"" + info.version + "\"");
                 }
@@ -38269,11 +38205,11 @@ var NativeEngine = /** @class */ (function (_super) {
                     throw new Error("Nothing else parsed so far");
                 }
                 texture._lodGenerationScale = specularInfo.lodGenerationScale;
-                var imageData = _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_6__["EnvironmentTextureTools"].CreateImageDataArrayBufferViews(data, info);
-                texture.format = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTUREFORMAT_RGBA;
-                texture.type = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_UNSIGNED_INT;
+                var imageData = _Misc_environmentTextureTools__WEBPACK_IMPORTED_MODULE_7__["EnvironmentTextureTools"].CreateImageDataArrayBufferViews(data, info);
+                texture.format = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTUREFORMAT_RGBA;
+                texture.type = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_UNSIGNED_INT;
                 texture.generateMipMaps = true;
-                texture.getEngine().updateTextureSamplingMode(_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].TRILINEAR_SAMPLINGMODE, texture);
+                texture.getEngine().updateTextureSamplingMode(_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].TRILINEAR_SAMPLINGMODE, texture);
                 texture._isRGBD = true;
                 texture.invertY = true;
                 _this._native.loadCubeTextureWithMips(texture._webGLTexture, imageData, function () {
@@ -38303,7 +38239,7 @@ var NativeEngine = /** @class */ (function (_super) {
             }
             // Reorder from [+X, +Y, +Z, -X, -Y, -Z] to [+X, -X, +Y, -Y, +Z, -Z].
             var reorderedFiles = [files[0], files[3], files[1], files[4], files[2], files[5]];
-            Promise.all(reorderedFiles.map(function (file) { return _Misc_tools__WEBPACK_IMPORTED_MODULE_5__["Tools"].LoadFileAsync(file).then(function (data) { return new Uint8Array(data); }); })).then(function (data) {
+            Promise.all(reorderedFiles.map(function (file) { return _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].LoadFileAsync(file).then(function (data) { return new Uint8Array(data); }); })).then(function (data) {
                 return new Promise(function (resolve, reject) {
                     _this._native.loadCubeTexture(texture._webGLTexture, data, !noMipmap, resolve, reject);
                 });
@@ -38321,86 +38257,40 @@ var NativeEngine = /** @class */ (function (_super) {
         this._internalTexturesCache.push(texture);
         return texture;
     };
-    // Returns a NativeFilter.XXXX value.
-    NativeEngine.prototype._getSamplingFilter = function (samplingMode) {
-        switch (samplingMode) {
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_BILINEAR_SAMPLINGMODE:
-                return NativeFilter.MINLINEAR_MAGLINEAR_MIPPOINT;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE:
-                return NativeFilter.MINLINEAR_MAGLINEAR_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE:
-                return NativeFilter.MINPOINT_MAGPOINT_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_NEAREST_MIPNEAREST:
-                return NativeFilter.MINPOINT_MAGPOINT_MIPPOINT;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_LINEAR_MIPNEAREST:
-                return NativeFilter.MINLINEAR_MAGPOINT_MIPPOINT;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_LINEAR_MIPLINEAR:
-                return NativeFilter.MINLINEAR_MAGPOINT_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_LINEAR:
-                return NativeFilter.MINLINEAR_MAGPOINT_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_NEAREST:
-                return NativeFilter.MINPOINT_MAGPOINT_MIPPOINT;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_LINEAR_NEAREST_MIPNEAREST:
-                return NativeFilter.MINPOINT_MAGLINEAR_MIPPOINT;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_LINEAR_NEAREST_MIPLINEAR:
-                return NativeFilter.MINPOINT_MAGLINEAR_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_LINEAR_LINEAR:
-                return NativeFilter.MINLINEAR_MAGLINEAR_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_LINEAR_NEAREST:
-                return NativeFilter.MINPOINT_MAGLINEAR_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_NEAREST_MIPLINEAR:
-                return NativeFilter.MINPOINT_MAGPOINT_MIPLINEAR;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_LINEAR_LINEAR_MIPNEAREST:
-                return NativeFilter.MINLINEAR_MAGLINEAR_MIPLINEAR;
-            default:
-                throw new Error("Unexpected sampling mode: " + samplingMode + ".");
-        }
-    };
-    NativeEngine._GetNativeTextureFormat = function (format, type) {
-        if (format == _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTUREFORMAT_RGBA && type == _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_UNSIGNED_INT) {
-            return NativeTextureFormat.RGBA8;
-        }
-        else if (format == _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTUREFORMAT_RGBA && type == _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_FLOAT) {
-            return NativeTextureFormat.RGBA32F;
-        }
-        else {
-            throw new Error("Unexpected texture format or type: format " + format + ", type " + type + ".");
-        }
-    };
     NativeEngine.prototype.createRenderTargetTexture = function (size, options) {
-        var fullOptions = new _Materials_Textures_renderTargetCreationOptions__WEBPACK_IMPORTED_MODULE_7__["RenderTargetCreationOptions"]();
+        var fullOptions = new _Materials_Textures_renderTargetCreationOptions__WEBPACK_IMPORTED_MODULE_8__["RenderTargetCreationOptions"]();
         if (options !== undefined && typeof options === "object") {
             fullOptions.generateMipMaps = options.generateMipMaps;
             fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
             fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
-            fullOptions.type = options.type === undefined ? _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_UNSIGNED_INT : options.type;
-            fullOptions.samplingMode = options.samplingMode === undefined ? _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
-            fullOptions.format = options.format === undefined ? _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTUREFORMAT_RGBA : options.format;
+            fullOptions.type = options.type === undefined ? _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_UNSIGNED_INT : options.type;
+            fullOptions.samplingMode = options.samplingMode === undefined ? _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;
+            fullOptions.format = options.format === undefined ? _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTUREFORMAT_RGBA : options.format;
         }
         else {
             fullOptions.generateMipMaps = options;
             fullOptions.generateDepthBuffer = true;
             fullOptions.generateStencilBuffer = false;
-            fullOptions.type = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_UNSIGNED_INT;
-            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE;
-            fullOptions.format = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTUREFORMAT_RGBA;
+            fullOptions.type = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_UNSIGNED_INT;
+            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE;
+            fullOptions.format = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTUREFORMAT_RGBA;
         }
-        if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
+        if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
             // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
-            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE;
+            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE;
         }
-        else if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
+        else if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {
             // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
-            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE;
+            fullOptions.samplingMode = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE;
         }
-        var texture = new NativeTexture(this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTextureSource"].RenderTarget);
+        var texture = new NativeTexture(this, _Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTextureSource"].RenderTarget);
         var width = size.width || size;
         var height = size.height || size;
-        if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_FLOAT && !this._caps.textureFloat) {
-            fullOptions.type = _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURETYPE_UNSIGNED_INT;
-            _Misc_logger__WEBPACK_IMPORTED_MODULE_8__["Logger"].Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type");
+        if (fullOptions.type === _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_FLOAT && !this._caps.textureFloat) {
+            fullOptions.type = _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_UNSIGNED_INT;
+            _Misc_logger__WEBPACK_IMPORTED_MODULE_9__["Logger"].Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type");
         }
-        var framebuffer = this._native.createFramebuffer(texture._webGLTexture, width, height, NativeEngine._GetNativeTextureFormat(fullOptions.format, fullOptions.type), fullOptions.samplingMode, fullOptions.generateStencilBuffer ? true : false, fullOptions.generateDepthBuffer, fullOptions.generateMipMaps ? true : false);
+        var framebuffer = this._native.createFramebuffer(texture._webGLTexture, width, height, this._getNativeTextureFormat(fullOptions.format, fullOptions.type), fullOptions.samplingMode, fullOptions.generateStencilBuffer ? true : false, fullOptions.generateDepthBuffer, fullOptions.generateMipMaps ? true : false);
         texture._framebuffer = framebuffer;
         texture.baseWidth = width;
         texture.baseHeight = height;
@@ -38419,7 +38309,7 @@ var NativeEngine = /** @class */ (function (_super) {
     };
     NativeEngine.prototype.updateTextureSamplingMode = function (samplingMode, texture) {
         if (texture._webGLTexture) {
-            var filter = this._getSamplingFilter(samplingMode);
+            var filter = this._getNativeSamplingMode(samplingMode);
             this._native.setTextureSampling(texture._webGLTexture, filter);
         }
         texture.samplingMode = samplingMode;
@@ -38439,7 +38329,7 @@ var NativeEngine = /** @class */ (function (_super) {
     NativeEngine.prototype.unBindFramebuffer = function (texture, disableGenerateMipMaps, onBeforeUnbind) {
         if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; }
         if (disableGenerateMipMaps) {
-            _Misc_logger__WEBPACK_IMPORTED_MODULE_8__["Logger"].Warn("Disabling mipmap generation not yet supported in NativeEngine. Ignoring.");
+            _Misc_logger__WEBPACK_IMPORTED_MODULE_9__["Logger"].Warn("Disabling mipmap generation not yet supported in NativeEngine. Ignoring.");
         }
         if (onBeforeUnbind) {
             onBeforeUnbind();
@@ -38489,7 +38379,7 @@ var NativeEngine = /** @class */ (function (_super) {
             this._activeChannel = channel;
             texture.update();
         }
-        else if (texture.delayLoadState === _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].DELAYLOADSTATE_NOTLOADED) { // Delay loading
+        else if (texture.delayLoadState === _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].DELAYLOADSTATE_NOTLOADED) { // Delay loading
             texture.delayLoad();
             return false;
         }
@@ -38538,12 +38428,12 @@ var NativeEngine = /** @class */ (function (_super) {
     // Returns a NativeAddressMode.XXX value.
     NativeEngine.prototype._getAddressMode = function (wrapMode) {
         switch (wrapMode) {
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_WRAP_ADDRESSMODE:
-                return NativeAddressMode.WRAP;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_CLAMP_ADDRESSMODE:
-                return NativeAddressMode.CLAMP;
-            case _constants__WEBPACK_IMPORTED_MODULE_9__["Constants"].TEXTURE_MIRROR_ADDRESSMODE:
-                return NativeAddressMode.MIRROR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_WRAP_ADDRESSMODE:
+                return this._native.ADDRESS_MODE_WRAP;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_CLAMP_ADDRESSMODE:
+                return this._native.ADDRESS_MODE_CLAMP;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_MIRROR_ADDRESSMODE:
+                return this._native.ADDRESS_MODE_MIRROR;
             default:
                 throw new Error("Unexpected wrap mode: " + wrapMode + ".");
         }
@@ -38589,6 +38479,92 @@ var NativeEngine = /** @class */ (function (_super) {
         if (lod === void 0) { lod = 0; }
         throw new Error("_uploadArrayBufferViewToTexture not implemented.");
     };
+    // JavaScript-to-Native conversion helper functions.
+    NativeEngine.prototype._getNativeSamplingMode = function (samplingMode) {
+        switch (samplingMode) {
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_BILINEAR_SAMPLINGMODE:
+                return this._native.SAMPLER_BILINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE:
+                return this._native.SAMPLER_TRILINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_SAMPLINGMODE:
+                return this._native.SAMPLER_MINPOINT_MAGPOINT_MIPLINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_NEAREST_MIPNEAREST:
+                return this._native.SAMPLER_NEAREST;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_LINEAR_MIPNEAREST:
+                return this._native.SAMPLER_MINLINEAR_MAGPOINT_MIPPOINT;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_LINEAR_MIPLINEAR:
+                return this._native.SAMPLER_MINBILINEAR_MAGPOINT;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_LINEAR:
+                return this._native.SAMPLER_MINBILINEAR_MAGPOINT;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_NEAREST:
+                return this._native.SAMPLER_NEAREST;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_LINEAR_NEAREST_MIPNEAREST:
+                return this._native.SAMPLER_MINPOINT_MAGLINEAR_MIPPOINT;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_LINEAR_NEAREST_MIPLINEAR:
+                return this._native.SAMPLER_MINPOINT_MAGLINEAR_MIPLINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_LINEAR_LINEAR:
+                return this._native.SAMPLER_TRILINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_LINEAR_NEAREST:
+                return this._native.SAMPLER_MINPOINT_MAGLINEAR_MIPLINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_NEAREST_NEAREST_MIPLINEAR:
+                return this._native.SAMPLER_MINPOINT_MAGPOINT_MIPLINEAR;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURE_LINEAR_LINEAR_MIPNEAREST:
+                return this._native.SAMPLER_TRILINEAR;
+            default:
+                throw new Error("Unsupported sampling mode: " + samplingMode + ".");
+        }
+    };
+    NativeEngine.prototype._getNativeTextureFormat = function (format, type) {
+        if (format == _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTUREFORMAT_RGBA && type == _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_UNSIGNED_INT) {
+            return this._native.TEXTURE_FORMAT_RGBA8;
+        }
+        else if (format == _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTUREFORMAT_RGBA && type == _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].TEXTURETYPE_FLOAT) {
+            return this._native.TEXTURE_FORMAT_RGBA32F;
+        }
+        else {
+            throw new Error("Unsupported texture format or type: format " + format + ", type " + type + ".");
+        }
+    };
+    NativeEngine.prototype._getNativeAlphaMode = function (mode) {
+        switch (mode) {
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_DISABLE:
+                return this._native.ALPHA_DISABLE;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_ADD:
+                return this._native.ALPHA_ADD;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_COMBINE:
+                return this._native.ALPHA_COMBINE;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_SUBTRACT:
+                return this._native.ALPHA_SUBTRACT;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_MULTIPLY:
+                return this._native.ALPHA_MULTIPLY;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_MAXIMIZED:
+                return this._native.ALPHA_MAXIMIZED;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_ONEONE:
+                return this._native.ALPHA_ONEONE;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_PREMULTIPLIED:
+                return this._native.ALPHA_PREMULTIPLIED;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_PREMULTIPLIED_PORTERDUFF:
+                return this._native.ALPHA_PREMULTIPLIED_PORTERDUFF;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_INTERPOLATE:
+                return this._native.ALPHA_INTERPOLATE;
+            case _constants__WEBPACK_IMPORTED_MODULE_10__["Constants"].ALPHA_SCREENMODE:
+                return this._native.ALPHA_SCREENMODE;
+            default:
+                throw new Error("Unsupported alpha mode: " + mode + ".");
+        }
+    };
+    NativeEngine.prototype._getNativeAttribType = function (type) {
+        switch (type) {
+            case _Meshes_buffer__WEBPACK_IMPORTED_MODULE_2__["VertexBuffer"].UNSIGNED_BYTE:
+                return this._native.ATTRIB_TYPE_UINT8;
+            case _Meshes_buffer__WEBPACK_IMPORTED_MODULE_2__["VertexBuffer"].SHORT:
+                return this._native.ATTRIB_TYPE_INT16;
+            case _Meshes_buffer__WEBPACK_IMPORTED_MODULE_2__["VertexBuffer"].FLOAT:
+                return this._native.ATTRIB_TYPE_FLOAT;
+            default:
+                throw new Error("Unsupported attribute type: " + type + ".");
+        }
+    };
     return NativeEngine;
 }(_Engines_engine__WEBPACK_IMPORTED_MODULE_1__["Engine"]));
 
@@ -82771,8 +82747,8 @@ var NodeMaterialConnectionPoint = /** @class */ (function () {
             serializationObject.isExposedOnFrame = true;
             serializationObject.exposedPortPosition = this.exposedPortPosition;
         }
-        if (this.isExposedOnFrame) {
-            serializationObject.isExposedOnFrame = this.isExposedOnFrame;
+        if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
+            serializationObject.isExposedOnFrame = true;
             serializationObject.exposedPortPosition = this.exposedPortPosition;
         }
         return serializationObject;
@@ -90055,6 +90031,8 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _Shaders_procedural_vertex__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../Shaders/procedural.vertex */ "./Shaders/procedural.vertex.ts");
 /* harmony import */ var _Misc_typeStore__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../Misc/typeStore */ "./Misc/typeStore.ts");
 /* harmony import */ var _Engines_engineStore__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../Engines/engineStore */ "./Engines/engineStore.ts");
+/* harmony import */ var _Engines_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../Engines/constants */ "./Engines/constants.ts");
+
 
 
 
@@ -90088,11 +90066,13 @@ var ProceduralTexture = /** @class */ (function (_super) {
      * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
      * @param generateMipMaps Define if the texture should creates mip maps or not
      * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+     * @param textureType The FBO internal texture type
      */
-    function ProceduralTexture(name, size, fragment, scene, fallbackTexture, generateMipMaps, isCube) {
+    function ProceduralTexture(name, size, fragment, scene, fallbackTexture, generateMipMaps, isCube, textureType) {
         if (fallbackTexture === void 0) { fallbackTexture = null; }
         if (generateMipMaps === void 0) { generateMipMaps = true; }
         if (isCube === void 0) { isCube = false; }
+        if (textureType === void 0) { textureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_14__["Constants"].TEXTURETYPE_UNSIGNED_INT; }
         var _this = _super.call(this, null, scene, !generateMipMaps) || this;
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
@@ -90148,11 +90128,11 @@ var ProceduralTexture = /** @class */ (function (_super) {
         _this.setFragment(fragment);
         _this._fallbackTexture = fallbackTexture;
         if (isCube) {
-            _this._texture = _this._fullEngine.createRenderTargetCubeTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: false, generateStencilBuffer: false });
+            _this._texture = _this._fullEngine.createRenderTargetCubeTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: false, generateStencilBuffer: false, type: textureType });
             _this.setFloat("face", 0);
         }
         else {
-            _this._texture = _this._fullEngine.createRenderTargetTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: false, generateStencilBuffer: false });
+            _this._texture = _this._fullEngine.createRenderTargetTexture(size, { generateMipMaps: generateMipMaps, generateDepthBuffer: false, generateStencilBuffer: false, type: textureType });
         }
         // VBO
         var vertices = [];

Plik diff jest za duży
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 12 - 8
dist/preview release/babylon.module.d.ts

@@ -12062,8 +12062,9 @@ declare module "babylonjs/Materials/Textures/Procedurals/proceduralTexture" {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -45904,7 +45905,6 @@ declare module "babylonjs/Cameras/Inputs/flyCameraMouseInput" {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -55380,8 +55380,6 @@ declare module "babylonjs/Engines/nativeEngine" {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -55414,6 +55412,10 @@ declare module "babylonjs/Engines/nativeEngine" {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module "babylonjs/Engines/index" {
@@ -92280,8 +92282,9 @@ declare module BABYLON {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -124814,7 +124817,6 @@ declare module BABYLON {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -133685,8 +133687,6 @@ declare module BABYLON {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -133719,6 +133719,10 @@ declare module BABYLON {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module BABYLON {

+ 6 - 4
dist/preview release/documentation.d.ts

@@ -11796,8 +11796,9 @@ declare module BABYLON {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -44330,7 +44331,6 @@ declare module BABYLON {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -53201,8 +53201,6 @@ declare module BABYLON {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -53235,6 +53233,10 @@ declare module BABYLON {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module BABYLON {

+ 2 - 2
dist/preview release/nodeEditor/babylon.nodeEditor.d.ts

@@ -180,7 +180,8 @@ declare module NODEEDITOR {
         private _createInputPort;
         private _markFramePortPositions;
         private _createFramePorts;
-        private removePortFromExposed;
+        private removePortFromExposedWithNode;
+        private removePortFromExposedWithLink;
         private createInputPorts;
         private createOutputPorts;
         private _redrawFramePorts;
@@ -279,7 +280,6 @@ declare module NODEEDITOR {
         protected _onCandidateLinkMovedObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.Nullable<BABYLON.Vector2>>>;
         protected _onSelectionChangedObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.Nullable<GraphFrame | GraphNode | NodeLink | NodePort | FramePortData>>>;
         protected _exposedOnFrame: boolean;
-        isExposed: boolean;
         delegatedPort: BABYLON.Nullable<FrameNodePort>;
         get element(): HTMLDivElement;
         get portName(): string;

Plik diff jest za duży
+ 5 - 5
dist/preview release/nodeEditor/babylon.nodeEditor.js


+ 74 - 46
dist/preview release/nodeEditor/babylon.nodeEditor.max.js

@@ -67715,9 +67715,10 @@ var GraphFrame = /** @class */ (function () {
         this._frameInPorts.push(localPort);
         port.delegatedPort = localPort;
         this._controlledPorts.push(port);
-        if (!port.isExposed) {
-            port.isExposed = true;
+        port.exposedPortPosition = this._exposedInPorts.findIndex(function (nodePort) { return nodePort === port; });
+        if (port.exposedPortPosition < 0) {
             this._exposedInPorts.push(port);
+            port.exposedPortPosition = this._exposedInPorts.length - 1;
         }
     };
     // Mark ports with FramePortPosition for re-arrangement support
@@ -67766,79 +67767,107 @@ var GraphFrame = /** @class */ (function () {
             var node = _a[_i];
             node.isVisible = false;
         }
-        for (var _b = 0, _c = this._exposedOutPorts; _b < _c.length; _b++) { // Output
-            var port = _c[_b];
+        for (var i = 0; i < this._exposedOutPorts.length;) { // Output
+            var port = this._exposedOutPorts[i];
             if (port.node === null || port.node.enclosingFrameId != this.id) {
-                var index = this._exposedOutPorts.findIndex(function (nodePort) { return nodePort === port; });
-                this._exposedOutPorts.splice(index, 1);
-                port.isExposed = false;
+                if (this.removePortFromExposedWithNode(port, this._exposedOutPorts))
+                    continue;
             }
             else {
-                this.createOutputPorts(port, port.node);
+                if (!this.createOutputPorts(port, port.node) && this.removePortFromExposedWithNode(port, this._exposedOutPorts)) {
+                    continue;
+                }
             }
+            ++i;
         }
-        for (var _d = 0, _e = this._exposedInPorts; _d < _e.length; _d++) { // Input
-            var port = _e[_d];
+        for (var i = 0; i < this._exposedInPorts.length;) { // Input
+            var port = this._exposedInPorts[i];
             if (port.node === null || port.node.enclosingFrameId != this.id) {
-                var index = this._exposedInPorts.findIndex(function (nodePort) { return nodePort === port; });
-                this._exposedInPorts.splice(index, 1);
-                port.isExposed = false;
+                if (this.removePortFromExposedWithNode(port, this._exposedInPorts)) {
+                    continue;
+                }
             }
             else {
-                this.createInputPorts(port, port.node);
+                if (!this.createInputPorts(port, port.node) && this.removePortFromExposedWithNode(port, this._exposedInPorts)) {
+                    continue;
+                }
             }
+            ++i;
         }
-        for (var _f = 0, _g = this._nodes; _f < _g.length; _f++) {
-            var node = _g[_f];
-            for (var _h = 0, _j = node.outputPorts; _h < _j.length; _h++) { // Output
-                var port = _j[_h];
-                if (!port.isExposed) {
-                    if (this.createOutputPorts(port, node)) {
-                        this._exposedOutPorts.push(port);
-                        port.isExposed = true;
+        for (var _b = 0, _c = this._nodes; _b < _c.length; _b++) {
+            var node = _c[_b];
+            var _loop_1 = function (port_1) {
+                port_1.exposedPortPosition = this_1._exposedOutPorts.findIndex(function (nodePort) { return nodePort === port_1; });
+                if (port_1.exposedPortPosition < 0) {
+                    if (this_1.createOutputPorts(port_1, node)) {
+                        port_1.node.enclosingFrameId = this_1.id;
+                        this_1._exposedOutPorts.push(port_1);
+                        port_1.exposedPortPosition = this_1._exposedOutPorts.length - 1;
                     }
                 }
+            };
+            var this_1 = this;
+            for (var _d = 0, _e = node.outputPorts; _d < _e.length; _d++) {
+                var port_1 = _e[_d];
+                _loop_1(port_1);
             }
-            for (var _k = 0, _l = node.inputPorts; _k < _l.length; _k++) { // Input
-                var port = _l[_k];
-                if (!port.isExposed) {
+            for (var _f = 0, _g = node.inputPorts; _f < _g.length; _f++) { // Input
+                var port = _g[_f];
+                port.exposedPortPosition = this._exposedInPorts.findIndex(function (nodePort) { return nodePort === port; });
+                if (port.exposedPortPosition < 0) {
                     this.createInputPorts(port, node);
                 }
             }
         }
     };
-    GraphFrame.prototype.removePortFromExposed = function (nodeLink, exposedPorts) {
+    GraphFrame.prototype.removePortFromExposedWithNode = function (port, exposedPorts) {
+        var index = exposedPorts.findIndex(function (nodePort) { return nodePort === port; });
+        if (index >= 0) {
+            exposedPorts.splice(index, 1);
+            port.exposedPortPosition = -1;
+            return true;
+        }
+        return false;
+    };
+    GraphFrame.prototype.removePortFromExposedWithLink = function (nodeLink, exposedPorts) {
         var aPort = exposedPorts.findIndex(function (nodePort) { return nodePort === nodeLink.portA; });
         var bPort = exposedPorts.findIndex(function (nodePort) { return nodePort === nodeLink.portB; });
         if (aPort >= 0) {
             exposedPorts.splice(aPort, 1);
-            nodeLink.portA.isExposed = false;
+            nodeLink.portA.exposedPortPosition = -1;
         }
         else if (bPort >= 0) {
             exposedPorts.splice(bPort, 1);
-            if (nodeLink.portB)
-                nodeLink.portB.isExposed = false;
+            if (nodeLink.portB) {
+                nodeLink.portB.exposedPortPosition = -1;
+            }
         }
     };
     GraphFrame.prototype.createInputPorts = function (port, node) {
         var _this_1 = this;
         if (port.connectionPoint.isConnected) {
+            var portAdded = false;
             for (var _i = 0, _a = node.links; _i < _a.length; _i++) {
                 var link = _a[_i];
                 if (link.portB === port && this.nodes.indexOf(link.nodeA) === -1) {
                     this._createInputPort(port, node);
                     link.isVisible = true;
+                    portAdded = true;
                     var onLinkDisposedObserver = link.onDisposedObservable.add(function (nodeLink) {
-                        _this_1.removePortFromExposed(nodeLink, _this_1._exposedInPorts);
+                        _this_1.removePortFromExposedWithLink(nodeLink, _this_1._exposedInPorts);
                         _this_1._redrawFramePorts();
                     });
                     this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
                 }
             }
+            if (portAdded)
+                return true;
         }
         else if (port.exposedOnFrame) {
             this._createInputPort(port, node);
+            return true;
         }
+        return false;
     };
     GraphFrame.prototype.createOutputPorts = function (port, node) {
         var _this_1 = this;
@@ -67846,7 +67875,7 @@ var GraphFrame = /** @class */ (function () {
             var portAdded = false;
             for (var _i = 0, _a = node.links; _i < _a.length; _i++) {
                 var link = _a[_i];
-                if (link.portA === port && this.nodes.indexOf(link.nodeB) === -1 || (link.portA === port && port.exposedOnFrame)) {
+                if (link.portA === port && this.nodes.indexOf(link.nodeB) === -1) {
                     var localPort = void 0;
                     if (!portAdded) {
                         portAdded = true;
@@ -67854,7 +67883,7 @@ var GraphFrame = /** @class */ (function () {
                         this._frameOutPorts.push(localPort);
                         link.isVisible = true;
                         var onLinkDisposedObserver = link.onDisposedObservable.add(function (nodeLink) {
-                            _this_1.removePortFromExposed(nodeLink, _this_1._exposedOutPorts);
+                            _this_1.removePortFromExposedWithLink(nodeLink, _this_1._exposedOutPorts);
                             _this_1._redrawFramePorts();
                         });
                         this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
@@ -67868,9 +67897,17 @@ var GraphFrame = /** @class */ (function () {
                     }
                     port.delegatedPort = localPort;
                     this._controlledPorts.push(port);
-                    return true;
+                }
+                else if (port.exposedPortPosition >= 0 && !portAdded) {
+                    var localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_3__["FrameNodePort"].CreateFrameNodePortElement(port.connectionPoint, node, this._outputPortContainer, null, this._ownerCanvas.globalState, false, GraphFrame._FramePortCounter++, this.id);
+                    this._frameOutPorts.push(localPort);
+                    port.delegatedPort = localPort;
+                    this._controlledPorts.push(port);
+                    portAdded = true;
                 }
             }
+            if (portAdded)
+                return true;
         }
         else if (port.exposedOnFrame) {
             var localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_3__["FrameNodePort"].CreateFrameNodePortElement(port.connectionPoint, node, this._outputPortContainer, null, this._ownerCanvas.globalState, false, GraphFrame._FramePortCounter++, this.id);
@@ -68331,7 +68368,7 @@ var GraphFrame = /** @class */ (function () {
         newFrame.color = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Color3"].FromArray(serializationData.color);
         newFrame.comments = serializationData.comments;
         if (serializationData.blocks && map) {
-            var _loop_1 = function () {
+            var _loop_2 = function () {
                 var actualId = map[blockId];
                 var node_1 = canvas.nodes.filter(function (n) { return n.block.uniqueId === actualId; });
                 if (node_1.length) {
@@ -68341,7 +68378,7 @@ var GraphFrame = /** @class */ (function () {
             };
             for (var _i = 0, _a = serializationData.blocks; _i < _a.length; _i++) {
                 var blockId = _a[_i];
-                _loop_1();
+                _loop_2();
             }
         }
         else {
@@ -68352,25 +68389,17 @@ var GraphFrame = /** @class */ (function () {
             for (var _d = 0, _e = node.outputPorts; _d < _e.length; _d++) { // Output
                 var port = _e[_d];
                 if (port.exposedOnFrame) {
-                    port.isExposed = true;
-                    if (port.exposedPortPosition) {
+                    if (port.exposedPortPosition !== -1) {
                         newFrame._exposedOutPorts[port.exposedPortPosition] = port;
                     }
-                    else {
-                        newFrame._exposedOutPorts.push(port);
-                    }
                 }
             }
             for (var _f = 0, _g = node.inputPorts; _f < _g.length; _f++) { // Inports
                 var port = _g[_f];
                 if (port.exposedOnFrame) {
-                    port.isExposed = true;
-                    if (port.exposedPortPosition) {
+                    if (port.exposedPortPosition !== -1) {
                         newFrame._exposedInPorts[port.exposedPortPosition] = port;
                     }
-                    else {
-                        newFrame._exposedInPorts.push(port);
-                    }
                 }
             }
         }
@@ -69033,7 +69062,6 @@ var NodePort = /** @class */ (function () {
         var _this = this;
         this.connectionPoint = connectionPoint;
         this.node = node;
-        this.isExposed = false;
         this.delegatedPort = null;
         this._element = portContainer.ownerDocument.createElement("div");
         this._element.classList.add("port");

Plik diff jest za duży
+ 1 - 1
dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map


+ 4 - 4
dist/preview release/nodeEditor/babylon.nodeEditor.module.d.ts

@@ -281,7 +281,8 @@ declare module "babylonjs-node-editor/diagram/graphFrame" {
         private _createInputPort;
         private _markFramePortPositions;
         private _createFramePorts;
-        private removePortFromExposed;
+        private removePortFromExposedWithNode;
+        private removePortFromExposedWithLink;
         private createInputPorts;
         private createOutputPorts;
         private _redrawFramePorts;
@@ -391,7 +392,6 @@ declare module "babylonjs-node-editor/diagram/nodePort" {
         protected _onCandidateLinkMovedObserver: Nullable<Observer<Nullable<Vector2>>>;
         protected _onSelectionChangedObserver: Nullable<Observer<Nullable<GraphFrame | GraphNode | NodeLink | NodePort | FramePortData>>>;
         protected _exposedOnFrame: boolean;
-        isExposed: boolean;
         delegatedPort: Nullable<FrameNodePort>;
         get element(): HTMLDivElement;
         get portName(): string;
@@ -2096,7 +2096,8 @@ declare module NODEEDITOR {
         private _createInputPort;
         private _markFramePortPositions;
         private _createFramePorts;
-        private removePortFromExposed;
+        private removePortFromExposedWithNode;
+        private removePortFromExposedWithLink;
         private createInputPorts;
         private createOutputPorts;
         private _redrawFramePorts;
@@ -2195,7 +2196,6 @@ declare module NODEEDITOR {
         protected _onCandidateLinkMovedObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.Nullable<BABYLON.Vector2>>>;
         protected _onSelectionChangedObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.Nullable<GraphFrame | GraphNode | NodeLink | NodePort | FramePortData>>>;
         protected _exposedOnFrame: boolean;
-        isExposed: boolean;
         delegatedPort: BABYLON.Nullable<FrameNodePort>;
         get element(): HTMLDivElement;
         get portName(): string;

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

@@ -1 +1 @@
-{"thinEngineOnly":118576,"engineOnly":155016,"sceneOnly":521091,"minGridMaterial":661878,"minStandardMaterial":816230}
+{"thinEngineOnly":118576,"engineOnly":155016,"sceneOnly":521091,"minGridMaterial":661799,"minStandardMaterial":816151}

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

@@ -12062,8 +12062,9 @@ declare module "babylonjs/Materials/Textures/Procedurals/proceduralTexture" {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -45904,7 +45905,6 @@ declare module "babylonjs/Cameras/Inputs/flyCameraMouseInput" {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -55380,8 +55380,6 @@ declare module "babylonjs/Engines/nativeEngine" {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -55414,6 +55412,10 @@ declare module "babylonjs/Engines/nativeEngine" {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module "babylonjs/Engines/index" {
@@ -92280,8 +92282,9 @@ declare module BABYLON {
          * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
          * @param generateMipMaps Define if the texture should creates mip maps or not
          * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         * @param textureType The FBO internal texture type
          */
-        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean);
+        constructor(name: string, size: RenderTargetTextureSize, fragment: any, scene: Nullable<Scene>, fallbackTexture?: Nullable<Texture>, generateMipMaps?: boolean, isCube?: boolean, textureType?: number);
         /**
          * The effect that is created when initializing the post process.
          * @returns The created effect corresponding the the postprocess.
@@ -124814,7 +124817,6 @@ declare module BABYLON {
          * Higher values reduce its sensitivity.
          */
         angularSensibility: number;
-        private _mousemoveCallback;
         private _observer;
         private _rollObserver;
         private previousPosition;
@@ -133685,8 +133687,6 @@ declare module BABYLON {
          * @returns the cube texture as an InternalTexture
          */
         createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
-        private _getSamplingFilter;
-        private static _GetNativeTextureFormat;
         createRenderTargetTexture(size: number | {
             width: number;
             height: number;
@@ -133719,6 +133719,10 @@ declare module BABYLON {
         _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
         /** @hidden */
         _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
+        private _getNativeSamplingMode;
+        private _getNativeTextureFormat;
+        private _getNativeAlphaMode;
+        private _getNativeAttribType;
     }
 }
 declare module BABYLON {

Plik diff jest za duży
+ 5 - 5
dist/preview release/viewer/babylon.viewer.js


Plik diff jest za duży
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js