viral-viewer-2 3.4.9 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/animation/viral-animation.js +11 -9
- package/dist/components/animation/viral-animation.js.map +1 -1
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.d.ts +1 -0
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.js +15 -4
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.js.map +1 -1
- package/dist/components/post-processing/viral-post-processing.d.ts +11 -0
- package/dist/components/post-processing/viral-post-processing.js +28 -0
- package/dist/components/post-processing/viral-post-processing.js.map +1 -0
- package/dist/threejs-addon/post-processing/effect-composer.d.ts +27 -0
- package/dist/threejs-addon/post-processing/effect-composer.js +134 -0
- package/dist/threejs-addon/post-processing/effect-composer.js.map +1 -0
- package/dist/threejs-addon/post-processing/mask-pass.d.ts +11 -0
- package/dist/threejs-addon/post-processing/mask-pass.js +69 -0
- package/dist/threejs-addon/post-processing/mask-pass.js.map +1 -0
- package/dist/threejs-addon/post-processing/output-pass.d.ts +11 -0
- package/dist/threejs-addon/post-processing/output-pass.js +61 -0
- package/dist/threejs-addon/post-processing/output-pass.js.map +1 -0
- package/dist/threejs-addon/post-processing/pass.d.ts +20 -0
- package/dist/threejs-addon/post-processing/pass.js +48 -0
- package/dist/threejs-addon/post-processing/pass.js.map +1 -0
- package/dist/threejs-addon/post-processing/render-pass.d.ts +13 -0
- package/dist/threejs-addon/post-processing/render-pass.js +50 -0
- package/dist/threejs-addon/post-processing/render-pass.js.map +1 -0
- package/dist/threejs-addon/post-processing/shader-pass.d.ts +11 -0
- package/dist/threejs-addon/post-processing/shader-pass.js +48 -0
- package/dist/threejs-addon/post-processing/shader-pass.js.map +1 -0
- package/dist/threejs-addon/post-processing/unreal-bloom-pass.d.ts +48 -0
- package/dist/threejs-addon/post-processing/unreal-bloom-pass.js +290 -0
- package/dist/threejs-addon/post-processing/unreal-bloom-pass.js.map +1 -0
- package/dist/threejs-addon/shaders/copy-shader.d.ts +13 -0
- package/dist/threejs-addon/shaders/copy-shader.js +39 -0
- package/dist/threejs-addon/shaders/copy-shader.js.map +1 -0
- package/dist/threejs-addon/shaders/luminosity-high-pass-shader.d.ts +27 -0
- package/dist/threejs-addon/shaders/luminosity-high-pass-shader.js +56 -0
- package/dist/threejs-addon/shaders/luminosity-high-pass-shader.js.map +1 -0
- package/dist/threejs-addon/shaders/output-shader.d.ts +13 -0
- package/dist/threejs-addon/shaders/output-shader.js +72 -0
- package/dist/threejs-addon/shaders/output-shader.js.map +1 -0
- package/dist/viral-viewer-api.d.ts +2 -0
- package/dist/viral-viewer-api.js +2 -0
- package/dist/viral-viewer-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ class ViralAnimation {
|
|
|
8
8
|
this.clock = new three_1.Clock();
|
|
9
9
|
}
|
|
10
10
|
devAnimation() {
|
|
11
|
-
var _a, _b, _c, _d, _e;
|
|
11
|
+
var _a, _b, _c, _d, _e, _f;
|
|
12
12
|
const delta = this.clock.getDelta();
|
|
13
13
|
const elapsed = this.clock.getElapsedTime();
|
|
14
14
|
const updated1 = (_a = this.viralViewerApi.viralCamera.cameraControls) === null || _a === void 0 ? void 0 : _a.update(delta);
|
|
@@ -17,22 +17,23 @@ class ViralAnimation {
|
|
|
17
17
|
}
|
|
18
18
|
requestAnimationFrame(() => { this.devAnimation(); });
|
|
19
19
|
if (updated1) {
|
|
20
|
-
this.viralViewerApi.viralRenderer.render();
|
|
20
|
+
// this.viralViewerApi.viralRenderer.render();
|
|
21
|
+
(_b = this.viralViewerApi.viralPostProcessing.composer) === null || _b === void 0 ? void 0 : _b.render();
|
|
21
22
|
if (this.viralViewerApi.viralNavigationCube.cubeCamera) {
|
|
22
23
|
this.viralViewerApi.viralNavigationCube.cubeCamera.updateCubeCamera();
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
if (this.viralViewerApi.viralNavigationCube.cubeCamera && this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls) {
|
|
26
|
-
const updated2 = (
|
|
27
|
+
const updated2 = (_c = this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls) === null || _c === void 0 ? void 0 : _c.update(delta);
|
|
27
28
|
if (updated2) {
|
|
28
|
-
(
|
|
29
|
+
(_d = this.viralViewerApi.viralNavigationCube.cubeRenderer) === null || _d === void 0 ? void 0 : _d.render();
|
|
29
30
|
// this.viralViewerApi.viralCamera.updateMainCamera();
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
(
|
|
33
|
+
(_f = (_e = this.viralViewerApi.viralStats) === null || _e === void 0 ? void 0 : _e.stats) === null || _f === void 0 ? void 0 : _f.update();
|
|
33
34
|
}
|
|
34
35
|
animation() {
|
|
35
|
-
var _a, _b, _c;
|
|
36
|
+
var _a, _b, _c, _d;
|
|
36
37
|
const delta = this.clock.getDelta();
|
|
37
38
|
const elapsed = this.clock.getElapsedTime();
|
|
38
39
|
const updated1 = (_a = this.viralViewerApi.viralCamera.cameraControls) === null || _a === void 0 ? void 0 : _a.update(delta);
|
|
@@ -41,15 +42,16 @@ class ViralAnimation {
|
|
|
41
42
|
}
|
|
42
43
|
requestAnimationFrame(() => { this.animation(); });
|
|
43
44
|
if (updated1) {
|
|
44
|
-
this.viralViewerApi.
|
|
45
|
+
(_b = this.viralViewerApi.viralPostProcessing.composer) === null || _b === void 0 ? void 0 : _b.render();
|
|
46
|
+
// this.viralViewerApi.viralRenderer.render();
|
|
45
47
|
if (this.viralViewerApi.viralNavigationCube.cubeCamera) {
|
|
46
48
|
this.viralViewerApi.viralNavigationCube.cubeCamera.updateCubeCamera();
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
if (this.viralViewerApi.viralNavigationCube.cubeCamera && this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls) {
|
|
50
|
-
const updated2 = (
|
|
52
|
+
const updated2 = (_c = this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls) === null || _c === void 0 ? void 0 : _c.update(delta);
|
|
51
53
|
if (updated2) {
|
|
52
|
-
(
|
|
54
|
+
(_d = this.viralViewerApi.viralNavigationCube.cubeRenderer) === null || _d === void 0 ? void 0 : _d.render();
|
|
53
55
|
// this.viralViewerApi.viralCamera.updateMainCamera();
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-animation.js","sourceRoot":"","sources":["../../../src/components/animation/viral-animation.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAG9B,MAAa,cAAc;IAEvB,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QADjD,UAAK,GAAU,IAAI,aAAK,EAAE,CAAC;IAG3B,CAAC;IAEM,YAAY;;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC5C,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,0CAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/E,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE;YACnH,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SAE/N;QAED,qBAAqB,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;QAErD,IA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qBAAqB,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;QAElD,IAAI,QAAQ,EAAE;YACV,MAAA,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,QAAQ,0CAAE,MAAM,EAAE,CAAC;YAE3D,8CAA8C;YAC9C,IAAI,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,UAAU,EAAE;gBACpD,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;aAEzE;SACJ;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,UAAU,IAAI,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,UAAU,CAAC,cAAc,EAAE;YAEzH,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,UAAU,CAAC,cAAc,0CAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAElG,IAAI,QAAQ,EAAE;gBACV,MAAA,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,YAAY,0CAAE,MAAM,EAAE,CAAC;gBAC/D,sDAAsD;aACzD;SACJ;IAEL,CAAC;CAEJ;AAtED,wCAsEC"}
|
|
@@ -5,21 +5,22 @@ const types_1 = require("../../types");
|
|
|
5
5
|
class ViralCentralizedEventHandler {
|
|
6
6
|
constructor(viralViewerApi) {
|
|
7
7
|
this.viralViewerApi = viralViewerApi;
|
|
8
|
+
this.windowHandler();
|
|
8
9
|
this.contextMenuEventHandler();
|
|
9
10
|
}
|
|
10
11
|
//#region Context Menu
|
|
11
12
|
contextMenuEventHandler() {
|
|
12
13
|
if (this.viralViewerApi.viralContextMenu) {
|
|
13
|
-
this.viralViewerApi.viralContextMenu.addContextItem(0,
|
|
14
|
+
this.viralViewerApi.viralContextMenu.addContextItem(0, "Show all elements", (result) => {
|
|
14
15
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
15
16
|
});
|
|
16
|
-
this.viralViewerApi.viralContextMenu.addContextItem(1,
|
|
17
|
+
this.viralViewerApi.viralContextMenu.addContextItem(1, "Isolate", (result) => {
|
|
17
18
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
18
19
|
});
|
|
19
|
-
this.viralViewerApi.viralContextMenu.addContextItem(2,
|
|
20
|
+
this.viralViewerApi.viralContextMenu.addContextItem(2, "Hide", (result) => {
|
|
20
21
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
21
22
|
});
|
|
22
|
-
this.viralViewerApi.viralContextMenu.addContextItem(3,
|
|
23
|
+
this.viralViewerApi.viralContextMenu.addContextItem(3, "Focus", (result) => {
|
|
23
24
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
24
25
|
});
|
|
25
26
|
}
|
|
@@ -32,6 +33,16 @@ class ViralCentralizedEventHandler {
|
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region Camera
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region Window
|
|
40
|
+
windowHandler() {
|
|
41
|
+
window.onresize = () => {
|
|
42
|
+
this.viralViewerApi.viralCamera.resizeCanvas();
|
|
43
|
+
this.viralViewerApi;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
47
|
exports.ViralCentralizedEventHandler = ViralCentralizedEventHandler;
|
|
37
48
|
//# sourceMappingURL=viral-centralized-event-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-centralized-event-handler.js","sourceRoot":"","sources":["../../../src/components/centralized-event-handler/viral-centralized-event-handler.ts"],"names":[],"mappings":";;;AACA,uCAAkD;AAGlD,MAAa,4BAA4B;
|
|
1
|
+
{"version":3,"file":"viral-centralized-event-handler.js","sourceRoot":"","sources":["../../../src/components/centralized-event-handler/viral-centralized-event-handler.ts"],"names":[],"mappings":";;;AACA,uCAAkD;AAGlD,MAAa,4B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ACd,MAAM,CAAC,OAAO,EACd,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CACb,CAAC;YACJ,CAAC,CACF,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAC7C,2BAAmB,CAAC,kBAAkB,EACtC,iBAAiB,EACjB,CAAC,MAAkB,EAAE,EAAE;gBACrB,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC;YACzD,CAAC,CACF,CAAC;SACH;IACH,CAAC;IACD,YAAY;IAEZ,gBAAgB;IAEhB,YAAY;IAEZ,gBAAgB;IAChB,aAAa;QACX,MAAM,CAAC,QAAQ,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;YAC/C,IAAI,CAAC,cAAc,CAAA;QACrB,CAAC,CAAC;IACJ,CAAC;CAEF;AA1ED,oEA0EC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EffectComposer } from "../../threejs-addon/post-processing/effect-composer";
|
|
2
|
+
import { RenderPass } from "../../threejs-addon/post-processing/render-pass";
|
|
3
|
+
import { UnrealBloomPass } from "../../threejs-addon/post-processing/unreal-bloom-pass";
|
|
4
|
+
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
5
|
+
export declare class ViralPostProcessing {
|
|
6
|
+
private viralViewerApi;
|
|
7
|
+
composer: EffectComposer | null;
|
|
8
|
+
renderPass: RenderPass | null;
|
|
9
|
+
bloomPass: UnrealBloomPass | null;
|
|
10
|
+
constructor(viralViewerApi: ViralViewerApi);
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViralPostProcessing = void 0;
|
|
4
|
+
const three_1 = require("three");
|
|
5
|
+
const effect_composer_1 = require("../../threejs-addon/post-processing/effect-composer");
|
|
6
|
+
const render_pass_1 = require("../../threejs-addon/post-processing/render-pass");
|
|
7
|
+
const unreal_bloom_pass_1 = require("../../threejs-addon/post-processing/unreal-bloom-pass");
|
|
8
|
+
class ViralPostProcessing {
|
|
9
|
+
constructor(viralViewerApi) {
|
|
10
|
+
this.viralViewerApi = viralViewerApi;
|
|
11
|
+
this.composer = null;
|
|
12
|
+
//effect
|
|
13
|
+
this.renderPass = null;
|
|
14
|
+
this.bloomPass = null;
|
|
15
|
+
if (this.viralViewerApi.viralScene) {
|
|
16
|
+
this.composer = new effect_composer_1.EffectComposer(this.viralViewerApi.viralRenderer.renderer);
|
|
17
|
+
this.renderPass = new render_pass_1.RenderPass(this.viralViewerApi.viralScene.scene, this.viralViewerApi.viralCamera.camera);
|
|
18
|
+
this.bloomPass = new unreal_bloom_pass_1.UnrealBloomPass(new three_1.Vector2(window.innerWidth, window.innerHeight), 1.5, 0.4, 0.85);
|
|
19
|
+
this.bloomPass.threshold = 0;
|
|
20
|
+
this.bloomPass.strength = 1;
|
|
21
|
+
this.bloomPass.radius = 0.5;
|
|
22
|
+
this.composer.addPass(this.renderPass);
|
|
23
|
+
this.composer.addPass(this.bloomPass);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ViralPostProcessing = ViralPostProcessing;
|
|
28
|
+
//# sourceMappingURL=viral-post-processing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viral-post-processing.js","sourceRoot":"","sources":["../../../src/components/post-processing/viral-post-processing.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,yFAAqF;AACrF,iFAA6E;AAC7E,6FAAwF;AAGxF,MAAa,mBAAmB;IAM9B,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QALlD,aAAQ,GAA0B,IAAI,CAAC;QACvC,QAAQ;QACR,eAAU,GAAsB,IAAI,CAAC;QACrC,cAAS,GAA2B,IAAI,CAAC;QAGvC,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,gCAAc,CAChC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,QAAQ,CAC3C,CAAC;YAEF,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAU,CAC9B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,EACpC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CACvC,CAAC;YAEF,IAAI,CAAC,SAAS,GAAG,IAAI,mCAAe,CAClC,IAAI,eAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,EAClD,GAAG,EACH,GAAG,EACH,IAAI,CACL,CAAC;YACF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC;YAE5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACvC;IACH,CAAC;CACF;AA/BD,kDA+BC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class EffectComposer {
|
|
2
|
+
constructor(renderer: any, renderTarget: any);
|
|
3
|
+
renderer: any;
|
|
4
|
+
_pixelRatio: any;
|
|
5
|
+
_width: any;
|
|
6
|
+
_height: any;
|
|
7
|
+
renderTarget1: any;
|
|
8
|
+
renderTarget2: any;
|
|
9
|
+
writeBuffer: any;
|
|
10
|
+
readBuffer: any;
|
|
11
|
+
renderToScreen: boolean;
|
|
12
|
+
passes: any[];
|
|
13
|
+
copyPass: ShaderPass;
|
|
14
|
+
clock: Clock;
|
|
15
|
+
swapBuffers(): void;
|
|
16
|
+
addPass(pass: any): void;
|
|
17
|
+
insertPass(pass: any, index: any): void;
|
|
18
|
+
removePass(pass: any): void;
|
|
19
|
+
isLastEnabledPass(passIndex: any): boolean;
|
|
20
|
+
render(deltaTime: any): void;
|
|
21
|
+
reset(renderTarget: any): void;
|
|
22
|
+
setSize(width: any, height: any): void;
|
|
23
|
+
setPixelRatio(pixelRatio: any): void;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
import { ShaderPass } from './shader-pass';
|
|
27
|
+
import { Clock } from 'three';
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EffectComposer = void 0;
|
|
4
|
+
const three_1 = require("three");
|
|
5
|
+
const copy_shader_1 = require("../shaders/copy-shader");
|
|
6
|
+
const shader_pass_1 = require("./shader-pass");
|
|
7
|
+
const mask_pass_1 = require("./mask-pass");
|
|
8
|
+
class EffectComposer {
|
|
9
|
+
constructor(renderer, renderTarget) {
|
|
10
|
+
this.renderer = renderer;
|
|
11
|
+
this._pixelRatio = renderer.getPixelRatio();
|
|
12
|
+
if (renderTarget === undefined) {
|
|
13
|
+
const size = renderer.getSize(new three_1.Vector2());
|
|
14
|
+
this._width = size.width;
|
|
15
|
+
this._height = size.height;
|
|
16
|
+
renderTarget = new three_1.WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
17
|
+
renderTarget.texture.name = 'EffectComposer.rt1';
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this._width = renderTarget.width;
|
|
21
|
+
this._height = renderTarget.height;
|
|
22
|
+
}
|
|
23
|
+
this.renderTarget1 = renderTarget;
|
|
24
|
+
this.renderTarget2 = renderTarget.clone();
|
|
25
|
+
this.renderTarget2.texture.name = 'EffectComposer.rt2';
|
|
26
|
+
this.writeBuffer = this.renderTarget1;
|
|
27
|
+
this.readBuffer = this.renderTarget2;
|
|
28
|
+
this.renderToScreen = true;
|
|
29
|
+
this.passes = [];
|
|
30
|
+
this.copyPass = new shader_pass_1.ShaderPass(copy_shader_1.CopyShader);
|
|
31
|
+
this.clock = new three_1.Clock();
|
|
32
|
+
}
|
|
33
|
+
swapBuffers() {
|
|
34
|
+
const tmp = this.readBuffer;
|
|
35
|
+
this.readBuffer = this.writeBuffer;
|
|
36
|
+
this.writeBuffer = tmp;
|
|
37
|
+
}
|
|
38
|
+
addPass(pass) {
|
|
39
|
+
this.passes.push(pass);
|
|
40
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
41
|
+
}
|
|
42
|
+
insertPass(pass, index) {
|
|
43
|
+
this.passes.splice(index, 0, pass);
|
|
44
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
45
|
+
}
|
|
46
|
+
removePass(pass) {
|
|
47
|
+
const index = this.passes.indexOf(pass);
|
|
48
|
+
if (index !== -1) {
|
|
49
|
+
this.passes.splice(index, 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
isLastEnabledPass(passIndex) {
|
|
53
|
+
for (let i = passIndex + 1; i < this.passes.length; i++) {
|
|
54
|
+
if (this.passes[i].enabled) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
render(deltaTime) {
|
|
61
|
+
// deltaTime value is in seconds
|
|
62
|
+
if (deltaTime === undefined) {
|
|
63
|
+
deltaTime = this.clock.getDelta();
|
|
64
|
+
}
|
|
65
|
+
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
66
|
+
let maskActive = false;
|
|
67
|
+
for (let i = 0, il = this.passes.length; i < il; i++) {
|
|
68
|
+
const pass = this.passes[i];
|
|
69
|
+
if (pass.enabled === false)
|
|
70
|
+
continue;
|
|
71
|
+
pass.renderToScreen = (this.renderToScreen && this.isLastEnabledPass(i));
|
|
72
|
+
pass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive);
|
|
73
|
+
if (pass.needsSwap) {
|
|
74
|
+
if (maskActive) {
|
|
75
|
+
const context = this.renderer.getContext();
|
|
76
|
+
const stencil = this.renderer.state.buffers.stencil;
|
|
77
|
+
//context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
|
|
78
|
+
stencil.setFunc(context.NOTEQUAL, 1, 0xffffffff);
|
|
79
|
+
this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime);
|
|
80
|
+
//context.stencilFunc( context.EQUAL, 1, 0xffffffff );
|
|
81
|
+
stencil.setFunc(context.EQUAL, 1, 0xffffffff);
|
|
82
|
+
}
|
|
83
|
+
this.swapBuffers();
|
|
84
|
+
}
|
|
85
|
+
if (mask_pass_1.MaskPass !== undefined) {
|
|
86
|
+
if (pass instanceof mask_pass_1.MaskPass) {
|
|
87
|
+
maskActive = true;
|
|
88
|
+
}
|
|
89
|
+
else if (pass instanceof mask_pass_1.ClearMaskPass) {
|
|
90
|
+
maskActive = false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.renderer.setRenderTarget(currentRenderTarget);
|
|
95
|
+
}
|
|
96
|
+
reset(renderTarget) {
|
|
97
|
+
if (renderTarget === undefined) {
|
|
98
|
+
const size = this.renderer.getSize(new three_1.Vector2());
|
|
99
|
+
this._pixelRatio = this.renderer.getPixelRatio();
|
|
100
|
+
this._width = size.width;
|
|
101
|
+
this._height = size.height;
|
|
102
|
+
renderTarget = this.renderTarget1.clone();
|
|
103
|
+
renderTarget.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
104
|
+
}
|
|
105
|
+
this.renderTarget1.dispose();
|
|
106
|
+
this.renderTarget2.dispose();
|
|
107
|
+
this.renderTarget1 = renderTarget;
|
|
108
|
+
this.renderTarget2 = renderTarget.clone();
|
|
109
|
+
this.writeBuffer = this.renderTarget1;
|
|
110
|
+
this.readBuffer = this.renderTarget2;
|
|
111
|
+
}
|
|
112
|
+
setSize(width, height) {
|
|
113
|
+
this._width = width;
|
|
114
|
+
this._height = height;
|
|
115
|
+
const effectiveWidth = this._width * this._pixelRatio;
|
|
116
|
+
const effectiveHeight = this._height * this._pixelRatio;
|
|
117
|
+
this.renderTarget1.setSize(effectiveWidth, effectiveHeight);
|
|
118
|
+
this.renderTarget2.setSize(effectiveWidth, effectiveHeight);
|
|
119
|
+
for (let i = 0; i < this.passes.length; i++) {
|
|
120
|
+
this.passes[i].setSize(effectiveWidth, effectiveHeight);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
setPixelRatio(pixelRatio) {
|
|
124
|
+
this._pixelRatio = pixelRatio;
|
|
125
|
+
this.setSize(this._width, this._height);
|
|
126
|
+
}
|
|
127
|
+
dispose() {
|
|
128
|
+
this.renderTarget1.dispose();
|
|
129
|
+
this.renderTarget2.dispose();
|
|
130
|
+
this.copyPass.dispose();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.EffectComposer = EffectComposer;
|
|
134
|
+
//# sourceMappingURL=effect-composer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect-composer.js","sourceRoot":"","sources":["../../../src/threejs-addon/post-processing/effect-composer.js"],"names":[],"mappings":";;;AAAA,iCAIe;AACf,wDAAoD;AACpD,+CAA2C;AAC3C,2CAAsD;AAEtD,MAAM,cAAc;IAEhB,YAAY,QAAQ,EAAE,YAAY;QAE9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;QAE5C,IAAI,YAAY,KAAK,SAAS,EAAE;YAE5B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,eAAO,EAAE,CAAC,CAAC;YAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;YAE3B,YAAY,GAAG,IAAI,yBAAiB,CAAC,IAAI,CAAC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CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAEzC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;SAE3D;IAEL,CAAC;IAED,aAAa,CAAC,UAAU;QAEpB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAE5C,CAAC;IAED,OAAO;QAEH,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAE7B,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAE5B,CAAC;CAEJ;AAEQ,wCAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class MaskPass extends Pass {
|
|
2
|
+
constructor(scene: any, camera: any);
|
|
3
|
+
scene: any;
|
|
4
|
+
camera: any;
|
|
5
|
+
inverse: boolean;
|
|
6
|
+
render(renderer: any, writeBuffer: any, readBuffer: any): void;
|
|
7
|
+
}
|
|
8
|
+
export class ClearMaskPass extends Pass {
|
|
9
|
+
render(renderer: any): void;
|
|
10
|
+
}
|
|
11
|
+
import { Pass } from './pass';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearMaskPass = exports.MaskPass = void 0;
|
|
4
|
+
const pass_1 = require("./pass");
|
|
5
|
+
class MaskPass extends pass_1.Pass {
|
|
6
|
+
constructor(scene, camera) {
|
|
7
|
+
super();
|
|
8
|
+
this.scene = scene;
|
|
9
|
+
this.camera = camera;
|
|
10
|
+
this.clear = true;
|
|
11
|
+
this.needsSwap = false;
|
|
12
|
+
this.inverse = false;
|
|
13
|
+
}
|
|
14
|
+
render(renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */) {
|
|
15
|
+
const context = renderer.getContext();
|
|
16
|
+
const state = renderer.state;
|
|
17
|
+
// don't update color or depth
|
|
18
|
+
state.buffers.color.setMask(false);
|
|
19
|
+
state.buffers.depth.setMask(false);
|
|
20
|
+
// lock buffers
|
|
21
|
+
state.buffers.color.setLocked(true);
|
|
22
|
+
state.buffers.depth.setLocked(true);
|
|
23
|
+
// set up stencil
|
|
24
|
+
let writeValue, clearValue;
|
|
25
|
+
if (this.inverse) {
|
|
26
|
+
writeValue = 0;
|
|
27
|
+
clearValue = 1;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
writeValue = 1;
|
|
31
|
+
clearValue = 0;
|
|
32
|
+
}
|
|
33
|
+
state.buffers.stencil.setTest(true);
|
|
34
|
+
state.buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE);
|
|
35
|
+
state.buffers.stencil.setFunc(context.ALWAYS, writeValue, 0xffffffff);
|
|
36
|
+
state.buffers.stencil.setClear(clearValue);
|
|
37
|
+
state.buffers.stencil.setLocked(true);
|
|
38
|
+
// draw into the stencil buffer
|
|
39
|
+
renderer.setRenderTarget(readBuffer);
|
|
40
|
+
if (this.clear)
|
|
41
|
+
renderer.clear();
|
|
42
|
+
renderer.render(this.scene, this.camera);
|
|
43
|
+
renderer.setRenderTarget(writeBuffer);
|
|
44
|
+
if (this.clear)
|
|
45
|
+
renderer.clear();
|
|
46
|
+
renderer.render(this.scene, this.camera);
|
|
47
|
+
// unlock color and depth buffer for subsequent rendering
|
|
48
|
+
state.buffers.color.setLocked(false);
|
|
49
|
+
state.buffers.depth.setLocked(false);
|
|
50
|
+
// only render where stencil is set to 1
|
|
51
|
+
state.buffers.stencil.setLocked(false);
|
|
52
|
+
state.buffers.stencil.setFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1
|
|
53
|
+
state.buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP);
|
|
54
|
+
state.buffers.stencil.setLocked(true);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.MaskPass = MaskPass;
|
|
58
|
+
class ClearMaskPass extends pass_1.Pass {
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
this.needsSwap = false;
|
|
62
|
+
}
|
|
63
|
+
render(renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */) {
|
|
64
|
+
renderer.state.buffers.stencil.setLocked(false);
|
|
65
|
+
renderer.state.buffers.stencil.setTest(false);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.ClearMaskPass = ClearMaskPass;
|
|
69
|
+
//# sourceMappingURL=mask-pass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-pass.js","sourceRoot":"","sources":["../../../src/threejs-addon/post-processing/mask-pass.js"],"names":[],"mappings":";;;AAAA,iCAA8B;AAE9B,MAAM,QAAS,SAAQ,WAAI;IAEvB,YAAY,KAAK,EAAE,MAAM;QAErB,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IAEzB,CAAC;IAED,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,4BAA4B;QAEjE,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAE7B,8BAA8B;QAE9B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEnC,eAAe;QAEf,KAAK,CAAC,OAAO,CAAC,K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AyD;QAEzD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAErC,wCAAwC;QAExC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,eAAe;QAC5E,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACtE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAE1C,CAAC;CAEJ;AAqBQ,4BAAQ;AAnBjB,MAAM,aAAc,SAAQ,WAAI;IAE5B;QAEI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAE3B,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,qDAAqD;QAEjE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChD,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAElD,CAAC;CAEJ;AAEkB,sCAAa"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class OutputPass extends Pass {
|
|
2
|
+
uniforms: any;
|
|
3
|
+
material: RawShaderMaterial;
|
|
4
|
+
fsQuad: FullScreenQuad;
|
|
5
|
+
_outputColorSpace: any;
|
|
6
|
+
_toneMapping: any;
|
|
7
|
+
render(renderer: any, writeBuffer: any, readBuffer: any): void;
|
|
8
|
+
}
|
|
9
|
+
import { Pass } from './pass';
|
|
10
|
+
import { RawShaderMaterial } from 'three';
|
|
11
|
+
import { FullScreenQuad } from './pass';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutputPass = void 0;
|
|
4
|
+
const three_1 = require("three");
|
|
5
|
+
const pass_1 = require("./pass");
|
|
6
|
+
const output_shader_1 = require("../shaders/output-shader");
|
|
7
|
+
class OutputPass extends pass_1.Pass {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
//
|
|
11
|
+
const shader = output_shader_1.OutputShader;
|
|
12
|
+
this.uniforms = three_1.UniformsUtils.clone(shader.uniforms);
|
|
13
|
+
this.material = new three_1.RawShaderMaterial({
|
|
14
|
+
uniforms: this.uniforms,
|
|
15
|
+
vertexShader: shader.vertexShader,
|
|
16
|
+
fragmentShader: shader.fragmentShader
|
|
17
|
+
});
|
|
18
|
+
this.fsQuad = new pass_1.FullScreenQuad(this.material);
|
|
19
|
+
// internal cache
|
|
20
|
+
this._outputColorSpace = null;
|
|
21
|
+
this._toneMapping = null;
|
|
22
|
+
}
|
|
23
|
+
render(renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */) {
|
|
24
|
+
this.uniforms['tDiffuse'].value = readBuffer.texture;
|
|
25
|
+
this.uniforms['toneMappingExposure'].value = renderer.toneMappingExposure;
|
|
26
|
+
// rebuild defines if required
|
|
27
|
+
if (this._outputColorSpace !== renderer.outputColorSpace || this._toneMapping !== renderer.toneMapping) {
|
|
28
|
+
this._outputColorSpace = renderer.outputColorSpace;
|
|
29
|
+
this._toneMapping = renderer.toneMapping;
|
|
30
|
+
this.material.defines = {};
|
|
31
|
+
if (this._outputColorSpace == three_1.SRGBColorSpace)
|
|
32
|
+
this.material.defines.SRGB_COLOR_SPACE = '';
|
|
33
|
+
if (this._toneMapping === three_1.LinearToneMapping)
|
|
34
|
+
this.material.defines.LINEAR_TONE_MAPPING = '';
|
|
35
|
+
else if (this._toneMapping === three_1.ReinhardToneMapping)
|
|
36
|
+
this.material.defines.REINHARD_TONE_MAPPING = '';
|
|
37
|
+
else if (this._toneMapping === three_1.CineonToneMapping)
|
|
38
|
+
this.material.defines.CINEON_TONE_MAPPING = '';
|
|
39
|
+
else if (this._toneMapping === three_1.ACESFilmicToneMapping)
|
|
40
|
+
this.material.defines.ACES_FILMIC_TONE_MAPPING = '';
|
|
41
|
+
this.material.needsUpdate = true;
|
|
42
|
+
}
|
|
43
|
+
//
|
|
44
|
+
if (this.renderToScreen === true) {
|
|
45
|
+
renderer.setRenderTarget(null);
|
|
46
|
+
this.fsQuad.render(renderer);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
renderer.setRenderTarget(writeBuffer);
|
|
50
|
+
if (this.clear)
|
|
51
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
52
|
+
this.fsQuad.render(renderer);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
dispose() {
|
|
56
|
+
this.material.dispose();
|
|
57
|
+
this.fsQuad.dispose();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.OutputPass = OutputPass;
|
|
61
|
+
//# sourceMappingURL=output-pass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-pass.js","sourceRoot":"","sources":["../../../src/threejs-addon/post-processing/output-pass.js"],"names":[],"mappings":";;;AAAA,iCAQe;AACf,iCAA8C;AAC9C,4DAAwD;AAExD,MAAM,UAAW,SAAQ,WAAI;IAEzB;QAEI,KAAK,EAAE,CAAC;QAER,EAAE;QAEF,MAAM,MAAM,GAAG,4BAAY,CAAC;QAE5B,IAAI,CAAC,QAAQ,GAAG,qBAAa,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAiB,CAAC;YAClC,QAAQ,EAAE,IAAI,CA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K,yBAAiB;gBAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB,GAAG,EAAE,CAAC;iBAC5F,IAAI,IAAI,CAAC,YAAY,KAAK,6BAAqB;gBAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,wBAAwB,GAAG,EAAE,CAAC;YAE1G,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;SAEpC;QAED,EAAE;QAEF,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE;YAE9B,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAEhC;aAAM;YAEH,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YACtC,IAAI,IAAI,CAAC,KAAK;gBAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;YAC5G,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SAEhC;IAEL,CAAC;IAED,OAAO;QAEH,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAE1B,CAAC;CAEJ;AAEQ,gCAAU"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class Pass {
|
|
2
|
+
isPass: boolean;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
needsSwap: boolean;
|
|
5
|
+
clear: boolean;
|
|
6
|
+
renderToScreen: boolean;
|
|
7
|
+
setSize(): void;
|
|
8
|
+
render(): void;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
11
|
+
export class FullScreenQuad {
|
|
12
|
+
constructor(material: any);
|
|
13
|
+
_mesh: Mesh<BufferGeometry<import("three").NormalBufferAttributes>, any>;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
render(renderer: any): void;
|
|
16
|
+
set material(arg: any);
|
|
17
|
+
get material(): any;
|
|
18
|
+
}
|
|
19
|
+
import { BufferGeometry } from 'three';
|
|
20
|
+
import { Mesh } from 'three';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FullScreenQuad = exports.Pass = void 0;
|
|
4
|
+
const three_1 = require("three");
|
|
5
|
+
class Pass {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.isPass = true;
|
|
8
|
+
// if set to true, the pass is processed by the composer
|
|
9
|
+
this.enabled = true;
|
|
10
|
+
// if set to true, the pass indicates to swap read and write buffer after rendering
|
|
11
|
+
this.needsSwap = true;
|
|
12
|
+
// if set to true, the pass clears its buffer before rendering
|
|
13
|
+
this.clear = false;
|
|
14
|
+
// if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.
|
|
15
|
+
this.renderToScreen = false;
|
|
16
|
+
}
|
|
17
|
+
setSize( /* width, height */) { }
|
|
18
|
+
render( /* renderer, writeBuffer, readBuffer, deltaTime, maskActive */) {
|
|
19
|
+
console.error('THREE.Pass: .render() must be implemented in derived pass.');
|
|
20
|
+
}
|
|
21
|
+
dispose() { }
|
|
22
|
+
}
|
|
23
|
+
exports.Pass = Pass;
|
|
24
|
+
// Helper for passes that need to fill the viewport with a single quad.
|
|
25
|
+
const _camera = new three_1.OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
26
|
+
// https://github.com/mrdoob/three.js/pull/21358
|
|
27
|
+
const _geometry = new three_1.BufferGeometry();
|
|
28
|
+
_geometry.setAttribute('position', new three_1.Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3));
|
|
29
|
+
_geometry.setAttribute('uv', new three_1.Float32BufferAttribute([0, 2, 0, 0, 2, 0], 2));
|
|
30
|
+
class FullScreenQuad {
|
|
31
|
+
constructor(material) {
|
|
32
|
+
this._mesh = new three_1.Mesh(_geometry, material);
|
|
33
|
+
}
|
|
34
|
+
dispose() {
|
|
35
|
+
this._mesh.geometry.dispose();
|
|
36
|
+
}
|
|
37
|
+
render(renderer) {
|
|
38
|
+
renderer.render(this._mesh, _camera);
|
|
39
|
+
}
|
|
40
|
+
get material() {
|
|
41
|
+
return this._mesh.material;
|
|
42
|
+
}
|
|
43
|
+
set material(value) {
|
|
44
|
+
this._mesh.material = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.FullScreenQuad = FullScreenQuad;
|
|
48
|
+
//# sourceMappingURL=pass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pass.js","sourceRoot":"","sources":["../../../src/threejs-addon/post-processing/pass.js"],"names":[],"mappings":";;;AAAA,iCAKe;AAEf,MAAM,IAAI;IAEN;QAEI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,wDAAwD;QACxD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,mFAAmF;QACnF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,8DAA8D;QAC9D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,6GAA6G;QAC7G,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAEhC,CAAC;IAED,OAAO,EAAE,mBAAmB,IAAI,CAAC;IAEjC,MAAM,EAAE,8DAA8D;QAElE,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAEhF,CAAC;IAED,OAAO,KAAI,CAAC;CAEf;AA8CQ,oBAAI;AA5Cb,uEAAuE;AAEvE,MAAM,OAAO,GAAG,IAAI,0BAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3D,gDAAgD;AAEhD,MAAM,SAAS,GAAG,IAAI,sBAAc,EAAE,CAAC;AACvC,SAAS,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,8BAAsB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnG,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,8BAAsB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhF,MAAM,cAAc;IAEhB,YAAY,QAAQ;QAEhB,IAAI,CAAC,KAAK,GAAG,IAAI,YAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAE/C,CAAC;IAED,OAAO;QAEH,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAElC,CAAC;IAED,MAAM,CAAC,QAAQ;QAEX,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAEzC,CAAC;IAED,IAAI,QAAQ;QAER,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAE/B,CAAC;IAED,IAAI,QAAQ,CAAC,KAAK;QAEd,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;IAEhC,CAAC;CAEJ;AAEc,wCAAc"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class RenderPass extends Pass {
|
|
2
|
+
constructor(scene: any, camera: any, overrideMaterial: any, clearColor: any, clearAlpha: any);
|
|
3
|
+
scene: any;
|
|
4
|
+
camera: any;
|
|
5
|
+
overrideMaterial: any;
|
|
6
|
+
clearColor: any;
|
|
7
|
+
clearAlpha: any;
|
|
8
|
+
clearDepth: boolean;
|
|
9
|
+
_oldClearColor: Color;
|
|
10
|
+
render(renderer: any, writeBuffer: any, readBuffer: any): void;
|
|
11
|
+
}
|
|
12
|
+
import { Pass } from './pass';
|
|
13
|
+
import { Color } from 'three';
|