|
@@ -11515,6 +11515,12 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
this._unpackFlipYCached = null;
|
|
|
+ /**
|
|
|
+ * In case you are sharing the context with other applications, it might
|
|
|
+ * be interested to not cache the unpack flip y state to ensure a consistent
|
|
|
+ * value would be set.
|
|
|
+ */
|
|
|
+ this.enableUnpackFlipYCached = true;
|
|
|
this._boundUniforms = {};
|
|
|
// Register promises
|
|
|
BABYLON.PromisePolyfill.Apply();
|
|
@@ -14283,7 +14289,6 @@ var BABYLON;
|
|
|
return;
|
|
|
}
|
|
|
this._currentEffect = null;
|
|
|
- this._unpackFlipYCached = null;
|
|
|
this._viewportCached.x = 0;
|
|
|
this._viewportCached.y = 0;
|
|
|
this._viewportCached.z = 0;
|
|
@@ -14295,6 +14300,7 @@ var BABYLON;
|
|
|
this._depthCullingState.reset();
|
|
|
this.setDepthFunctionToLessOrEqual();
|
|
|
this._alphaState.reset();
|
|
|
+ this._unpackFlipYCached = null;
|
|
|
}
|
|
|
this._resetVertexBufferBinding();
|
|
|
this._cachedIndexBuffer = null;
|
|
@@ -14773,8 +14779,10 @@ var BABYLON;
|
|
|
/** @hidden */
|
|
|
Engine.prototype._unpackFlipY = function (value) {
|
|
|
if (this._unpackFlipYCached !== value) {
|
|
|
- this._unpackFlipYCached = value;
|
|
|
this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, value ? 1 : 0);
|
|
|
+ if (this.enableUnpackFlipYCached) {
|
|
|
+ this._unpackFlipYCached = value;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
/** @hidden */
|
|
@@ -23689,6 +23697,7 @@ var BABYLON;
|
|
|
SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager";
|
|
|
SceneComponentConstants.NAME_SPRITE = "Sprite";
|
|
|
SceneComponentConstants.NAME_OUTLINERENDERER = "Outline";
|
|
|
+ SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture";
|
|
|
SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0;
|
|
|
SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0;
|
|
|
SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0;
|
|
@@ -23701,6 +23710,7 @@ var BABYLON;
|
|
|
SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;
|
|
|
SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0;
|
|
|
SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1;
|
|
|
+ SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0;
|
|
|
SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 0;
|
|
|
SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 1;
|
|
|
SceneComponentConstants.STEP_AFTERCAMERADRAW_BOUNDINGBOXRENDERER = 2;
|
|
@@ -24327,11 +24337,6 @@ var BABYLON;
|
|
|
*/
|
|
|
_this.proceduralTexturesEnabled = true;
|
|
|
/**
|
|
|
- * The list of procedural textures added to the scene
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures
|
|
|
- */
|
|
|
- _this.proceduralTextures = new Array();
|
|
|
- /**
|
|
|
* The list of sound tracks added to the scene
|
|
|
* @see http://doc.babylonjs.com/how_to/playing_sounds_and_music
|
|
|
*/
|
|
@@ -24407,6 +24412,11 @@ var BABYLON;
|
|
|
_this._beforeCameraUpdateStage = BABYLON.Stage.Create();
|
|
|
/**
|
|
|
* @hidden
|
|
|
+ * Defines the actions happening before clear the canvas.
|
|
|
+ */
|
|
|
+ _this._beforeClearStage = BABYLON.Stage.Create();
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
* Defines the actions happening before camera updates.
|
|
|
*/
|
|
|
_this._gatherRenderTargetsStage = BABYLON.Stage.Create();
|
|
@@ -27847,16 +27857,9 @@ var BABYLON;
|
|
|
}
|
|
|
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
|
this.activeCamera = currentActiveCamera;
|
|
|
- // Procedural textures
|
|
|
- if (this.proceduralTexturesEnabled) {
|
|
|
- BABYLON.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();
|
|
|
- }
|
|
|
- }
|
|
|
- BABYLON.Tools.EndPerformanceCounter("Procedural textures", this.proceduralTextures.length > 0);
|
|
|
+ for (var _b = 0, _c = this._beforeClearStage; _b < _c.length; _b++) {
|
|
|
+ var step = _c[_b];
|
|
|
+ step.action();
|
|
|
}
|
|
|
// Clear
|
|
|
if (this.autoClearDepthAndStencil || this.autoClear) {
|
|
@@ -27876,8 +27879,8 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
// Collects render targets from external components.
|
|
|
- for (var _b = 0, _c = this._gatherRenderTargetsStage; _b < _c.length; _b++) {
|
|
|
- var step = _c[_b];
|
|
|
+ for (var _d = 0, _e = this._gatherRenderTargetsStage; _d < _e.length; _d++) {
|
|
|
+ var step = _e[_d];
|
|
|
step.action(this._renderTargets);
|
|
|
}
|
|
|
// Multi-cameras?
|
|
@@ -28086,6 +28089,7 @@ var BABYLON;
|
|
|
this._afterRenderingGroupDrawStage.clear();
|
|
|
this._afterCameraDrawStage.clear();
|
|
|
this._beforeCameraUpdateStage.clear();
|
|
|
+ this._beforeClearStage.clear();
|
|
|
this._gatherRenderTargetsStage.clear();
|
|
|
this._rebuildGeometryStage.clear();
|
|
|
this._pointerMoveStage.clear();
|
|
@@ -57949,7 +57953,7 @@ var BABYLON;
|
|
|
}
|
|
|
serializationObject.limitVelocityDamping = particleSystem.limitVelocityDamping;
|
|
|
}
|
|
|
- if (particleSystem.noiseTexture && particleSystem.noiseTexture instanceof BABYLON.ProceduralTexture) {
|
|
|
+ if (BABYLON.ProceduralTexture && particleSystem.noiseTexture && particleSystem.noiseTexture instanceof BABYLON.ProceduralTexture) {
|
|
|
var noiseTexture = particleSystem.noiseTexture;
|
|
|
serializationObject.noiseTexture = noiseTexture.serialize();
|
|
|
}
|
|
@@ -73923,6 +73927,11 @@ var BABYLON;
|
|
|
_this._fallbackTextureUsed = false;
|
|
|
_this._cachedDefines = "";
|
|
|
scene = _this.getScene();
|
|
|
+ var component = scene._getComponent(BABYLON.SceneComponentConstants.NAME_PROCEDURALTEXTURE);
|
|
|
+ if (!component) {
|
|
|
+ component = new BABYLON.ProceduralTextureSceneComponent(scene);
|
|
|
+ scene._addComponent(component);
|
|
|
+ }
|
|
|
scene.proceduralTextures.push(_this);
|
|
|
_this._engine = scene.getEngine();
|
|
|
_this.name = name;
|
|
@@ -74250,6 +74259,64 @@ var BABYLON;
|
|
|
|
|
|
//# sourceMappingURL=babylon.proceduralTexture.js.map
|
|
|
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Defines the Procedural Texture scene component responsible to manage any Procedural Texture
|
|
|
+ * in a given scene.
|
|
|
+ */
|
|
|
+ var ProceduralTextureSceneComponent = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates a new instance of the component for the given scene
|
|
|
+ * @param scene Defines the scene to register the component in
|
|
|
+ */
|
|
|
+ function ProceduralTextureSceneComponent(scene) {
|
|
|
+ /**
|
|
|
+ * The component name helpfull to identify the component in the list of scene components.
|
|
|
+ */
|
|
|
+ this.name = BABYLON.SceneComponentConstants.NAME_PROCEDURALTEXTURE;
|
|
|
+ this.scene = scene;
|
|
|
+ this.scene.proceduralTextures = new Array();
|
|
|
+ scene.layers = new Array();
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Registers the component in a given scene
|
|
|
+ */
|
|
|
+ ProceduralTextureSceneComponent.prototype.register = function () {
|
|
|
+ this.scene._beforeClearStage.registerStep(BABYLON.SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Rebuilds the elements related to this component in case of
|
|
|
+ * context lost for instance.
|
|
|
+ */
|
|
|
+ ProceduralTextureSceneComponent.prototype.rebuild = function () {
|
|
|
+ // Nothing to do here.
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Disposes the component and the associated ressources.
|
|
|
+ */
|
|
|
+ ProceduralTextureSceneComponent.prototype.dispose = function () {
|
|
|
+ // Nothing to do here.
|
|
|
+ };
|
|
|
+ ProceduralTextureSceneComponent.prototype._beforeClear = function () {
|
|
|
+ if (this.scene.proceduralTexturesEnabled) {
|
|
|
+ BABYLON.Tools.StartPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
|
|
|
+ for (var proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) {
|
|
|
+ var proceduralTexture = this.scene.proceduralTextures[proceduralIndex];
|
|
|
+ if (proceduralTexture._shouldRender()) {
|
|
|
+ proceduralTexture.render();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BABYLON.Tools.EndPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return ProceduralTextureSceneComponent;
|
|
|
+ }());
|
|
|
+ BABYLON.ProceduralTextureSceneComponent = ProceduralTextureSceneComponent;
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=babylon.proceduralTextureSceneComponent.js.map
|
|
|
+
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|