|
@@ -11940,7 +11940,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "3.3.0-beta.5";
|
|
|
+ return "3.3.0-beta.6";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -24731,8 +24731,7 @@ var BABYLON;
|
|
|
return 1000.0 / 60.0; // frame time in ms
|
|
|
};
|
|
|
_this._tempPickingRay = BABYLON.Ray ? BABYLON.Ray.Zero() : null;
|
|
|
- /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
|
|
|
- _this.blockMaterialDirtyMechanism = false;
|
|
|
+ _this._blockMaterialDirtyMechanism = false;
|
|
|
_this._engine = engine || BABYLON.Engine.LastCreatedEngine;
|
|
|
_this._engine.scenes.push(_this);
|
|
|
_this._uid = null;
|
|
@@ -28664,13 +28663,30 @@ var BABYLON;
|
|
|
Scene.prototype.getAutoClearDepthStencilSetup = function (index) {
|
|
|
return this._renderingManager.getAutoClearDepthStencilSetup(index);
|
|
|
};
|
|
|
+ Object.defineProperty(Scene.prototype, "blockMaterialDirtyMechanism", {
|
|
|
+ /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
|
|
|
+ get: function () {
|
|
|
+ return this._blockMaterialDirtyMechanism;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this._blockMaterialDirtyMechanism === value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._blockMaterialDirtyMechanism = value;
|
|
|
+ if (!value) { // Do a complete update
|
|
|
+ this.markAllMaterialsAsDirty(BABYLON.Material.AllDirtyFlag);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Will flag all materials as dirty to trigger new shader compilation
|
|
|
* @param flag defines the flag used to specify which material part must be marked as dirty
|
|
|
* @param predicate If not null, it will be used to specifiy if a material has to be marked as dirty
|
|
|
*/
|
|
|
Scene.prototype.markAllMaterialsAsDirty = function (flag, predicate) {
|
|
|
- if (this.blockMaterialDirtyMechanism) {
|
|
|
+ if (this._blockMaterialDirtyMechanism) {
|
|
|
return;
|
|
|
}
|
|
|
for (var _i = 0, _a = this.materials; _i < _a.length; _i++) {
|
|
@@ -34834,56 +34850,6 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- Object.defineProperty(Material, "TextureDirtyFlag", {
|
|
|
- /**
|
|
|
- * Returns the dirty texture flag value
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Material._TextureDirtyFlag;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Material, "LightDirtyFlag", {
|
|
|
- /**
|
|
|
- * Returns the dirty light flag value
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Material._LightDirtyFlag;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Material, "FresnelDirtyFlag", {
|
|
|
- /**
|
|
|
- * Returns the dirty fresnel flag value
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Material._FresnelDirtyFlag;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Material, "AttributesDirtyFlag", {
|
|
|
- /**
|
|
|
- * Returns the dirty attributes flag value
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Material._AttributesDirtyFlag;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Material, "MiscDirtyFlag", {
|
|
|
- /**
|
|
|
- * Returns the dirty misc flag value
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Material._MiscDirtyFlag;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
Object.defineProperty(Material.prototype, "alpha", {
|
|
|
/**
|
|
|
* Gets the alpha value of the material
|
|
@@ -35652,23 +35618,27 @@ var BABYLON;
|
|
|
/**
|
|
|
* The dirty texture flag value
|
|
|
*/
|
|
|
- Material._TextureDirtyFlag = 1;
|
|
|
+ Material.TextureDirtyFlag = 1;
|
|
|
/**
|
|
|
* The dirty light flag value
|
|
|
*/
|
|
|
- Material._LightDirtyFlag = 2;
|
|
|
+ Material.LightDirtyFlag = 2;
|
|
|
/**
|
|
|
* The dirty fresnel flag value
|
|
|
*/
|
|
|
- Material._FresnelDirtyFlag = 4;
|
|
|
+ Material.FresnelDirtyFlag = 4;
|
|
|
/**
|
|
|
* The dirty attribute flag value
|
|
|
*/
|
|
|
- Material._AttributesDirtyFlag = 8;
|
|
|
+ Material.AttributesDirtyFlag = 8;
|
|
|
/**
|
|
|
* The dirty misc flag value
|
|
|
*/
|
|
|
- Material._MiscDirtyFlag = 16;
|
|
|
+ Material.MiscDirtyFlag = 16;
|
|
|
+ /**
|
|
|
+ * The all dirty flag value
|
|
|
+ */
|
|
|
+ Material.AllDirtyFlag = 31;
|
|
|
__decorate([
|
|
|
BABYLON.serialize()
|
|
|
], Material.prototype, "id", void 0);
|
|
@@ -41403,11 +41373,20 @@ var BABYLON;
|
|
|
* @param scene The scene the lights belongs to
|
|
|
* @param mesh The mesh we are binding the information to render
|
|
|
* @param effect The effect we are binding the data to
|
|
|
+ * @param linearSpace Defines if the fog effect is applied in linear space
|
|
|
*/
|
|
|
- MaterialHelper.BindFogParameters = function (scene, mesh, effect) {
|
|
|
+ MaterialHelper.BindFogParameters = function (scene, mesh, effect, linearSpace) {
|
|
|
+ if (linearSpace === void 0) { linearSpace = false; }
|
|
|
if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE) {
|
|
|
effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
|
|
|
- effect.setColor3("vFogColor", scene.fogColor);
|
|
|
+ // Convert fog color to linear space if used in a linear space computed shader.
|
|
|
+ if (linearSpace) {
|
|
|
+ scene.fogColor.toLinearSpaceToRef(this._tempFogColor);
|
|
|
+ effect.setColor3("vFogColor", this._tempFogColor);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ effect.setColor3("vFogColor", scene.fogColor);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
@@ -41475,6 +41454,7 @@ var BABYLON;
|
|
|
effect.setFloat4("vClipPlane4", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
|
|
|
}
|
|
|
};
|
|
|
+ MaterialHelper._tempFogColor = BABYLON.Color3.Black();
|
|
|
return MaterialHelper;
|
|
|
}());
|
|
|
BABYLON.MaterialHelper = MaterialHelper;
|
|
@@ -44833,7 +44813,7 @@ var BABYLON;
|
|
|
this.bindView(effect);
|
|
|
}
|
|
|
// Fog
|
|
|
- BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
|
|
|
+ BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
|
|
|
// Morph targets
|
|
|
if (defines.NUM_MORPH_INFLUENCERS) {
|
|
|
BABYLON.MaterialHelper.BindMorphTargetParameters(mesh, this._activeEffect);
|
|
@@ -73685,7 +73665,7 @@ var BABYLON;
|
|
|
request = BABYLON.Tools.LoadFile(fileInfo.url, dataCallback, onProgress ? function (event) {
|
|
|
onProgress(SceneLoaderProgressEvent.FromProgressEvent(event));
|
|
|
} : undefined, database, useArrayBuffer, function (request, exception) {
|
|
|
- onError("Failed to load scene." + (exception ? "" : " " + exception.message), exception);
|
|
|
+ onError("Failed to load scene." + (exception ? " " + exception.message : ""), exception);
|
|
|
});
|
|
|
};
|
|
|
if (directLoad) {
|
|
@@ -110984,7 +110964,7 @@ var BABYLON;
|
|
|
// View
|
|
|
this.bindView(effect);
|
|
|
// Fog
|
|
|
- BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
|
|
|
+ BABYLON.MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect, true);
|
|
|
// image processing
|
|
|
if (this._imageProcessingConfiguration) {
|
|
|
this._imageProcessingConfiguration.bind(this._activeEffect);
|