|
@@ -10760,7 +10760,7 @@ var BABYLON;
|
|
|
this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
|
|
|
// Detect if we are running on a faulty buggy desktop OS.
|
|
|
this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
|
- BABYLON.Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched");
|
|
|
+ console.log("Babylon.js engine (v" + Engine.Version + ") launched");
|
|
|
this.enableOfflineSupport = (BABYLON.Database !== undefined);
|
|
|
}
|
|
|
Object.defineProperty(Engine, "LastCreatedEngine", {
|
|
@@ -22978,6 +22978,13 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // Particles
|
|
|
+ for (var _d = 0, _e = this.particleSystems; _d < _e.length; _d++) {
|
|
|
+ var particleSystem = _e[_d];
|
|
|
+ if (!particleSystem.isReady()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
return true;
|
|
|
};
|
|
|
Scene.prototype.resetCachedMaterial = function () {
|
|
@@ -24070,7 +24077,7 @@ var BABYLON;
|
|
|
if (this.textures) {
|
|
|
for (var i = 0; i < this.textures.length; i++) {
|
|
|
var texture = this.textures[i];
|
|
|
- if (texture && texture.isRenderTarget) {
|
|
|
+ if (texture && texture.renderList) {
|
|
|
texture.freeRenderingGroups();
|
|
|
}
|
|
|
}
|
|
@@ -51764,13 +51771,24 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
|
+ * Is this system ready to be used/rendered
|
|
|
+ * @return true if the system is ready
|
|
|
+ */
|
|
|
+ ParticleSystem.prototype.isReady = function () {
|
|
|
+ var effect = this._getEffect();
|
|
|
+ if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Renders the particle system in its current state.
|
|
|
* @returns the current number of particles
|
|
|
*/
|
|
|
ParticleSystem.prototype.render = function () {
|
|
|
var effect = this._getEffect();
|
|
|
// Check
|
|
|
- if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length) {
|
|
|
+ if (!this.isReady() || !this._particles.length) {
|
|
|
return 0;
|
|
|
}
|
|
|
var engine = this._scene.getEngine();
|
|
@@ -51781,7 +51799,7 @@ var BABYLON;
|
|
|
effect.setTexture("diffuseSampler", this.particleTexture);
|
|
|
effect.setMatrix("view", viewMatrix);
|
|
|
effect.setMatrix("projection", this._scene.getProjectionMatrix());
|
|
|
- if (this._isAnimationSheetEnabled) {
|
|
|
+ if (this._isAnimationSheetEnabled && this.particleTexture) {
|
|
|
var baseSize = this.particleTexture.getBaseSize();
|
|
|
effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth);
|
|
|
}
|
|
@@ -52834,6 +52852,16 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
/**
|
|
|
+ * Is this system ready to be used/rendered
|
|
|
+ * @return true if the system is ready
|
|
|
+ */
|
|
|
+ GPUParticleSystem.prototype.isReady = function () {
|
|
|
+ if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady() || !this.particleTexture || !this.particleTexture.isReady()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Gets Wether the system has been started.
|
|
|
* @returns True if it has been started, otherwise false.
|
|
|
*/
|
|
@@ -52986,7 +53014,7 @@ var BABYLON;
|
|
|
}
|
|
|
this._recreateUpdateEffect();
|
|
|
this._recreateRenderEffect();
|
|
|
- if (!this.emitter || !this._updateEffect.isReady() || !this._renderEffect.isReady()) {
|
|
|
+ if (!this.isReady()) {
|
|
|
return 0;
|
|
|
}
|
|
|
if (this._currentRenderId === this._scene.getRenderId()) {
|
|
@@ -69124,9 +69152,9 @@ var BABYLON;
|
|
|
if (blockCompilation === void 0) { blockCompilation = false; }
|
|
|
var _this = _super.call(this, name, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation) || this;
|
|
|
/**
|
|
|
- * The amount of seperation of rgb channels (default: 0)
|
|
|
+ * The amount of seperation of rgb channels (default: 30)
|
|
|
*/
|
|
|
- _this.aberrationAmount = 0;
|
|
|
+ _this.aberrationAmount = 30;
|
|
|
/**
|
|
|
* The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
|
|
|
*/
|