Skip to content

Commit 9c11dda

Browse files
committed
Version 4.4.2.
1 parent 4cfc0ef commit 9c11dda

File tree

5 files changed

+103
-45
lines changed

5 files changed

+103
-45
lines changed

build/postprocessing.js

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* postprocessing v4.4.1 build Apr 06 2018
2+
* postprocessing v4.4.2 build Apr 19 2018
33
* https://github.com/vanruesc/postprocessing
44
* Copyright 2018 Raoul van Rüschen, Zlib
55
*/
@@ -10,10 +10,6 @@
1010
(factory((global.POSTPROCESSING = {}),global.THREE));
1111
}(this, (function (exports,three) { 'use strict';
1212

13-
var fragment = "uniform sampler2D tPreviousLum;\r\nuniform sampler2D tCurrentLum;\r\nuniform float minLuminance;\r\nuniform float delta;\r\nuniform float tau;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tfloat previousLum = texture2D(tPreviousLum, vUv, MIP_LEVEL_1X1).r;\r\n\tfloat currentLum = texture2D(tCurrentLum, vUv, MIP_LEVEL_1X1).r;\r\n\r\n\tpreviousLum = max(minLuminance, previousLum);\r\n\tcurrentLum = max(minLuminance, currentLum);\r\n\r\n\t// Adapt the luminance using Pattanaik's technique.\r\n\tfloat adaptedLum = previousLum + (currentLum - previousLum) * (1.0 - exp(-delta * tau));\r\n\r\n\tgl_FragColor.r = adaptedLum;\r\n\r\n}\r\n";
14-
15-
var vertex = "varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n";
16-
1713
var classCallCheck = function (instance, Constructor) {
1814
if (!(instance instanceof Constructor)) {
1915
throw new TypeError("Cannot call a class as a function");
@@ -80,6 +76,22 @@
8076
return call && (typeof call === "object" || typeof call === "function") ? call : self;
8177
};
8278

79+
var Disposable = function () {
80+
function Disposable() {
81+
classCallCheck(this, Disposable);
82+
}
83+
84+
createClass(Disposable, [{
85+
key: "dispose",
86+
value: function dispose() {}
87+
}]);
88+
return Disposable;
89+
}();
90+
91+
var fragment = "uniform sampler2D tPreviousLum;\r\nuniform sampler2D tCurrentLum;\r\nuniform float minLuminance;\r\nuniform float delta;\r\nuniform float tau;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tfloat previousLum = texture2D(tPreviousLum, vUv, MIP_LEVEL_1X1).r;\r\n\tfloat currentLum = texture2D(tCurrentLum, vUv, MIP_LEVEL_1X1).r;\r\n\r\n\tpreviousLum = max(minLuminance, previousLum);\r\n\tcurrentLum = max(minLuminance, currentLum);\r\n\r\n\t// Adapt the luminance using Pattanaik's technique.\r\n\tfloat adaptedLum = previousLum + (currentLum - previousLum) * (1.0 - exp(-delta * tau));\r\n\r\n\tgl_FragColor.r = adaptedLum;\r\n\r\n}\r\n";
92+
93+
var vertex = "varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n";
94+
8395
var AdaptiveLuminosityMaterial = function (_ShaderMaterial) {
8496
inherits(AdaptiveLuminosityMaterial, _ShaderMaterial);
8597

@@ -3662,41 +3674,45 @@
36623674
}
36633675
}, {
36643676
key: "reset",
3665-
value: function reset(renderTarget) {
3677+
value: function reset() {
36663678

3667-
var depthBuffer = this.readBuffer.depthBuffer;
3668-
var stencilBuffer = this.readBuffer.stencilBuffer;
3669-
var depthTexture = this.readBuffer.depthTexture !== null;
3679+
var renderTarget = this.createBuffer(this.readBuffer.depthBuffer, this.readBuffer.stencilBuffer, this.readBuffer.depthTexture !== null);
36703680

3671-
this.dispose(renderTarget === undefined ? this.createBuffer(depthBuffer, stencilBuffer, depthTexture) : renderTarget);
3681+
this.dispose();
3682+
3683+
this.readBuffer = renderTarget;
3684+
this.writeBuffer = this.readBuffer.clone();
3685+
this.copyPass = new ShaderPass(new CopyMaterial());
36723686
}
36733687
}, {
36743688
key: "dispose",
3675-
value: function dispose(renderTarget) {
3689+
value: function dispose() {
36763690

36773691
var passes = this.passes;
36783692

3679-
if (this.readBuffer !== null && this.writeBuffer !== null) {
3693+
var i = void 0,
3694+
l = void 0;
36803695

3681-
this.readBuffer.dispose();
3682-
this.writeBuffer.dispose();
3696+
for (i = 0, l = passes.length; i < l; ++i) {
36833697

3684-
this.readBuffer = null;
3685-
this.writeBuffer = null;
3698+
passes[i].dispose();
36863699
}
36873700

3688-
while (passes.length > 0) {
3701+
this.passes = [];
3702+
3703+
if (this.readBuffer !== null) {
36893704

3690-
passes.pop().dispose();
3705+
this.readBuffer.dispose();
3706+
this.readBuffer = null;
36913707
}
36923708

3693-
if (renderTarget !== undefined) {
3694-
this.readBuffer = renderTarget;
3695-
this.writeBuffer = this.readBuffer.clone();
3696-
} else {
3709+
if (this.writeBuffer !== null) {
36973710

3698-
this.copyPass.dispose();
3711+
this.writeBuffer.dispose();
3712+
this.writeBuffer = null;
36993713
}
3714+
3715+
this.copyPass.dispose();
37003716
}
37013717
}, {
37023718
key: "depthTexture",
@@ -3713,6 +3729,18 @@
37133729
return EffectComposer;
37143730
}();
37153731

3732+
var Resizable = function () {
3733+
function Resizable() {
3734+
classCallCheck(this, Resizable);
3735+
}
3736+
3737+
createClass(Resizable, [{
3738+
key: "setSize",
3739+
value: function setSize(width, height) {}
3740+
}]);
3741+
return Resizable;
3742+
}();
3743+
37163744
function createCanvas(width, height, data, channels) {
37173745

37183746
var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
@@ -4578,7 +4606,9 @@
45784606
return SMAASearchImageData;
45794607
}();
45804608

4609+
exports.Disposable = Disposable;
45814610
exports.EffectComposer = EffectComposer;
4611+
exports.Resizable = Resizable;
45824612
exports.BloomPass = BloomPass;
45834613
exports.BlurPass = BlurPass;
45844614
exports.BokehPass = BokehPass;

build/postprocessing.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postprocessing",
3-
"version": "4.4.1",
3+
"version": "4.4.2",
44
"description": "A post processing library that provides the means to implement image filter effects for three.js.",
55
"homepage": "https://github.com/vanruesc/postprocessing",
66
"main": "build/postprocessing.js",

public/demo/index.js

Lines changed: 46 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/demo/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)