|
@@ -35118,16 +35118,16 @@ var Constants = /** @class */ (function () {
|
|
|
Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
|
|
|
/** FLOAT_32_UNSIGNED_INT_24_8_REV */
|
|
|
Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
|
|
|
- /** nearest is mag = nearest and min = nearest and mip = nearest */
|
|
|
+ /** nearest is mag = nearest and min = nearest and no mip */
|
|
|
Constants.TEXTURE_NEAREST_SAMPLINGMODE = 1;
|
|
|
- /** Bilinear is mag = linear and min = linear and mip = nearest */
|
|
|
+ /** mag = nearest and min = nearest and mip = none */
|
|
|
+ Constants.TEXTURE_NEAREST_NEAREST = 1;
|
|
|
+ /** Bilinear is mag = linear and min = linear and no mip */
|
|
|
Constants.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
|
|
|
+ /** mag = linear and min = linear and mip = none */
|
|
|
+ Constants.TEXTURE_LINEAR_LINEAR = 2;
|
|
|
/** Trilinear is mag = linear and min = linear and mip = linear */
|
|
|
Constants.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
|
|
|
- /** nearest is mag = nearest and min = nearest and mip = linear */
|
|
|
- Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1;
|
|
|
- /** Bilinear is mag = linear and min = linear and mip = nearest */
|
|
|
- Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
|
|
|
/** Trilinear is mag = linear and min = linear and mip = linear */
|
|
|
Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
|
|
|
/** mag = nearest and min = nearest and mip = nearest */
|
|
@@ -35138,14 +35138,14 @@ var Constants = /** @class */ (function () {
|
|
|
Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
|
|
|
/** mag = nearest and min = linear and mip = none */
|
|
|
Constants.TEXTURE_NEAREST_LINEAR = 7;
|
|
|
- /** mag = nearest and min = nearest and mip = none */
|
|
|
- Constants.TEXTURE_NEAREST_NEAREST = 8;
|
|
|
+ /** nearest is mag = nearest and min = nearest and mip = linear */
|
|
|
+ Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;
|
|
|
/** mag = linear and min = nearest and mip = nearest */
|
|
|
Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
|
|
|
/** mag = linear and min = nearest and mip = linear */
|
|
|
Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
|
|
|
- /** mag = linear and min = linear and mip = none */
|
|
|
- Constants.TEXTURE_LINEAR_LINEAR = 11;
|
|
|
+ /** Bilinear is mag = linear and min = linear and mip = nearest */
|
|
|
+ Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;
|
|
|
/** mag = linear and min = nearest and mip = none */
|
|
|
Constants.TEXTURE_LINEAR_NEAREST = 12;
|
|
|
/** Explicit coordinates mode */
|
|
@@ -39614,7 +39614,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
*/
|
|
|
// Not mixed with Version for tooling purpose.
|
|
|
get: function () {
|
|
|
- return "babylonjs@4.1.0-beta.15";
|
|
|
+ return "babylonjs@4.1.0-beta.17";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -39624,7 +39624,7 @@ var ThinEngine = /** @class */ (function () {
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "4.1.0-beta.15";
|
|
|
+ return "4.1.0-beta.17";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -63260,7 +63260,7 @@ var BackgroundMaterial = /** @class */ (function (_super) {
|
|
|
var _this = this;
|
|
|
if (useInstances === void 0) { useInstances = false; }
|
|
|
if (subMesh.effect && this.isFrozen) {
|
|
|
- if (this._wasPreviouslyReady) {
|
|
|
+ if (subMesh.effect._wasPreviouslyReady) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -63488,7 +63488,7 @@ var BackgroundMaterial = /** @class */ (function (_super) {
|
|
|
return false;
|
|
|
}
|
|
|
defines._renderId = scene.getRenderId();
|
|
|
- this._wasPreviouslyReady = true;
|
|
|
+ subMesh.effect._wasPreviouslyReady = true;
|
|
|
return true;
|
|
|
};
|
|
|
/**
|
|
@@ -66564,21 +66564,22 @@ var InputBlock = /** @class */ (function (_super) {
|
|
|
this._emit(state);
|
|
|
};
|
|
|
InputBlock.prototype._dumpPropertiesCode = function () {
|
|
|
+ var variableName = this._codeVariableName;
|
|
|
if (this.isAttribute) {
|
|
|
- return this._codeVariableName + ".setAsAttribute(\"" + this.name + "\");\r\n";
|
|
|
+ return variableName + ".setAsAttribute(\"" + this.name + "\");\r\n";
|
|
|
}
|
|
|
if (this.isSystemValue) {
|
|
|
- return this._codeVariableName + ".setAsSystemValue(BABYLON.NodeMaterialSystemValues." + _Enums_nodeMaterialSystemValues__WEBPACK_IMPORTED_MODULE_4__["NodeMaterialSystemValues"][this._systemValue] + ");\r\n";
|
|
|
+ return variableName + ".setAsSystemValue(BABYLON.NodeMaterialSystemValues." + _Enums_nodeMaterialSystemValues__WEBPACK_IMPORTED_MODULE_4__["NodeMaterialSystemValues"][this._systemValue] + ");\r\n";
|
|
|
}
|
|
|
if (this.isUniform) {
|
|
|
var valueString = "";
|
|
|
switch (this.type) {
|
|
|
case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float:
|
|
|
- var returnValue = this._codeVariableName + ".value = " + this.value + ";\r\n";
|
|
|
- returnValue += this._codeVariableName + ".min = " + this.min + ";\r\n";
|
|
|
- returnValue += this._codeVariableName + ".max = " + this.max + ";\r\n";
|
|
|
- returnValue += this._codeVariableName + ".matrixMode = " + this.matrixMode + ";\r\n";
|
|
|
- returnValue += this._codeVariableName + ".animationType = BABYLON.AnimatedInputBlockTypes." + _animatedInputBlockTypes__WEBPACK_IMPORTED_MODULE_9__["AnimatedInputBlockTypes"][this.animationType] + ";\r\n";
|
|
|
+ var returnValue = variableName + ".value = " + this.value + ";\r\n";
|
|
|
+ returnValue += variableName + ".min = " + this.min + ";\r\n";
|
|
|
+ returnValue += variableName + ".max = " + this.max + ";\r\n";
|
|
|
+ returnValue += variableName + ".matrixMode = " + this.matrixMode + ";\r\n";
|
|
|
+ returnValue += variableName + ".animationType = BABYLON.AnimatedInputBlockTypes." + _animatedInputBlockTypes__WEBPACK_IMPORTED_MODULE_9__["AnimatedInputBlockTypes"][this.animationType] + ";\r\n";
|
|
|
return returnValue;
|
|
|
case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Vector2:
|
|
|
valueString = "new BABYLON.Vector2(" + this.value.x + ", " + this.value.y + ")";
|
|
@@ -66596,9 +66597,9 @@ var InputBlock = /** @class */ (function (_super) {
|
|
|
valueString = "new BABYLON.Color4(" + this.value.r + ", " + this.value.g + ", " + this.value.b + ", " + this.value.a + ")";
|
|
|
break;
|
|
|
}
|
|
|
- var finalOutput = this._codeVariableName + ".value = " + valueString + ";\r\n";
|
|
|
- finalOutput += this._codeVariableName + ".isConstant = " + (this.isConstant ? "true" : "false") + ";\r\n";
|
|
|
- finalOutput += this._codeVariableName + ".visibleInInspector = " + (this.visibleInInspector ? "true" : "false") + ";\r\n";
|
|
|
+ var finalOutput = variableName + ".value = " + valueString + ";\r\n";
|
|
|
+ finalOutput += variableName + ".isConstant = " + (this.isConstant ? "true" : "false") + ";\r\n";
|
|
|
+ finalOutput += variableName + ".visibleInInspector = " + (this.visibleInInspector ? "true" : "false") + ";\r\n";
|
|
|
return finalOutput;
|
|
|
}
|
|
|
return "";
|
|
@@ -71208,7 +71209,7 @@ var SimplexPerlin3DBlock = /** @class */ (function (_super) {
|
|
|
functionString += " kernel_weights = kernel_weights*kernel_weights*kernel_weights;\r\n";
|
|
|
functionString += " return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\r\n";
|
|
|
functionString += "}\r\n";
|
|
|
- state._emitFunction('SimplexPerlin3D', functionString, 'SimplexPerlin3D');
|
|
|
+ state._emitFunction('SimplexPerlin3D', functionString, '// SimplexPerlin3D');
|
|
|
state.compilationString += this._declareOutput(this._outputs[0], state) + (" = SimplexPerlin3D(" + this.seed.associatedVariableName + ");\r\n");
|
|
|
return this;
|
|
|
};
|
|
@@ -72711,7 +72712,7 @@ var WorleyNoise3DBlock = /** @class */ (function (_super) {
|
|
|
functionString += " d11.y = min(d11.y,d11.z); // Done! (Phew!)\r\n";
|
|
|
functionString += " return sqrt(d11.xy); // F1, F2\r\n";
|
|
|
functionString += "}\r\n\r\n";
|
|
|
- state._emitFunction('worley3D', functionString, 'worley3D');
|
|
|
+ state._emitFunction('worley3D', functionString, '// Worley3D');
|
|
|
state.compilationString += this._declareOutput(this._outputs[0], state) + (" = worley(" + this.seed.associatedVariableName + ", " + this.jitter.associatedVariableName + ", " + this.manhattanDistance + ");\r\n");
|
|
|
return this;
|
|
|
};
|
|
@@ -73727,7 +73728,7 @@ var NodeMaterial = /** @class */ (function (_super) {
|
|
|
}
|
|
|
}
|
|
|
if (subMesh.effect && this.isFrozen) {
|
|
|
- if (this._wasPreviouslyReady) {
|
|
|
+ if (subMesh.effect._wasPreviouslyReady) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -73821,7 +73822,7 @@ var NodeMaterial = /** @class */ (function (_super) {
|
|
|
return false;
|
|
|
}
|
|
|
defines._renderId = scene.getRenderId();
|
|
|
- this._wasPreviouslyReady = true;
|
|
|
+ subMesh.effect._wasPreviouslyReady = true;
|
|
|
return true;
|
|
|
};
|
|
|
Object.defineProperty(NodeMaterial.prototype, "compiledShaders", {
|
|
@@ -74753,7 +74754,7 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
|
var codeString;
|
|
|
// Get unique name
|
|
|
var nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, "");
|
|
|
- this._codeVariableName = nameAsVariableName;
|
|
|
+ this._codeVariableName = nameAsVariableName || this.getClassName() + "_" + this.uniqueId;
|
|
|
if (uniqueNames.indexOf(this._codeVariableName) !== -1) {
|
|
|
var index = 0;
|
|
|
do {
|
|
@@ -76956,7 +76957,7 @@ var PBRBaseMaterial = /** @class */ (function (_super) {
|
|
|
*/
|
|
|
PBRBaseMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
|
|
|
if (subMesh.effect && this.isFrozen) {
|
|
|
- if (this._wasPreviouslyReady) {
|
|
|
+ if (subMesh.effect._wasPreviouslyReady) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -77079,7 +77080,7 @@ var PBRBaseMaterial = /** @class */ (function (_super) {
|
|
|
return false;
|
|
|
}
|
|
|
defines._renderId = scene.getRenderId();
|
|
|
- this._wasPreviouslyReady = true;
|
|
|
+ subMesh.effect._wasPreviouslyReady = true;
|
|
|
return true;
|
|
|
};
|
|
|
/**
|
|
@@ -88801,6 +88802,11 @@ var Effect = /** @class */ (function () {
|
|
|
this.onErrorObservable = new _Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
|
|
|
/** @hidden */
|
|
|
this._onBindObservable = null;
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ * Specifies if the effect was previously ready
|
|
|
+ */
|
|
|
+ this._wasPreviouslyReady = false;
|
|
|
/** @hidden */
|
|
|
this._bonesComputationForcedToCPU = false;
|
|
|
this._uniformBuffersNames = {};
|
|
@@ -91379,11 +91385,6 @@ var Material = /** @class */ (function () {
|
|
|
*/
|
|
|
this._effect = null;
|
|
|
/**
|
|
|
- * @hidden
|
|
|
- * Specifies if the material was previously ready
|
|
|
- */
|
|
|
- this._wasPreviouslyReady = false;
|
|
|
- /**
|
|
|
* Specifies if uniform buffers should be used
|
|
|
*/
|
|
|
this._useUBO = false;
|
|
@@ -91697,14 +91698,14 @@ var Material = /** @class */ (function () {
|
|
|
* Locks updates for the material
|
|
|
*/
|
|
|
Material.prototype.freeze = function () {
|
|
|
- this._wasPreviouslyReady = false;
|
|
|
+ this.markDirty();
|
|
|
this.checkReadyOnlyOnce = true;
|
|
|
};
|
|
|
/**
|
|
|
* Unlocks updates for the material
|
|
|
*/
|
|
|
Material.prototype.unfreeze = function () {
|
|
|
- this._wasPreviouslyReady = false;
|
|
|
+ this.markDirty();
|
|
|
this.checkReadyOnlyOnce = false;
|
|
|
};
|
|
|
/**
|
|
@@ -91773,7 +91774,23 @@ var Material = /** @class */ (function () {
|
|
|
* Marks the material to indicate that it needs to be re-calculated
|
|
|
*/
|
|
|
Material.prototype.markDirty = function () {
|
|
|
- this._wasPreviouslyReady = false;
|
|
|
+ var meshes = this.getScene().meshes;
|
|
|
+ for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
|
|
|
+ var mesh = meshes_1[_i];
|
|
|
+ if (!mesh.subMeshes) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (var _a = 0, _b = mesh.subMeshes; _a < _b.length; _a++) {
|
|
|
+ var subMesh = _b[_a];
|
|
|
+ if (subMesh.getMaterial() !== this) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!subMesh.effect) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ subMesh.effect._wasPreviouslyReady = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
/** @hidden */
|
|
|
Material.prototype._preBind = function (effect, overrideOrientation) {
|
|
@@ -92041,8 +92058,8 @@ var Material = /** @class */ (function () {
|
|
|
return;
|
|
|
}
|
|
|
var meshes = this.getScene().meshes;
|
|
|
- for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
|
|
|
- var mesh = meshes_1[_i];
|
|
|
+ for (var _i = 0, meshes_2 = meshes; _i < meshes_2.length; _i++) {
|
|
|
+ var mesh = meshes_2[_i];
|
|
|
if (!mesh.subMeshes) {
|
|
|
continue;
|
|
|
}
|
|
@@ -92138,8 +92155,8 @@ var Material = /** @class */ (function () {
|
|
|
}
|
|
|
else {
|
|
|
var meshes = scene.meshes;
|
|
|
- for (var _i = 0, meshes_2 = meshes; _i < meshes_2.length; _i++) {
|
|
|
- var mesh = meshes_2[_i];
|
|
|
+ for (var _i = 0, meshes_3 = meshes; _i < meshes_3.length; _i++) {
|
|
|
+ var mesh = meshes_3[_i];
|
|
|
if (mesh.material === this && !mesh.sourceMesh) {
|
|
|
mesh.material = null;
|
|
|
this.releaseVertexArrayObject(mesh, forceDisposeEffect);
|
|
@@ -94381,7 +94398,7 @@ var ShaderMaterial = /** @class */ (function (_super) {
|
|
|
*/
|
|
|
ShaderMaterial.prototype.isReady = function (mesh, useInstances) {
|
|
|
if (this._effect && this.isFrozen) {
|
|
|
- if (this._wasPreviouslyReady) {
|
|
|
+ if (this._effect._wasPreviouslyReady) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -94483,7 +94500,7 @@ var ShaderMaterial = /** @class */ (function (_super) {
|
|
|
scene.resetCachedMaterial();
|
|
|
}
|
|
|
this._renderId = scene.getRenderId();
|
|
|
- this._wasPreviouslyReady = true;
|
|
|
+ this._effect._wasPreviouslyReady = true;
|
|
|
return true;
|
|
|
};
|
|
|
/**
|
|
@@ -95487,7 +95504,7 @@ var StandardMaterial = /** @class */ (function (_super) {
|
|
|
StandardMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
|
|
|
if (useInstances === void 0) { useInstances = false; }
|
|
|
if (subMesh.effect && this.isFrozen) {
|
|
|
- if (this._wasPreviouslyReady) {
|
|
|
+ if (subMesh.effect._wasPreviouslyReady) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -95847,7 +95864,7 @@ var StandardMaterial = /** @class */ (function (_super) {
|
|
|
return false;
|
|
|
}
|
|
|
defines._renderId = scene.getRenderId();
|
|
|
- this._wasPreviouslyReady = true;
|
|
|
+ subMesh.effect._wasPreviouslyReady = true;
|
|
|
return true;
|
|
|
};
|
|
|
/**
|
|
@@ -135475,6 +135492,13 @@ var Tools = /** @class */ (function () {
|
|
|
});
|
|
|
};
|
|
|
/**
|
|
|
+ * Utility function to detect if the current user agent is Safari
|
|
|
+ * @returns whether or not the current user agent is safari
|
|
|
+ */
|
|
|
+ Tools.IsSafari = function () {
|
|
|
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Enable/Disable Custom HTTP Request Headers globally.
|
|
|
* default = false
|
|
|
* @see CustomRequestHeaders
|
|
@@ -159583,6 +159607,9 @@ var PostProcess = /** @class */ (function () {
|
|
|
}
|
|
|
var desiredWidth = (this._options.width || requiredWidth);
|
|
|
var desiredHeight = this._options.height || requiredHeight;
|
|
|
+ var needMipMaps = this.renderTargetSamplingMode !== _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_NEAREST_LINEAR &&
|
|
|
+ this.renderTargetSamplingMode !== _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_NEAREST_NEAREST &&
|
|
|
+ this.renderTargetSamplingMode !== _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_LINEAR_LINEAR;
|
|
|
if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {
|
|
|
if (this.adaptScaleToCurrentViewport) {
|
|
|
var currentViewport = engine.currentViewport;
|
|
@@ -159591,7 +159618,7 @@ var PostProcess = /** @class */ (function () {
|
|
|
desiredHeight *= currentViewport.height;
|
|
|
}
|
|
|
}
|
|
|
- if (this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE || this.alwaysForcePOT) {
|
|
|
+ if (needMipMaps || this.alwaysForcePOT) {
|
|
|
if (!this._options.width) {
|
|
|
desiredWidth = engine.needPOTTextures ? _Engines_engine__WEBPACK_IMPORTED_MODULE_5__["Engine"].GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth;
|
|
|
}
|
|
@@ -159608,11 +159635,6 @@ var PostProcess = /** @class */ (function () {
|
|
|
}
|
|
|
this.width = desiredWidth;
|
|
|
this.height = desiredHeight;
|
|
|
- var needMipMaps = this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_TRILINEAR_SAMPLINGMODE ||
|
|
|
- this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_NEAREST_NEAREST_MIPLINEAR ||
|
|
|
- this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_LINEAR_LINEAR_MIPLINEAR ||
|
|
|
- this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_NEAREST_LINEAR_MIPLINEAR ||
|
|
|
- this.renderTargetSamplingMode === _Engines_constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].TEXTURE_LINEAR_NEAREST_MIPLINEAR;
|
|
|
var textureSize = { width: this.width, height: this.height };
|
|
|
var textureOptions = {
|
|
|
generateMipMaps: needMipMaps,
|