1 | import { WebGLRenderer } from "../renderers/WebGLRenderer.js";
|
2 | import { WebGLRenderTarget } from "../renderers/WebGLRenderTarget.js";
|
3 | import { Scene } from "../scenes/Scene.js";
|
4 | import { CubeTexture } from "../textures/CubeTexture.js";
|
5 | import { Texture } from "../textures/Texture.js";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export class PMREMGenerator {
|
32 | |
33 |
|
34 |
|
35 |
|
36 | constructor(renderer: WebGLRenderer);
|
37 |
|
38 | /**
|
39 | * Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low
|
40 | * @remarks
|
41 | * Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin).
|
42 | * @param scene The given scene.
|
43 | * @param sigma Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default `0`.
|
44 | * @param near The near plane value. Default `0.1`.
|
45 | * @param far The far plane value. Default `100`.
|
46 | */
|
47 | fromScene(scene: Scene, sigma?: number, near?: number, far?: number): WebGLRenderTarget;
|
48 |
|
49 | /**
|
50 | * Generates a PMREM from an equirectangular texture, which can be either LDR or HDR. The ideal input image size is
|
51 | * 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output. The smallest supported equirectangular
|
52 | * image size is 64 x 32.
|
53 | */
|
54 | fromEquirectangular(equirectangular: Texture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
55 |
|
56 | /**
|
57 | * Generates a PMREM from an cubemap texture, which can be either LDR or HDR. The ideal input cube size is
|
58 | * 256 x 256, as this matches best with the 256 x 256 cubemap output. The smallest supported cube size is 16 x 16.
|
59 | */
|
60 | fromCubemap(cubemap: CubeTexture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
61 |
|
62 | /**
|
63 | * Pre-compiles the cubemap shader
|
64 | * @remarks
|
65 | * You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.
|
66 | */
|
67 | compileCubemapShader(): void;
|
68 |
|
69 | /**
|
70 | * Pre-compiles the equirectangular shader
|
71 | * @remarks
|
72 | * You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.
|
73 | */
|
74 | compileEquirectangularShader(): void;
|
75 |
|
76 | /**
|
77 | * Frees the GPU-related resources allocated by this instance
|
78 | * @remarks
|
79 | * Call this method whenever this instance is no longer used in your app.
|
80 | */
|
81 | dispose(): void;
|
82 | }
|