|
@@ -12028,7 +12028,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "3.2.0-rc.1";
|
|
|
+ return "3.2.0-rc.2";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -73637,12 +73637,13 @@ var BABYLON;
|
|
|
_this.base = 0.1;
|
|
|
_this._firstUpdate = true;
|
|
|
_this._scene = scene;
|
|
|
+ _this._ratio = ratio;
|
|
|
if (!_this.isSupported) {
|
|
|
BABYLON.Tools.Error("SSAO 2 needs WebGL 2 support.");
|
|
|
return _this;
|
|
|
}
|
|
|
- var ssaoRatio = ratio.ssaoRatio || ratio;
|
|
|
- var blurRatio = ratio.blurRatio || ratio;
|
|
|
+ var ssaoRatio = _this._ratio.ssaoRatio || ratio;
|
|
|
+ var blurRatio = _this._ratio.blurRatio || ratio;
|
|
|
// Set up assets
|
|
|
var geometryBufferRenderer = scene.enableGeometryBufferRenderer();
|
|
|
_this._createRandomTexture();
|
|
@@ -73851,6 +73852,25 @@ var BABYLON;
|
|
|
}
|
|
|
this._randomTexture.update(false);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Serialize the rendering pipeline (Used when exporting)
|
|
|
+ * @returns the serialized object
|
|
|
+ */
|
|
|
+ SSAO2RenderingPipeline.prototype.serialize = function () {
|
|
|
+ var serializationObject = BABYLON.SerializationHelper.Serialize(this);
|
|
|
+ serializationObject.customType = "SSAO2RenderingPipeline";
|
|
|
+ return serializationObject;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Parse the serialized pipeline
|
|
|
+ * @param source Source pipeline.
|
|
|
+ * @param scene The scene to load the pipeline to.
|
|
|
+ * @param rootUrl The URL of the serialized pipeline.
|
|
|
+ * @returns An instantiated pipeline from the serialized object.
|
|
|
+ */
|
|
|
+ SSAO2RenderingPipeline.Parse = function (source, scene, rootUrl) {
|
|
|
+ return BABYLON.SerializationHelper.Parse(function () { return new SSAO2RenderingPipeline(source._name, scene, source._ratio); }, source, scene, rootUrl);
|
|
|
+ };
|
|
|
__decorate([
|
|
|
BABYLON.serialize()
|
|
|
], SSAO2RenderingPipeline.prototype, "totalStrength", void 0);
|
|
@@ -73864,6 +73884,9 @@ var BABYLON;
|
|
|
BABYLON.serialize("samples")
|
|
|
], SSAO2RenderingPipeline.prototype, "_samples", void 0);
|
|
|
__decorate([
|
|
|
+ BABYLON.serialize()
|
|
|
+ ], SSAO2RenderingPipeline.prototype, "_ratio", void 0);
|
|
|
+ __decorate([
|
|
|
BABYLON.serialize("expensiveBlur")
|
|
|
], SSAO2RenderingPipeline.prototype, "_expensiveBlur", void 0);
|
|
|
__decorate([
|
|
@@ -74333,13 +74356,6 @@ var BABYLON;
|
|
|
}
|
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRPassPostProcess", function () { return _this.originalPostProcess; }, true));
|
|
|
this._currentDepthOfFieldSource = this.originalPostProcess;
|
|
|
- if (this._vlsEnabled) {
|
|
|
- // Create volumetric light
|
|
|
- this._createVolumetricLightPostProcess(scene, ratio);
|
|
|
- // Create volumetric light final post-process
|
|
|
- this.volumetricLightFinalPostProcess = new BABYLON.PostProcess("HDRVLSFinal", "standard", [], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
- this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRVLSFinal", function () { return _this.volumetricLightFinalPostProcess; }, true));
|
|
|
- }
|
|
|
if (this._bloomEnabled) {
|
|
|
// Create down sample X4 post-process
|
|
|
this._createDownSampleX4PostProcess(scene, ratio / 2);
|
|
@@ -74353,6 +74369,13 @@ var BABYLON;
|
|
|
this.textureAdderFinalPostProcess = new BABYLON.PostProcess("HDRDepthOfFieldSource", "standard", [], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRBaseDepthOfFieldSource", function () { return _this.textureAdderFinalPostProcess; }, true));
|
|
|
}
|
|
|
+ if (this._vlsEnabled) {
|
|
|
+ // Create volumetric light
|
|
|
+ this._createVolumetricLightPostProcess(scene, ratio);
|
|
|
+ // Create volumetric light final post-process
|
|
|
+ this.volumetricLightFinalPostProcess = new BABYLON.PostProcess("HDRVLSFinal", "standard", [], [], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
+ this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRVLSFinal", function () { return _this.volumetricLightFinalPostProcess; }, true));
|
|
|
+ }
|
|
|
if (this._lensFlareEnabled) {
|
|
|
// Create lens flare post-process
|
|
|
this._createLensFlarePostProcess(scene, ratio);
|
|
@@ -74489,7 +74512,7 @@ var BABYLON;
|
|
|
// Merge
|
|
|
this.volumetricLightMergePostProces = new BABYLON.PostProcess("HDRVLSMerge", "standard", [], ["originalSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define VLSMERGE");
|
|
|
this.volumetricLightMergePostProces.onApply = function (effect) {
|
|
|
- effect.setTextureFromPostProcess("originalSampler", _this.originalPostProcess);
|
|
|
+ effect.setTextureFromPostProcess("originalSampler", _this._bloomEnabled ? _this.textureAdderFinalPostProcess : _this.originalPostProcess);
|
|
|
_this._currentDepthOfFieldSource = _this.volumetricLightFinalPostProcess;
|
|
|
};
|
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), "HDRVLSMerge", function () { return _this.volumetricLightMergePostProces; }, true));
|
|
@@ -74765,24 +74788,39 @@ var BABYLON;
|
|
|
this.blurHPostProcesses = [];
|
|
|
this.blurVPostProcesses = [];
|
|
|
};
|
|
|
- // Dispose
|
|
|
+ /**
|
|
|
+ * Dispose of the pipeline and stop all post processes
|
|
|
+ */
|
|
|
StandardRenderingPipeline.prototype.dispose = function () {
|
|
|
this._disposePostProcesses();
|
|
|
this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
|
|
|
_super.prototype.dispose.call(this);
|
|
|
};
|
|
|
- // Serialize rendering pipeline
|
|
|
+ /**
|
|
|
+ * Serialize the rendering pipeline (Used when exporting)
|
|
|
+ * @returns the serialized object
|
|
|
+ */
|
|
|
StandardRenderingPipeline.prototype.serialize = function () {
|
|
|
var serializationObject = BABYLON.SerializationHelper.Serialize(this);
|
|
|
+ if (this.sourceLight) {
|
|
|
+ serializationObject.sourceLightId = this.sourceLight.id;
|
|
|
+ }
|
|
|
serializationObject.customType = "StandardRenderingPipeline";
|
|
|
return serializationObject;
|
|
|
};
|
|
|
/**
|
|
|
- * Static members
|
|
|
+ * Parse the serialized pipeline
|
|
|
+ * @param source Source pipeline.
|
|
|
+ * @param scene The scene to load the pipeline to.
|
|
|
+ * @param rootUrl The URL of the serialized pipeline.
|
|
|
+ * @returns An instantiated pipeline from the serialized object.
|
|
|
*/
|
|
|
- // Parse serialized pipeline
|
|
|
StandardRenderingPipeline.Parse = function (source, scene, rootUrl) {
|
|
|
- return BABYLON.SerializationHelper.Parse(function () { return new StandardRenderingPipeline(source._name, scene, source._ratio); }, source, scene, rootUrl);
|
|
|
+ var p = BABYLON.SerializationHelper.Parse(function () { return new StandardRenderingPipeline(source._name, scene, source._ratio); }, source, scene, rootUrl);
|
|
|
+ if (source.sourceLightId) {
|
|
|
+ p.sourceLight = scene.getLightByID(source.sourceLightId);
|
|
|
+ }
|
|
|
+ return p;
|
|
|
};
|
|
|
// Luminance steps
|
|
|
StandardRenderingPipeline.LuminanceSteps = 6;
|