|
@@ -15043,11 +15043,6 @@ var FlyCameraMouseInput = /** @class */ (function () {
|
|
_this.camera.restoreRoll(_this.camera.rollCorrect);
|
|
_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.
|
|
* Detach the current controls from the specified dom element.
|
|
@@ -15057,9 +15052,6 @@ var FlyCameraMouseInput = /** @class */ (function () {
|
|
if (this._observer && element) {
|
|
if (this._observer && element) {
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver);
|
|
this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver);
|
|
- if (this._mousemoveCallback) {
|
|
|
|
- element.removeEventListener("mousemove", this._mousemoveCallback);
|
|
|
|
- }
|
|
|
|
this._observer = null;
|
|
this._observer = null;
|
|
this._rollObserver = null;
|
|
this._rollObserver = null;
|
|
this.previousPosition = null;
|
|
this.previousPosition = null;
|
|
@@ -15113,6 +15105,10 @@ var FlyCameraMouseInput = /** @class */ (function () {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
this.element.focus();
|
|
this.element.focus();
|
|
}
|
|
}
|
|
|
|
+ // This is required to move while pointer button is down
|
|
|
|
+ if (engine.isPointerLock) {
|
|
|
|
+ this._onMouseMove(p.event);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
// Mouse up.
|
|
// Mouse up.
|
|
@@ -15132,7 +15128,10 @@ var FlyCameraMouseInput = /** @class */ (function () {
|
|
else
|
|
else
|
|
// Mouse move.
|
|
// Mouse move.
|
|
if (p.type === _Events_pointerEvents__WEBPACK_IMPORTED_MODULE_3__["PointerEventTypes"].POINTERMOVE) {
|
|
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;
|
|
return;
|
|
}
|
|
}
|
|
var offsetX = e.clientX - this.previousPosition.x;
|
|
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) {
|
|
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;
|
|
return;
|
|
}
|
|
}
|
|
var offsetX = evt.clientX - _this.previousPosition.x;
|
|
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);
|
|
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);
|
|
element.addEventListener("contextmenu", this.onContextMenu.bind(this), false);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -16677,9 +16678,6 @@ var FreeCameraMouseInput = /** @class */ (function () {
|
|
FreeCameraMouseInput.prototype.detachControl = function (element) {
|
|
FreeCameraMouseInput.prototype.detachControl = function (element) {
|
|
if (this._observer && element) {
|
|
if (this._observer && element) {
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
- if (this._onMouseMove) {
|
|
|
|
- element.removeEventListener("mousemove", this._onMouseMove);
|
|
|
|
- }
|
|
|
|
if (this.onContextMenu) {
|
|
if (this.onContextMenu) {
|
|
element.removeEventListener("contextmenu", 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 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 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 _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 _super !== null && _super.apply(this, arguments) || this;
|
|
}
|
|
}
|
|
return NativeDataBuffer;
|
|
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 */
|
|
/** @hidden */
|
|
var NativeTexture = /** @class */ (function (_super) {
|
|
var NativeTexture = /** @class */ (function (_super) {
|
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NativeTexture, _super);
|
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NativeTexture, _super);
|
|
@@ -37442,7 +37377,7 @@ var NativeTexture = /** @class */ (function (_super) {
|
|
return 1;
|
|
return 1;
|
|
};
|
|
};
|
|
return NativeTexture;
|
|
return NativeTexture;
|
|
-}(_Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_2__["InternalTexture"]));
|
|
|
|
|
|
+}(_Materials_Textures_internalTexture__WEBPACK_IMPORTED_MODULE_3__["InternalTexture"]));
|
|
/** @hidden */
|
|
/** @hidden */
|
|
var NativeEngine = /** @class */ (function (_super) {
|
|
var NativeEngine = /** @class */ (function (_super) {
|
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NativeEngine, _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 */
|
|
/** Defines the invalid handle returned by bgfx when resource creation goes wrong */
|
|
_this.INVALID_HANDLE = 65535;
|
|
_this.INVALID_HANDLE = 65535;
|
|
_this._boundBuffersVertexArray = null;
|
|
_this._boundBuffersVertexArray = null;
|
|
- _this._currentDepthTest = DepthTest.DEPTH_TEST_LEQUAL;
|
|
|
|
|
|
+ _this._currentDepthTest = _this._native.DEPTH_TEST_LEQUAL;
|
|
_this._webGLVersion = 2;
|
|
_this._webGLVersion = 2;
|
|
_this.disableUniformBuffers = true;
|
|
_this.disableUniformBuffers = true;
|
|
// TODO: Initialize this more correctly based on the hardware capabilities.
|
|
// TODO: Initialize this more correctly based on the hardware capabilities.
|
|
@@ -37494,9 +37429,9 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
blendMinMax: false,
|
|
blendMinMax: false,
|
|
maxMSAASamples: 1
|
|
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);
|
|
Function(data).apply(null);
|
|
if (onSuccess) {
|
|
if (onSuccess) {
|
|
onSuccess();
|
|
onSuccess();
|
|
@@ -37518,7 +37453,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
window.Blob = function () { };
|
|
window.Blob = function () { };
|
|
}
|
|
}
|
|
// Shader processor
|
|
// 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;
|
|
return _this;
|
|
}
|
|
}
|
|
NativeEngine.prototype.getHardwareScalingLevel = function () {
|
|
NativeEngine.prototype.getHardwareScalingLevel = function () {
|
|
@@ -37575,15 +37510,15 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
var mode = 0;
|
|
var mode = 0;
|
|
if (backBuffer && color) {
|
|
if (backBuffer && color) {
|
|
this._native.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
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) {
|
|
if (depth) {
|
|
this._native.clearDepth(1.0);
|
|
this._native.clearDepth(1.0);
|
|
- mode |= NativeClearFlags.CLEAR_DEPTH;
|
|
|
|
|
|
+ mode |= this._native.CLEAR_FLAG_DEPTH;
|
|
}
|
|
}
|
|
if (stencil) {
|
|
if (stencil) {
|
|
this._native.clearStencil(0);
|
|
this._native.clearStencil(0);
|
|
- mode |= NativeClearFlags.CLEAR_STENCIL;
|
|
|
|
|
|
+ mode |= this._native.CLEAR_FLAG_STENCIL;
|
|
}
|
|
}
|
|
this._native.clear(mode);
|
|
this._native.clear(mode);
|
|
};
|
|
};
|
|
@@ -37625,7 +37560,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
if (vertexBuffer) {
|
|
if (vertexBuffer) {
|
|
var buffer = vertexBuffer.getBuffer();
|
|
var buffer = vertexBuffer.getBuffer();
|
|
if (buffer) {
|
|
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) {
|
|
NativeEngine.prototype.createShaderProgram = function (pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings) {
|
|
if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; }
|
|
if (transformFeedbackVaryings === void 0) { transformFeedbackVaryings = null; }
|
|
this.onBeforeShaderCompilationObservable.notifyObservers(this);
|
|
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();
|
|
vertexInliner.processCode();
|
|
vertexCode = vertexInliner.code;
|
|
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();
|
|
fragmentInliner.processCode();
|
|
fragmentCode = fragmentInliner.code;
|
|
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);
|
|
var program = this._native.createProgram(vertexCode, fragmentCode);
|
|
this.onAfterShaderCompilationObservable.notifyObservers(this);
|
|
this.onAfterShaderCompilationObservable.notifyObservers(this);
|
|
return program;
|
|
return program;
|
|
@@ -37813,7 +37748,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
* @param enable defines the state to set
|
|
* @param enable defines the state to set
|
|
*/
|
|
*/
|
|
NativeEngine.prototype.setDepthBuffer = function (enable) {
|
|
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
|
|
* Gets a boolean indicating if depth writing is enabled
|
|
@@ -37823,19 +37758,19 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
return this._native.getDepthWrite();
|
|
return this._native.getDepthWrite();
|
|
};
|
|
};
|
|
NativeEngine.prototype.setDepthFunctionToGreater = function () {
|
|
NativeEngine.prototype.setDepthFunctionToGreater = function () {
|
|
- this._currentDepthTest = DepthTest.DEPTH_TEST_GREATER;
|
|
|
|
|
|
+ this._currentDepthTest = this._native.DEPTH_TEST_GREATER;
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
};
|
|
};
|
|
NativeEngine.prototype.setDepthFunctionToGreaterOrEqual = function () {
|
|
NativeEngine.prototype.setDepthFunctionToGreaterOrEqual = function () {
|
|
- this._currentDepthTest = DepthTest.DEPTH_TEST_GEQUAL;
|
|
|
|
|
|
+ this._currentDepthTest = this._native.DEPTH_TEST_GEQUAL;
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
};
|
|
};
|
|
NativeEngine.prototype.setDepthFunctionToLess = function () {
|
|
NativeEngine.prototype.setDepthFunctionToLess = function () {
|
|
- this._currentDepthTest = DepthTest.DEPTH_TEST_LESS;
|
|
|
|
|
|
+ this._currentDepthTest = this._native.DEPTH_TEST_LESS;
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
};
|
|
};
|
|
NativeEngine.prototype.setDepthFunctionToLessOrEqual = function () {
|
|
NativeEngine.prototype.setDepthFunctionToLessOrEqual = function () {
|
|
- this._currentDepthTest = DepthTest.DEPTH_TEST_LEQUAL;
|
|
|
|
|
|
+ this._currentDepthTest = this._native.DEPTH_TEST_LEQUAL;
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
this._native.setDepthTest(this._currentDepthTest);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -37881,9 +37816,10 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
if (this._alphaMode === mode) {
|
|
if (this._alphaMode === mode) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ mode = this._getNativeAlphaMode(mode);
|
|
this._native.setBlendMode(mode);
|
|
this._native.setBlendMode(mode);
|
|
if (!noDepthWriteChange) {
|
|
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;
|
|
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) {
|
|
NativeEngine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format, forcedExtension, mimeType) {
|
|
var _this = this;
|
|
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 (onLoad === void 0) { onLoad = null; }
|
|
if (onError === void 0) { onError = null; }
|
|
if (onError === void 0) { onError = null; }
|
|
if (buffer === void 0) { buffer = null; }
|
|
if (buffer === void 0) { buffer = null; }
|
|
@@ -38105,7 +38041,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
var fromData = url.substr(0, 5) === "data:";
|
|
var fromData = url.substr(0, 5) === "data:";
|
|
//const fromBlob = url.substr(0, 5) === "blob:";
|
|
//const fromBlob = url.substr(0, 5) === "blob:";
|
|
var isBase64 = fromData && url.indexOf(";base64,") !== -1;
|
|
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;
|
|
var originalUrl = url;
|
|
if (this._transformTextureUrl && !isBase64 && !fallback && !buffer) {
|
|
if (this._transformTextureUrl && !isBase64 && !fallback && !buffer) {
|
|
url = this._transformTextureUrl(url);
|
|
url = this._transformTextureUrl(url);
|
|
@@ -38147,16 +38083,16 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
if (onLoadObserver) {
|
|
if (onLoadObserver) {
|
|
texture.onLoadedObservable.remove(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) {
|
|
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 {
|
|
else {
|
|
// fall back to the original url if the transformed url fails to load
|
|
// 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);
|
|
_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.width = texture.baseWidth;
|
|
texture.height = texture.baseHeight;
|
|
texture.height = texture.baseHeight;
|
|
texture.isReady = true;
|
|
texture.isReady = true;
|
|
- var filter = _this._getSamplingFilter(samplingMode);
|
|
|
|
|
|
+ var filter = _this._getNativeSamplingMode(samplingMode);
|
|
_this._native.setTextureSampling(webGLTexture, filter);
|
|
_this._native.setTextureSampling(webGLTexture, filter);
|
|
if (scene) {
|
|
if (scene) {
|
|
scene._removePendingData(texture);
|
|
scene._removePendingData(texture);
|
|
@@ -38198,7 +38134,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
onload_1(buffer);
|
|
onload_1(buffer);
|
|
}
|
|
}
|
|
else if (typeof buffer === "string") {
|
|
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 {
|
|
else {
|
|
throw new Error("Unsupported buffer type");
|
|
throw new Error("Unsupported buffer type");
|
|
@@ -38206,7 +38142,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
if (isBase64) {
|
|
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 {
|
|
else {
|
|
this._loadFile(url, function (data) { return onload_1(new Uint8Array(data)); }, undefined, undefined, true, function (request, exception) {
|
|
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 (lodScale === void 0) { lodScale = 0; }
|
|
if (lodOffset === void 0) { lodOffset = 0; }
|
|
if (lodOffset === void 0) { lodOffset = 0; }
|
|
if (fallback === void 0) { fallback = null; }
|
|
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.isCube = true;
|
|
texture.url = rootUrl;
|
|
texture.url = rootUrl;
|
|
texture.generateMipMaps = !noMipmap;
|
|
texture.generateMipMaps = !noMipmap;
|
|
@@ -38257,10 +38193,10 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
// TODO: use texture loader to load env files?
|
|
// TODO: use texture loader to load env files?
|
|
if (extension === ".env") {
|
|
if (extension === ".env") {
|
|
var onloaddata_1 = function (data) {
|
|
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.width = info.width;
|
|
texture.height = 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) {
|
|
if (info.version !== 1) {
|
|
throw new Error("Unsupported babylon environment map version \"" + info.version + "\"");
|
|
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");
|
|
throw new Error("Nothing else parsed so far");
|
|
}
|
|
}
|
|
texture._lodGenerationScale = specularInfo.lodGenerationScale;
|
|
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.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._isRGBD = true;
|
|
texture.invertY = true;
|
|
texture.invertY = true;
|
|
_this._native.loadCubeTextureWithMips(texture._webGLTexture, imageData, function () {
|
|
_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].
|
|
// 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]];
|
|
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) {
|
|
return new Promise(function (resolve, reject) {
|
|
_this._native.loadCubeTexture(texture._webGLTexture, data, !noMipmap, resolve, reject);
|
|
_this._native.loadCubeTexture(texture._webGLTexture, data, !noMipmap, resolve, reject);
|
|
});
|
|
});
|
|
@@ -38321,86 +38257,40 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
this._internalTexturesCache.push(texture);
|
|
this._internalTexturesCache.push(texture);
|
|
return 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) {
|
|
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") {
|
|
if (options !== undefined && typeof options === "object") {
|
|
fullOptions.generateMipMaps = options.generateMipMaps;
|
|
fullOptions.generateMipMaps = options.generateMipMaps;
|
|
fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
|
|
fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
|
|
fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
|
|
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 {
|
|
else {
|
|
fullOptions.generateMipMaps = options;
|
|
fullOptions.generateMipMaps = options;
|
|
fullOptions.generateDepthBuffer = true;
|
|
fullOptions.generateDepthBuffer = true;
|
|
fullOptions.generateStencilBuffer = false;
|
|
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
|
|
// 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
|
|
// 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 width = size.width || size;
|
|
var height = size.height || 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._framebuffer = framebuffer;
|
|
texture.baseWidth = width;
|
|
texture.baseWidth = width;
|
|
texture.baseHeight = height;
|
|
texture.baseHeight = height;
|
|
@@ -38419,7 +38309,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
};
|
|
};
|
|
NativeEngine.prototype.updateTextureSamplingMode = function (samplingMode, texture) {
|
|
NativeEngine.prototype.updateTextureSamplingMode = function (samplingMode, texture) {
|
|
if (texture._webGLTexture) {
|
|
if (texture._webGLTexture) {
|
|
- var filter = this._getSamplingFilter(samplingMode);
|
|
|
|
|
|
+ var filter = this._getNativeSamplingMode(samplingMode);
|
|
this._native.setTextureSampling(texture._webGLTexture, filter);
|
|
this._native.setTextureSampling(texture._webGLTexture, filter);
|
|
}
|
|
}
|
|
texture.samplingMode = samplingMode;
|
|
texture.samplingMode = samplingMode;
|
|
@@ -38439,7 +38329,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
NativeEngine.prototype.unBindFramebuffer = function (texture, disableGenerateMipMaps, onBeforeUnbind) {
|
|
NativeEngine.prototype.unBindFramebuffer = function (texture, disableGenerateMipMaps, onBeforeUnbind) {
|
|
if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; }
|
|
if (disableGenerateMipMaps === void 0) { disableGenerateMipMaps = false; }
|
|
if (disableGenerateMipMaps) {
|
|
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) {
|
|
if (onBeforeUnbind) {
|
|
onBeforeUnbind();
|
|
onBeforeUnbind();
|
|
@@ -38489,7 +38379,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
this._activeChannel = channel;
|
|
this._activeChannel = channel;
|
|
texture.update();
|
|
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();
|
|
texture.delayLoad();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -38538,12 +38428,12 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
// Returns a NativeAddressMode.XXX value.
|
|
// Returns a NativeAddressMode.XXX value.
|
|
NativeEngine.prototype._getAddressMode = function (wrapMode) {
|
|
NativeEngine.prototype._getAddressMode = function (wrapMode) {
|
|
switch (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:
|
|
default:
|
|
throw new Error("Unexpected wrap mode: " + wrapMode + ".");
|
|
throw new Error("Unexpected wrap mode: " + wrapMode + ".");
|
|
}
|
|
}
|
|
@@ -38589,6 +38479,92 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
if (lod === void 0) { lod = 0; }
|
|
if (lod === void 0) { lod = 0; }
|
|
throw new Error("_uploadArrayBufferViewToTexture not implemented.");
|
|
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;
|
|
return NativeEngine;
|
|
}(_Engines_engine__WEBPACK_IMPORTED_MODULE_1__["Engine"]));
|
|
}(_Engines_engine__WEBPACK_IMPORTED_MODULE_1__["Engine"]));
|
|
|
|
|
|
@@ -82771,8 +82747,8 @@ var NodeMaterialConnectionPoint = /** @class */ (function () {
|
|
serializationObject.isExposedOnFrame = true;
|
|
serializationObject.isExposedOnFrame = true;
|
|
serializationObject.exposedPortPosition = this.exposedPortPosition;
|
|
serializationObject.exposedPortPosition = this.exposedPortPosition;
|
|
}
|
|
}
|
|
- if (this.isExposedOnFrame) {
|
|
|
|
- serializationObject.isExposedOnFrame = this.isExposedOnFrame;
|
|
|
|
|
|
+ if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
|
|
|
|
+ serializationObject.isExposedOnFrame = true;
|
|
serializationObject.exposedPortPosition = this.exposedPortPosition;
|
|
serializationObject.exposedPortPosition = this.exposedPortPosition;
|
|
}
|
|
}
|
|
return serializationObject;
|
|
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 _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 _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_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 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 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 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 (fallbackTexture === void 0) { fallbackTexture = null; }
|
|
if (generateMipMaps === void 0) { generateMipMaps = true; }
|
|
if (generateMipMaps === void 0) { generateMipMaps = true; }
|
|
if (isCube === void 0) { isCube = false; }
|
|
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;
|
|
var _this = _super.call(this, null, scene, !generateMipMaps) || this;
|
|
/**
|
|
/**
|
|
* Define if the texture is enabled or not (disabled texture will not render)
|
|
* 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.setFragment(fragment);
|
|
_this._fallbackTexture = fallbackTexture;
|
|
_this._fallbackTexture = fallbackTexture;
|
|
if (isCube) {
|
|
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);
|
|
_this.setFloat("face", 0);
|
|
}
|
|
}
|
|
else {
|
|
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
|
|
// VBO
|
|
var vertices = [];
|
|
var vertices = [];
|