|
@@ -24398,6 +24398,7 @@ var BABYLON;
|
|
|
*/
|
|
|
_this.animationTimeScale = 1;
|
|
|
_this._renderId = 0;
|
|
|
+ _this._frameId = 0;
|
|
|
_this._executeWhenReadyTimeoutId = -1;
|
|
|
_this._intermediateRendering = false;
|
|
|
_this._viewUpdateFlag = -1;
|
|
@@ -25252,12 +25253,19 @@ var BABYLON;
|
|
|
return this._animationRatio !== undefined ? this._animationRatio : 1;
|
|
|
};
|
|
|
/**
|
|
|
- * Gets an unique Id for the current frame
|
|
|
+ * Gets an unique Id for the current render phase
|
|
|
* @returns a number
|
|
|
*/
|
|
|
Scene.prototype.getRenderId = function () {
|
|
|
return this._renderId;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Gets an unique Id for the current frame
|
|
|
+ * @returns a number
|
|
|
+ */
|
|
|
+ Scene.prototype.getFrameId = function () {
|
|
|
+ return this._frameId;
|
|
|
+ };
|
|
|
/** Call this function if you want to manually increment the render Id*/
|
|
|
Scene.prototype.incrementRenderId = function () {
|
|
|
this._renderId++;
|
|
@@ -27412,7 +27420,7 @@ var BABYLON;
|
|
|
var material = subMesh.getMaterial();
|
|
|
if (material !== null && material !== undefined) {
|
|
|
// Render targets
|
|
|
- if (material.getRenderTargetTextures !== undefined) {
|
|
|
+ if (material.hasRenderTargetTextures && material.getRenderTargetTextures !== undefined) {
|
|
|
if (this._processedMaterials.indexOf(material) === -1) {
|
|
|
this._processedMaterials.push(material);
|
|
|
this._renderTargets.concatWithNoDuplicate(material.getRenderTargetTextures());
|
|
@@ -27563,7 +27571,7 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
Scene.prototype._activeMesh = function (sourceMesh, mesh) {
|
|
|
- if (this.skeletonsEnabled && mesh.skeleton !== null && mesh.skeleton !== undefined) {
|
|
|
+ if (this._skeletonsEnabled && mesh.skeleton !== null && mesh.skeleton !== undefined) {
|
|
|
if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
|
|
|
mesh.skeleton.prepare();
|
|
|
}
|
|
@@ -27747,6 +27755,7 @@ var BABYLON;
|
|
|
if (this.isDisposed) {
|
|
|
return;
|
|
|
}
|
|
|
+ this._frameId++;
|
|
|
// Register components that have been associated lately to the scene.
|
|
|
this._registerTransientComponents();
|
|
|
this._activeParticles.fetchNewFrame();
|
|
@@ -31668,7 +31677,8 @@ var BABYLON;
|
|
|
}
|
|
|
var data = this._getPositionData(applySkeleton);
|
|
|
if (data) {
|
|
|
- var extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this.getTotalVertices());
|
|
|
+ var bias = this.geometry ? this.geometry.boundingBias : null;
|
|
|
+ var extend = BABYLON.Tools.ExtractMinAndMax(data, 0, this.getTotalVertices(), bias);
|
|
|
this._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum);
|
|
|
}
|
|
|
if (this.subMeshes) {
|
|
@@ -33821,10 +33831,10 @@ var BABYLON;
|
|
|
if (!this.geometry) {
|
|
|
return this;
|
|
|
}
|
|
|
- if (this.geometry._softwareSkinningRenderId == this.getScene().getRenderId()) {
|
|
|
+ if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId()) {
|
|
|
return this;
|
|
|
}
|
|
|
- this.geometry._softwareSkinningRenderId = this.getScene().getRenderId();
|
|
|
+ this.geometry._softwareSkinningFrameId = this.getScene().getFrameId();
|
|
|
if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) {
|
|
|
return this;
|
|
|
}
|
|
@@ -34619,6 +34629,10 @@ var BABYLON;
|
|
|
*/
|
|
|
this._backFaceCulling = true;
|
|
|
/**
|
|
|
+ * Gets a boolean indicating that current material needs to register RTT
|
|
|
+ */
|
|
|
+ this.hasRenderTargetTextures = false;
|
|
|
+ /**
|
|
|
* Specifies if the material should be serialized
|
|
|
*/
|
|
|
this.doNotSerialize = false;
|
|
@@ -41845,6 +41859,22 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(StandardMaterial.prototype, "hasRenderTargetTextures", {
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating that current material needs to register RTT
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
StandardMaterial.prototype.getClassName = function () {
|
|
|
return "StandardMaterial";
|
|
|
};
|
|
@@ -43846,6 +43876,22 @@ var BABYLON;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+ Object.defineProperty(PBRBaseMaterial.prototype, "hasRenderTargetTextures", {
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating that current material needs to register RTT
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (BABYLON.StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (BABYLON.StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Gets the name of the material class.
|
|
|
*/
|
|
@@ -107423,6 +107469,22 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(BackgroundMaterial.prototype, "hasRenderTargetTextures", {
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating that current material needs to register RTT
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* The entire material has been created in order to prevent overdraw.
|
|
|
* @returns false
|