|
@@ -898,11 +898,6 @@
|
|
* Gets or sets a boolean indicating if procedural textures are enabled on this scene
|
|
* Gets or sets a boolean indicating if procedural textures are enabled on this scene
|
|
*/
|
|
*/
|
|
public proceduralTexturesEnabled = true;
|
|
public proceduralTexturesEnabled = true;
|
|
- /**
|
|
|
|
- * The list of procedural textures added to the scene
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures
|
|
|
|
- */
|
|
|
|
- public proceduralTextures = new Array<ProceduralTexture>();
|
|
|
|
|
|
|
|
// Sound Tracks
|
|
// Sound Tracks
|
|
private _mainSoundTrack: SoundTrack;
|
|
private _mainSoundTrack: SoundTrack;
|
|
@@ -1103,7 +1098,6 @@
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @hidden
|
|
* @hidden
|
|
* Defines the actions happening before camera updates.
|
|
* Defines the actions happening before camera updates.
|
|
@@ -1111,6 +1105,11 @@
|
|
public _beforeCameraUpdateStage = Stage.Create<SimpleStageAction>();
|
|
public _beforeCameraUpdateStage = Stage.Create<SimpleStageAction>();
|
|
/**
|
|
/**
|
|
* @hidden
|
|
* @hidden
|
|
|
|
+ * Defines the actions happening before clear the canvas.
|
|
|
|
+ */
|
|
|
|
+ public _beforeClearStage = Stage.Create<SimpleStageAction>();
|
|
|
|
+ /**
|
|
|
|
+ * @hidden
|
|
* Defines the actions happening before camera updates.
|
|
* Defines the actions happening before camera updates.
|
|
*/
|
|
*/
|
|
public _gatherRenderTargetsStage = Stage.Create<RenderTargetsStageAction>();
|
|
public _gatherRenderTargetsStage = Stage.Create<RenderTargetsStageAction>();
|
|
@@ -4548,16 +4547,8 @@
|
|
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
this.activeCamera = currentActiveCamera;
|
|
this.activeCamera = currentActiveCamera;
|
|
|
|
|
|
- // Procedural textures
|
|
|
|
- if (this.proceduralTexturesEnabled) {
|
|
|
|
- Tools.StartPerformanceCounter("Procedural textures", this.proceduralTextures.length > 0);
|
|
|
|
- for (var proceduralIndex = 0; proceduralIndex < this.proceduralTextures.length; proceduralIndex++) {
|
|
|
|
- var proceduralTexture = this.proceduralTextures[proceduralIndex];
|
|
|
|
- if (proceduralTexture._shouldRender()) {
|
|
|
|
- proceduralTexture.render();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- Tools.EndPerformanceCounter("Procedural textures", this.proceduralTextures.length > 0);
|
|
|
|
|
|
+ for (let step of this._beforeClearStage) {
|
|
|
|
+ step.action();
|
|
}
|
|
}
|
|
|
|
|
|
// Clear
|
|
// Clear
|
|
@@ -4565,21 +4556,6 @@
|
|
this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
|
|
this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
|
|
}
|
|
}
|
|
|
|
|
|
- // Shadows
|
|
|
|
- if (this.shadowsEnabled) {
|
|
|
|
- for (var lightIndex = 0; lightIndex < this.lights.length; lightIndex++) {
|
|
|
|
- var light = this.lights[lightIndex];
|
|
|
|
- var shadowGenerator = light.getShadowGenerator();
|
|
|
|
-
|
|
|
|
- if (light.isEnabled() && light.shadowEnabled && shadowGenerator) {
|
|
|
|
- var shadowMap = <RenderTargetTexture>(shadowGenerator.getShadowMap());
|
|
|
|
- if (this.textures.indexOf(shadowMap) !== -1) {
|
|
|
|
- this._renderTargets.push(shadowMap);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// Collects render targets from external components.
|
|
// Collects render targets from external components.
|
|
for (let step of this._gatherRenderTargetsStage) {
|
|
for (let step of this._gatherRenderTargetsStage) {
|
|
step.action(this._renderTargets);
|
|
step.action(this._renderTargets);
|
|
@@ -4809,6 +4785,7 @@
|
|
this._afterRenderingGroupDrawStage.clear();
|
|
this._afterRenderingGroupDrawStage.clear();
|
|
this._afterCameraDrawStage.clear();
|
|
this._afterCameraDrawStage.clear();
|
|
this._beforeCameraUpdateStage.clear();
|
|
this._beforeCameraUpdateStage.clear();
|
|
|
|
+ this._beforeClearStage.clear();
|
|
this._gatherRenderTargetsStage.clear();
|
|
this._gatherRenderTargetsStage.clear();
|
|
this._rebuildGeometryStage.clear();
|
|
this._rebuildGeometryStage.clear();
|
|
this._pointerMoveStage.clear();
|
|
this._pointerMoveStage.clear();
|