viral-viewer-2 4.8.1 → 4.8.3
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/camera/viral-camera.js +2 -2
- package/dist/components/camera/viral-camera.js.map +1 -1
- package/dist/components/post-processing/post-processing-renderer.d.ts +3 -14
- package/dist/components/post-processing/post-processing-renderer.js +7 -46
- package/dist/components/post-processing/post-processing-renderer.js.map +1 -1
- package/dist/threejs-addon/n8ao/n8ao.d.ts +303 -0
- package/dist/threejs-addon/n8ao/n8ao.js +1952 -0
- package/dist/threejs-addon/n8ao/n8ao.js.map +1 -0
- package/dist/threejs-addon/n8ao/post-processing.d.ts +73558 -0
- package/dist/threejs-addon/n8ao/post-processing.js +15145 -0
- package/dist/threejs-addon/n8ao/post-processing.js.map +1 -0
- package/package.json +3 -2
|
@@ -30,7 +30,7 @@ class ViralCamera {
|
|
|
30
30
|
this.setupCamera();
|
|
31
31
|
}
|
|
32
32
|
setupCamera() {
|
|
33
|
-
this.camera = new three_1.PerspectiveCamera(60, this.targetElement.offsetWidth / this.targetElement.offsetHeight, 0.
|
|
33
|
+
this.camera = new three_1.PerspectiveCamera(60, this.targetElement.offsetWidth / this.targetElement.offsetHeight, 0.1, 2000000);
|
|
34
34
|
this.camera.position.set(0, 0, 2);
|
|
35
35
|
if (this.viralViewerApi.options && this.viralViewerApi.options.cameraZUp) {
|
|
36
36
|
this.camera.up.set(0, 0, 1);
|
|
@@ -60,7 +60,7 @@ class ViralCamera {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
this.viralViewerApi.viralRenderer.postProcessingRenderer.
|
|
63
|
+
this.viralViewerApi.viralRenderer.postProcessingRenderer.initN8aoPass(this.viralViewerApi.viralScene.scene, this.camera);
|
|
64
64
|
// this.anim();
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-camera.js","sourceRoot":"","sources":["../../../src/components/camera/viral-camera.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,uCAAgG;AAEhG,iCAae;AACf,MAAM,aAAa,GAAG;IAClB,OAAO,EAAE,eAAO;IAChB,OAAO,EAAE,eAAO;IAChB,OAAO,EAAE,eAAO;IAChB,UAAU,EAAE,kBAAU;IACtB,OAAO,EAAE,eAAO;IAChB,SAAS,EAAE,iBAAS;IACpB,IAAI,EAAE,YAAI;IACV,MAAM,EAAE,cAAM;IACd,SAAS,EAAE,iBAAS;IACpB,SAAS,EAAE,iBAAS;CACvB,CAAC;AAGF,MAAa,WAAW;IAQpB,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAPjD,cAAS,GAAc,IAAI,iBAAS,EAAE,CAAC;QACvC,WAAM,GAA6B,IAAI,CAAC;QACxC,mBAAc,GAA0B,IAAI,CAAC;QAE7C,YAAO,GAAY,KAAK,CAAC;QAsJzB,uBAAuB;QACf,2BAAsB,GAA2B,EAAE,CAAC;QACpD,4BAAuB,GAA2B,EAAE,CAAC;QApJzD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC;QAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IACM,WAAW;QACd,IAAI,CAAC,MAAM,GAAG,IAAI,yBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"viral-camera.js","sourceRoot":"","sources":["../../../src/components/camera/viral-camera.ts"],"names":[],"mappings":";;;AAAA,qDAA6C;AAC7C,uCAAgG;AAEhG,iCAae;AACf,MAAM,aAAa,GAAG;IAClB,OAAO,EAAE,eAAO;IAChB,OAAO,EAAE,eAAO;IAChB,OAAO,EAAE,eAAO;IAChB,UAAU,EAAE,kBAAU;IACtB,OAAO,EAAE,eAAO;IAChB,SAAS,EAAE,i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AAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;gBAChD,MAAM;YACV,KAAK,4BAAoB,CAAC,QAAQ;gBAC9B,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;gBACjD,MAAM;YACV;gBACI,MAAM;SACb;IACL,CAAC;IAEM,mBAAmB,CAAC,IAA0B,EAAE,GAAW;QAC9D,QAAQ,IAAI,EAAE;YACV,KAAK,4BAAoB,CAAC,OAAO;gBAC7B;oBACI,IAAI,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;oBACpE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;iBAC/C;gBACD,MAAM;YACV,KAAK,4BAAoB,CAAC,QAAQ;gBAC9B;oBACI,IAAI,KAAK,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;oBACrE,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;iBAChD;gBACD,MAAM;YAEV;gBACI,MAAM;SACb;IACL,CAAC;IAEM,mBAAmB;QACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAC9C,CAAC;CAEJ;AA3MD,kCA2MC"}
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { Camera, Scene, WebGLRenderer } from "three";
|
|
2
2
|
import { EffectComposer } from "../../threejs-addon/post-processing/effect-composer";
|
|
3
|
-
import {
|
|
4
|
-
import { SAOPass } from "../../threejs-addon/post-processing/sao-pass";
|
|
5
|
-
import { ShaderPass } from "../../threejs-addon/post-processing/shader-pass";
|
|
3
|
+
import { N8AOPass } from "../../threejs-addon/n8ao/n8ao";
|
|
6
4
|
export declare class PostProcessingRenderer {
|
|
7
5
|
private renderer;
|
|
8
6
|
composer: EffectComposer;
|
|
9
|
-
|
|
10
|
-
saoPass: SAOPass | null;
|
|
11
|
-
shaderPass: ShaderPass | null;
|
|
12
|
-
colorCorrectionPass: ShaderPass | null;
|
|
7
|
+
na8oPass: N8AOPass | null;
|
|
13
8
|
constructor(renderer: WebGLRenderer);
|
|
14
9
|
render(): void;
|
|
15
|
-
|
|
16
|
-
initSAOPass(scene: Scene, camera: Camera): void;
|
|
17
|
-
turnOnSAOPass(): void;
|
|
18
|
-
initShaderPass(): void;
|
|
19
|
-
turnOnShaderPass(): void;
|
|
20
|
-
initCorrectionColorPass(): void;
|
|
21
|
-
turnOnCorrectionColorPass(): void;
|
|
10
|
+
initN8aoPass(scene: Scene, camera: Camera): void;
|
|
22
11
|
}
|
|
@@ -2,61 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostProcessingRenderer = void 0;
|
|
4
4
|
const effect_composer_1 = require("../../threejs-addon/post-processing/effect-composer");
|
|
5
|
-
const
|
|
6
|
-
const sao_pass_1 = require("../../threejs-addon/post-processing/sao-pass");
|
|
7
|
-
const shader_pass_1 = require("../../threejs-addon/post-processing/shader-pass");
|
|
8
|
-
const fxaa_shader_1 = require("../../threejs-addon/shaders/fxaa-shader");
|
|
9
|
-
const color_correction_shader_1 = require("../../threejs-addon/shaders/color-correction-shader");
|
|
5
|
+
const n8ao_1 = require("../../threejs-addon/n8ao/n8ao");
|
|
10
6
|
class PostProcessingRenderer {
|
|
11
7
|
constructor(renderer) {
|
|
12
8
|
this.renderer = renderer;
|
|
13
|
-
this.
|
|
14
|
-
this.saoPass = null;
|
|
15
|
-
this.shaderPass = null;
|
|
16
|
-
this.colorCorrectionPass = null;
|
|
9
|
+
this.na8oPass = null;
|
|
17
10
|
this.composer = new effect_composer_1.EffectComposer(this.renderer);
|
|
18
11
|
this.composer.setSize(window.innerWidth, window.innerHeight);
|
|
19
12
|
}
|
|
20
13
|
render() {
|
|
21
14
|
this.composer.render();
|
|
22
15
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
initSAOPass(scene, camera) {
|
|
30
|
-
if (!this.saoPass) {
|
|
31
|
-
this.saoPass = new sao_pass_1.SAOPass(scene, camera, true, true);
|
|
32
|
-
this.saoPass.resolution.set(8192, 8192);
|
|
33
|
-
this.saoPass.params.saoBias = 0.5;
|
|
34
|
-
this.saoPass.params.saoIntensity = 0.0012;
|
|
35
|
-
this.saoPass.params.saoScale = 0.3;
|
|
36
|
-
this.saoPass.params.saoKernelRadius = 40;
|
|
37
|
-
this.saoPass.params.saoMinResolution = 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
turnOnSAOPass() {
|
|
41
|
-
this.composer.addPass(this.saoPass);
|
|
42
|
-
}
|
|
43
|
-
initShaderPass() {
|
|
44
|
-
this.shaderPass = new shader_pass_1.ShaderPass(fxaa_shader_1.FXAAShader);
|
|
45
|
-
const pixelRatio = this.renderer.getPixelRatio();
|
|
46
|
-
this.shaderPass.material.uniforms["resolution"].value.x =
|
|
47
|
-
1 / (window.innerWidth * pixelRatio);
|
|
48
|
-
this.shaderPass.material.uniforms["resolution"].value.y =
|
|
49
|
-
1 / (window.innerHeight * pixelRatio);
|
|
50
|
-
}
|
|
51
|
-
turnOnShaderPass() {
|
|
52
|
-
this.composer.addPass(this.shaderPass);
|
|
53
|
-
// this.composer.addPass(this.colorCorrectionPass);
|
|
54
|
-
}
|
|
55
|
-
initCorrectionColorPass() {
|
|
56
|
-
this.colorCorrectionPass = new shader_pass_1.ShaderPass(color_correction_shader_1.ColorCorrectionShader);
|
|
57
|
-
}
|
|
58
|
-
turnOnCorrectionColorPass() {
|
|
59
|
-
this.composer.addPass(this.colorCorrectionPass);
|
|
16
|
+
initN8aoPass(scene, camera) {
|
|
17
|
+
this.na8oPass = new n8ao_1.N8AOPass(scene, camera);
|
|
18
|
+
this.na8oPass.configuration.denoiseRadius = 12;
|
|
19
|
+
this.na8oPass.configuration.intensity = 5;
|
|
20
|
+
this.composer.addPass(this.na8oPass);
|
|
60
21
|
}
|
|
61
22
|
}
|
|
62
23
|
exports.PostProcessingRenderer = PostProcessingRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-processing-renderer.js","sourceRoot":"","sources":["../../../src/components/post-processing/post-processing-renderer.ts"],"names":[],"mappings":";;;AACA,yFAAqF;AACrF,
|
|
1
|
+
{"version":3,"file":"post-processing-renderer.js","sourceRoot":"","sources":["../../../src/components/post-processing/post-processing-renderer.ts"],"names":[],"mappings":";;;AACA,yFAAqF;AACrF,wDAAyD;AACzD,MAAa,sBAAsB;IAGjC,YAAoB,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;QAD3C,aAAQ,GAAoB,IAAI,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,IAAI,gCAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/D,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAEM,YAAY,CAAC,KAAY,EAAE,MAAc;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,aAAa,GAAG,EAAE,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,CAAC,CAAC;QAE1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAnBD,wDAmBC"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
declare class $05f6997e4b65da14$export$2d57db20b5eb5e0a extends $5Whe3$Pass {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {THREE.Scene} scene
|
|
5
|
+
* @param {THREE.Camera} camera
|
|
6
|
+
* @param {number} width
|
|
7
|
+
* @param {number} height
|
|
8
|
+
*
|
|
9
|
+
* @property {THREE.Scene} scene
|
|
10
|
+
* @property {THREE.Camera} camera
|
|
11
|
+
* @property {number} width
|
|
12
|
+
* @property {number} height
|
|
13
|
+
*/
|
|
14
|
+
constructor(scene: THREE.Scene, camera: THREE.Camera, width?: number, height?: number);
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
camera: import("three").Camera;
|
|
18
|
+
scene: import("three").Scene;
|
|
19
|
+
/**
|
|
20
|
+
* @type {Proxy & {
|
|
21
|
+
* aoSamples: number,
|
|
22
|
+
* aoRadius: number,
|
|
23
|
+
* denoiseSamples: number,
|
|
24
|
+
* denoiseRadius: number,
|
|
25
|
+
* distanceFalloff: number,
|
|
26
|
+
* intensity: number,
|
|
27
|
+
* denoiseIterations: number,
|
|
28
|
+
* renderMode: 0 | 1 | 2 | 3 | 4,
|
|
29
|
+
* color: THREE.Color,
|
|
30
|
+
* gammaCorrection: boolean,
|
|
31
|
+
* logarithmicDepthBuffer: boolean
|
|
32
|
+
* screenSpaceRadius: boolean,
|
|
33
|
+
* halfRes: boolean,
|
|
34
|
+
* depthAwareUpsampling: boolean,
|
|
35
|
+
* autoRenderBeauty: boolean
|
|
36
|
+
* colorMultiply: boolean
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
configuration: ProxyConstructor & {
|
|
40
|
+
aoSamples: number;
|
|
41
|
+
aoRadius: number;
|
|
42
|
+
denoiseSamples: number;
|
|
43
|
+
denoiseRadius: number;
|
|
44
|
+
distanceFalloff: number;
|
|
45
|
+
intensity: number;
|
|
46
|
+
denoiseIterations: number;
|
|
47
|
+
renderMode: 0 | 1 | 2 | 3 | 4;
|
|
48
|
+
color: THREE.Color;
|
|
49
|
+
gammaCorrection: boolean;
|
|
50
|
+
logarithmicDepthBuffer: boolean;
|
|
51
|
+
screenSpaceRadius: boolean;
|
|
52
|
+
halfRes: boolean;
|
|
53
|
+
depthAwareUpsampling: boolean;
|
|
54
|
+
autoRenderBeauty: boolean;
|
|
55
|
+
colorMultiply: boolean;
|
|
56
|
+
};
|
|
57
|
+
/** @type {THREE.Vector3[]} */
|
|
58
|
+
samples: THREE.Vector3[];
|
|
59
|
+
/** @type {number[]} */
|
|
60
|
+
samplesR: number[];
|
|
61
|
+
/** @type {THREE.Vector2[]} */
|
|
62
|
+
samplesDenoise: THREE.Vector2[];
|
|
63
|
+
beautyRenderTarget: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
64
|
+
writeTargetInternal: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
65
|
+
readTargetInternal: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
66
|
+
/** @type {THREE.DataTexture} */
|
|
67
|
+
bluenoise: THREE.DataTexture;
|
|
68
|
+
lastTime: number;
|
|
69
|
+
_r: $5Whe3$Vector2;
|
|
70
|
+
_c: $5Whe3$Color;
|
|
71
|
+
configureHalfResTargets(): void;
|
|
72
|
+
depthDownsampleTarget: $5Whe3$WebGLMultipleRenderTargets | null | undefined;
|
|
73
|
+
depthDownsampleQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | null | undefined;
|
|
74
|
+
configureSampleDependentPasses(): void;
|
|
75
|
+
configureAOPass(logarithmicDepthBuffer?: boolean): void;
|
|
76
|
+
effectShaderQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
77
|
+
configureDenoisePass(logarithmicDepthBuffer?: boolean): void;
|
|
78
|
+
poissonBlurQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
79
|
+
configureEffectCompositer(logarithmicDepthBuffer?: boolean): void;
|
|
80
|
+
effectCompositerQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @param {Number} n
|
|
84
|
+
* @returns {THREE.Vector3[]}
|
|
85
|
+
*/
|
|
86
|
+
generateHemisphereSamples(n: number): THREE.Vector3[];
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @param {number} n
|
|
90
|
+
* @returns {number[]}
|
|
91
|
+
*/
|
|
92
|
+
generateHemisphereSamplesR(n: number): number[];
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @param {number} numSamples
|
|
96
|
+
* @param {number} numRings
|
|
97
|
+
* @returns {THREE.Vector2[]}
|
|
98
|
+
*/
|
|
99
|
+
generateDenoiseSamples(numSamples: number, numRings: number): THREE.Vector2[];
|
|
100
|
+
setSize(width: any, height: any): void;
|
|
101
|
+
render(renderer: any, writeBuffer: any, readBuffer: any, deltaTime: any, maskActive: any): void;
|
|
102
|
+
debugMode: boolean | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Enables the debug mode of the AO, meaning the lastTime value will be updated.
|
|
105
|
+
*/
|
|
106
|
+
enableDebugMode(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Disables the debug mode of the AO, meaning the lastTime value will not be updated.
|
|
109
|
+
*/
|
|
110
|
+
disableDebugMode(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Sets the display mode of the AO
|
|
113
|
+
* @param {"Combined" | "AO" | "No AO" | "Split" | "Split AO"} mode - The display mode.
|
|
114
|
+
*/
|
|
115
|
+
setDisplayMode(mode: "Combined" | "AO" | "No AO" | "Split" | "Split AO"): void;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param {"Performance" | "Low" | "Medium" | "High" | "Ultra"} mode
|
|
119
|
+
*/
|
|
120
|
+
setQualityMode(mode: "Performance" | "Low" | "Medium" | "High" | "Ultra"): void;
|
|
121
|
+
}
|
|
122
|
+
declare const $87431ee93b037844$export$2489f9981ab0fa82_base: {
|
|
123
|
+
new (name?: string | undefined, scene?: import("three").Scene | undefined, camera?: import("three").Camera | undefined): {
|
|
124
|
+
name: string;
|
|
125
|
+
renderer: any;
|
|
126
|
+
scene: import("three").Scene;
|
|
127
|
+
camera: import("three").Camera;
|
|
128
|
+
screen: any;
|
|
129
|
+
rtt: boolean;
|
|
130
|
+
needsSwap: boolean;
|
|
131
|
+
needsDepthTexture: boolean;
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
renderToScreen: boolean;
|
|
134
|
+
mainScene: any;
|
|
135
|
+
mainCamera: any;
|
|
136
|
+
setRenderer(renderer: WebGLRenderer): void;
|
|
137
|
+
isEnabled(): boolean;
|
|
138
|
+
setEnabled(value: boolean): void;
|
|
139
|
+
fullscreenMaterial: import("three").Material;
|
|
140
|
+
getFullscreenMaterial(): import("three").Material;
|
|
141
|
+
setFullscreenMaterial(value: import("three").Material): void;
|
|
142
|
+
getDepthTexture(): import("three").Texture;
|
|
143
|
+
setDepthTexture(depthTexture: import("three").Texture, depthPacking?: any): void;
|
|
144
|
+
render(renderer: WebGLRenderer, inputBuffer: $5Whe3$WebGLRenderTarget<import("three").Texture>, outputBuffer: $5Whe3$WebGLRenderTarget<import("three").Texture>, deltaTime?: number | undefined, stencilTest?: boolean | undefined): void;
|
|
145
|
+
setSize(width: number, height: number): void;
|
|
146
|
+
initialize(renderer: WebGLRenderer, alpha: boolean, frameBufferType: number): void;
|
|
147
|
+
dispose(): void;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
declare class $87431ee93b037844$export$2489f9981ab0fa82 extends $87431ee93b037844$export$2489f9981ab0fa82_base {
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @param {THREE.Scene} scene
|
|
154
|
+
* @param {THREE.Camera} camera
|
|
155
|
+
* @param {number} width
|
|
156
|
+
* @param {number} height
|
|
157
|
+
*
|
|
158
|
+
* @property {THREE.Scene} scene
|
|
159
|
+
* @property {THREE.Camera} camera
|
|
160
|
+
* @property {number} width
|
|
161
|
+
* @property {number} height
|
|
162
|
+
*/
|
|
163
|
+
constructor(scene: THREE.Scene, camera: THREE.Camera, width?: number, height?: number);
|
|
164
|
+
width: number;
|
|
165
|
+
height: number;
|
|
166
|
+
clear: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* @type {Proxy & {
|
|
169
|
+
* aoSamples: number,
|
|
170
|
+
* aoRadius: number,
|
|
171
|
+
* denoiseSamples: number,
|
|
172
|
+
* denoiseRadius: number,
|
|
173
|
+
* distanceFalloff: number,
|
|
174
|
+
* intensity: number,
|
|
175
|
+
* denoiseIterations: number,
|
|
176
|
+
* renderMode: 0 | 1 | 2 | 3 | 4,
|
|
177
|
+
* color: THREE.Color,
|
|
178
|
+
* gammaCorrection: boolean,
|
|
179
|
+
* logarithmicDepthBuffer: boolean
|
|
180
|
+
* screenSpaceRadius: boolean,
|
|
181
|
+
* halfRes: boolean,
|
|
182
|
+
* depthAwareUpsampling: boolean
|
|
183
|
+
* colorMultiply: boolean
|
|
184
|
+
* }
|
|
185
|
+
*/
|
|
186
|
+
autosetGamma: ProxyConstructor & {
|
|
187
|
+
aoSamples: number;
|
|
188
|
+
aoRadius: number;
|
|
189
|
+
denoiseSamples: number;
|
|
190
|
+
denoiseRadius: number;
|
|
191
|
+
distanceFalloff: number;
|
|
192
|
+
intensity: number;
|
|
193
|
+
denoiseIterations: number;
|
|
194
|
+
renderMode: 0 | 1 | 2 | 3 | 4;
|
|
195
|
+
color: THREE.Color;
|
|
196
|
+
gammaCorrection: boolean;
|
|
197
|
+
logarithmicDepthBuffer: boolean;
|
|
198
|
+
screenSpaceRadius: boolean;
|
|
199
|
+
halfRes: boolean;
|
|
200
|
+
depthAwareUpsampling: boolean;
|
|
201
|
+
colorMultiply: boolean;
|
|
202
|
+
};
|
|
203
|
+
configuration: {
|
|
204
|
+
aoSamples: number;
|
|
205
|
+
aoRadius: number;
|
|
206
|
+
denoiseSamples: number;
|
|
207
|
+
denoiseRadius: number;
|
|
208
|
+
distanceFalloff: number;
|
|
209
|
+
intensity: number;
|
|
210
|
+
denoiseIterations: number;
|
|
211
|
+
renderMode: number;
|
|
212
|
+
color: $5Whe3$Color;
|
|
213
|
+
gammaCorrection: boolean;
|
|
214
|
+
logarithmicDepthBuffer: boolean;
|
|
215
|
+
screenSpaceRadius: boolean;
|
|
216
|
+
halfRes: boolean;
|
|
217
|
+
depthAwareUpsampling: boolean;
|
|
218
|
+
colorMultiply: boolean;
|
|
219
|
+
};
|
|
220
|
+
/** @type {THREE.Vector3[]} */
|
|
221
|
+
samples: THREE.Vector3[];
|
|
222
|
+
/** @type {number[]} */
|
|
223
|
+
samplesR: number[];
|
|
224
|
+
/** @type {THREE.Vector2[]} */
|
|
225
|
+
samplesDenoise: THREE.Vector2[];
|
|
226
|
+
copyQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5;
|
|
227
|
+
writeTargetInternal: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
228
|
+
readTargetInternal: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
229
|
+
outputTargetInternal: $5Whe3$WebGLRenderTarget<import("three").Texture>;
|
|
230
|
+
/** @type {THREE.DataTexture} */
|
|
231
|
+
bluenoise: THREE.DataTexture;
|
|
232
|
+
lastTime: number;
|
|
233
|
+
_r: $5Whe3$Vector2;
|
|
234
|
+
_c: $5Whe3$Color;
|
|
235
|
+
configureHalfResTargets(): void;
|
|
236
|
+
depthDownsampleTarget: $5Whe3$WebGLMultipleRenderTargets | null | undefined;
|
|
237
|
+
depthDownsampleQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | null | undefined;
|
|
238
|
+
configureSampleDependentPasses(): void;
|
|
239
|
+
configureAOPass(logarithmicDepthBuffer?: boolean): void;
|
|
240
|
+
effectShaderQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
241
|
+
configureDenoisePass(logarithmicDepthBuffer?: boolean): void;
|
|
242
|
+
poissonBlurQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
243
|
+
configureEffectCompositer(logarithmicDepthBuffer?: boolean): void;
|
|
244
|
+
effectCompositerQuad: $e4ca8dcb0218f846$export$dcd670d73db751f5 | undefined;
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* @param {Number} n
|
|
248
|
+
* @returns {THREE.Vector3[]}
|
|
249
|
+
*/
|
|
250
|
+
generateHemisphereSamples(n: number): THREE.Vector3[];
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* @param {number} n
|
|
254
|
+
* @returns {number[]}
|
|
255
|
+
*/
|
|
256
|
+
generateHemisphereSamplesR(n: number): number[];
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
* @param {number} numSamples
|
|
260
|
+
* @param {number} numRings
|
|
261
|
+
* @returns {THREE.Vector2[]}
|
|
262
|
+
*/
|
|
263
|
+
generateDenoiseSamples(numSamples: number, numRings: number): THREE.Vector2[];
|
|
264
|
+
setSize(width: any, height: any): void;
|
|
265
|
+
setDepthTexture(depthTexture: any): void;
|
|
266
|
+
depthTexture: any;
|
|
267
|
+
render(renderer: any, inputBuffer: any, outputBuffer: any): void;
|
|
268
|
+
debugMode: boolean | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Enables the debug mode of the AO, meaning the lastTime value will be updated.
|
|
271
|
+
*/
|
|
272
|
+
enableDebugMode(): void;
|
|
273
|
+
/**
|
|
274
|
+
* Disables the debug mode of the AO, meaning the lastTime value will not be updated.
|
|
275
|
+
*/
|
|
276
|
+
disableDebugMode(): void;
|
|
277
|
+
/**
|
|
278
|
+
* Sets the display mode of the AO
|
|
279
|
+
* @param {"Combined" | "AO" | "No AO" | "Split" | "Split AO"} mode - The display mode.
|
|
280
|
+
*/
|
|
281
|
+
setDisplayMode(mode: "Combined" | "AO" | "No AO" | "Split" | "Split AO"): void;
|
|
282
|
+
/**
|
|
283
|
+
*
|
|
284
|
+
* @param {"Performance" | "Low" | "Medium" | "High" | "Ultra"} mode
|
|
285
|
+
*/
|
|
286
|
+
setQualityMode(mode: "Performance" | "Low" | "Medium" | "High" | "Ultra"): void;
|
|
287
|
+
}
|
|
288
|
+
import { Pass as $5Whe3$Pass } from "three/examples/jsm/postprocessing/Pass.js";
|
|
289
|
+
import { WebGLRenderTarget as $5Whe3$WebGLRenderTarget } from "three";
|
|
290
|
+
import { Vector2 as $5Whe3$Vector2 } from "three";
|
|
291
|
+
import { Color as $5Whe3$Color } from "three";
|
|
292
|
+
import { WebGLMultipleRenderTargets as $5Whe3$WebGLMultipleRenderTargets } from "three";
|
|
293
|
+
declare class $e4ca8dcb0218f846$export$dcd670d73db751f5 {
|
|
294
|
+
constructor(material: any);
|
|
295
|
+
_mesh: $5Whe3$Mesh<$5Whe3$BufferGeometry<import("three").NormalBufferAttributes>, any, import("three").Object3DEventMap>;
|
|
296
|
+
render(renderer: any): void;
|
|
297
|
+
set material(arg: any);
|
|
298
|
+
get material(): any;
|
|
299
|
+
dispose(): void;
|
|
300
|
+
}
|
|
301
|
+
import { BufferGeometry as $5Whe3$BufferGeometry } from "three";
|
|
302
|
+
import { Mesh as $5Whe3$Mesh } from "three";
|
|
303
|
+
export { $05f6997e4b65da14$export$2d57db20b5eb5e0a as N8AOPass, $87431ee93b037844$export$2489f9981ab0fa82 as N8AOPostPass };
|