|
@@ -32495,6 +32495,45 @@ var Constants = /** @class */ (function () {
|
|
|
* Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
|
|
|
*/
|
|
|
Constants.ALPHA_SCREENMODE = 10;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending to SRC + DST
|
|
|
+ * Alpha will be set to SRC ALPHA + DST ALPHA
|
|
|
+ */
|
|
|
+ Constants.ALPHA_ONEONE_ONEONE = 11;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending to SRC * DST ALPHA + DST
|
|
|
+ * Alpha will be set to 0
|
|
|
+ */
|
|
|
+ Constants.ALPHA_ALPHATOCOLOR = 12;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending to SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
+ */
|
|
|
+ Constants.ALPHA_REVERSEONEMINUS = 13;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending to SRC + DST * (1 - SRC ALPHA)
|
|
|
+ * Alpha will be set to SRC ALPHA + DST ALPHA * (1 - SRC ALPHA)
|
|
|
+ */
|
|
|
+ Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending to SRC + DST
|
|
|
+ * Alpha will be set to SRC ALPHA
|
|
|
+ */
|
|
|
+ Constants.ALPHA_ONEONE_ONEZERO = 15;
|
|
|
+ /** Defines that alpha blending equation a SUM */
|
|
|
+ Constants.ALPHA_EQUATION_ADD = 0;
|
|
|
+ /** Defines that alpha blending equation a SUBSTRACTION */
|
|
|
+ Constants.ALPHA_EQUATION_SUBSTRACT = 1;
|
|
|
+ /** Defines that alpha blending equation a REVERSE SUBSTRACTION */
|
|
|
+ Constants.ALPHA_EQUATION_REVERSE_SUBTRACT = 2;
|
|
|
+ /** Defines that alpha blending equation a MAX operation */
|
|
|
+ Constants.ALPHA_EQUATION_MAX = 3;
|
|
|
+ /** Defines that alpha blending equation a MIN operation */
|
|
|
+ Constants.ALPHA_EQUATION_MIN = 4;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending equation a DARKEN operation:
|
|
|
+ * It takes the min of the src and sums the alpha channels.
|
|
|
+ */
|
|
|
+ Constants.ALPHA_EQUATION_DARKEN = 5;
|
|
|
/** Defines that the ressource is not delayed*/
|
|
|
Constants.DELAYLOADSTATE_NONE = 0;
|
|
|
/** Defines that the ressource was successfully delay loaded */
|
|
@@ -33127,7 +33166,9 @@ var Engine = /** @class */ (function () {
|
|
|
/** @hidden */
|
|
|
this._alphaState = new _States_index__WEBPACK_IMPORTED_MODULE_6__["_AlphaState"]();
|
|
|
/** @hidden */
|
|
|
- this._alphaMode = Engine.ALPHA_DISABLE;
|
|
|
+ this._alphaMode = Engine.ALPHA_ADD;
|
|
|
+ /** @hidden */
|
|
|
+ this._alphaEquation = Engine.ALPHA_DISABLE;
|
|
|
// Cache
|
|
|
/** @hidden */
|
|
|
this._internalTexturesCache = new Array();
|
|
@@ -33888,6 +33929,20 @@ var Engine = /** @class */ (function () {
|
|
|
this._caps.highPrecisionShaderSupported = vertex_highp.precision !== 0 && fragment_highp.precision !== 0;
|
|
|
}
|
|
|
}
|
|
|
+ if (this._webGLVersion > 1) {
|
|
|
+ this._caps.blendMinMax = true;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var blendMinMaxExtension = this._gl.getExtension('EXT_blend_minmax');
|
|
|
+ if (blendMinMaxExtension != null) {
|
|
|
+ this._caps.blendMinMax = true;
|
|
|
+ this._gl.MAX = blendMinMaxExtension.MAX_EXT;
|
|
|
+ this._gl.MIN = blendMinMaxExtension.MIN_EXT;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._caps.blendMinMax = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
// Depth buffer
|
|
|
this.setDepthBuffer(true);
|
|
|
this.setDepthFunctionToLessOrEqual();
|
|
@@ -36000,6 +36055,26 @@ var Engine = /** @class */ (function () {
|
|
|
this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
|
|
|
this._alphaState.alphaBlend = true;
|
|
|
break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_ONEONE_ONEONE:
|
|
|
+ this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE);
|
|
|
+ this._alphaState.alphaBlend = true;
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_ALPHATOCOLOR:
|
|
|
+ this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO);
|
|
|
+ this._alphaState.alphaBlend = true;
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_REVERSEONEMINUS:
|
|
|
+ this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA);
|
|
|
+ this._alphaState.alphaBlend = true;
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_SRC_DSTONEMINUSSRCALPHA:
|
|
|
+ this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
|
|
|
+ this._alphaState.alphaBlend = true;
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_ONEONE_ONEZERO:
|
|
|
+ this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO);
|
|
|
+ this._alphaState.alphaBlend = true;
|
|
|
+ break;
|
|
|
}
|
|
|
if (!noDepthWriteChange) {
|
|
|
this.setDepthWrite(mode === Engine.ALPHA_DISABLE);
|
|
@@ -36014,6 +36089,43 @@ var Engine = /** @class */ (function () {
|
|
|
Engine.prototype.getAlphaMode = function () {
|
|
|
return this._alphaMode;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Sets the current alpha equation
|
|
|
+ * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
|
+ */
|
|
|
+ Engine.prototype.setAlphaEquation = function (equation) {
|
|
|
+ if (this._alphaEquation === equation) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ switch (equation) {
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_ADD:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD, this._gl.FUNC_ADD);
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_SUBSTRACT:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT, this._gl.FUNC_SUBTRACT);
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_REVERSE_SUBTRACT:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT, this._gl.FUNC_REVERSE_SUBTRACT);
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_MAX:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.MAX, this._gl.MAX);
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_MIN:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.MIN);
|
|
|
+ break;
|
|
|
+ case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].ALPHA_EQUATION_DARKEN:
|
|
|
+ this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.FUNC_ADD);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this._alphaEquation = equation;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Gets the current alpha equation.
|
|
|
+ * @returns the current alpha equation
|
|
|
+ */
|
|
|
+ Engine.prototype.getAlphaEquation = function () {
|
|
|
+ return this._alphaEquation;
|
|
|
+ };
|
|
|
// Textures
|
|
|
/**
|
|
|
* Clears the list of texture accessible through engine.
|
|
@@ -43048,6 +43160,7 @@ var GamepadManager = /** @class */ (function () {
|
|
|
var disconnectedGamepad = _this._babylonGamepads[i];
|
|
|
disconnectedGamepad._isConnected = false;
|
|
|
_this.onGamepadDisconnectedObservable.notifyObservers(disconnectedGamepad);
|
|
|
+ disconnectedGamepad.dispose && disconnectedGamepad.dispose();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -64432,6 +64545,10 @@ var DistanceBlock = /** @class */ (function (_super) {
|
|
|
_this.registerInput("right", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].AutoDetect);
|
|
|
_this.registerOutput("output", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
_this._linkConnectionTypes(0, 1);
|
|
|
+ _this._inputs[0].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
+ _this._inputs[0].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Matrix);
|
|
|
+ _this._inputs[1].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
+ _this._inputs[1].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Matrix);
|
|
|
return _this;
|
|
|
}
|
|
|
/**
|
|
@@ -65509,6 +65626,8 @@ var NormalizeBlock = /** @class */ (function (_super) {
|
|
|
_this.registerInput("input", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].AutoDetect);
|
|
|
_this.registerOutput("output", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].BasedOnInput);
|
|
|
_this._outputs[0]._typeConnectionSource = _this._inputs[0];
|
|
|
+ _this._inputs[0].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
+ _this._inputs[0].excludedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Matrix);
|
|
|
return _this;
|
|
|
}
|
|
|
/**
|