1 | import { Camera } from "../../../cameras/Camera.js";
|
2 | import { Object3D } from "../../../core/Object3D.js";
|
3 | import { Material } from "../../../materials/Material.js";
|
4 | import { Color } from "../../../math/Color.js";
|
5 | import Node from "../../../nodes/core/Node.js";
|
6 | import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
7 | import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js";
|
8 | import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js";
|
9 | import LightsNode from "../../../nodes/lighting/LightsNode.js";
|
10 | import { NodeFrame } from "../../../nodes/Nodes.js";
|
11 | import { ShaderNodeObject } from "../../../nodes/TSL.js";
|
12 | import { Fog } from "../../../scenes/Fog.js";
|
13 | import { FogExp2 } from "../../../scenes/FogExp2.js";
|
14 | import { Scene } from "../../../scenes/Scene.js";
|
15 | import { CubeTexture } from "../../../textures/CubeTexture.js";
|
16 | import { Texture } from "../../../textures/Texture.js";
|
17 | import Backend from "../Backend.js";
|
18 | import ChainMap from "../ChainMap.js";
|
19 | import DataMap from "../DataMap.js";
|
20 | import Renderer from "../Renderer.js";
|
21 | import RenderObject from "../RenderObject.js";
|
22 | import NodeBuilderState from "./NodeBuilderState.js";
|
23 | import NodeUniformsGroup from "./NodeUniformsGroup.js";
|
24 | interface NodeUniformsGroupData {
|
25 | renderId?: number | undefined;
|
26 | frameId?: number | undefined;
|
27 | }
|
28 | interface RenderObjectData {
|
29 | nodeBuilderState?: NodeBuilderState | undefined;
|
30 | }
|
31 | interface ComputeNodeData {
|
32 | nodeBuilderState?: NodeBuilderState | undefined;
|
33 | }
|
34 | interface SceneData {
|
35 | background?: Color | Texture | CubeTexture | undefined;
|
36 | backgroundNode?: Node | undefined;
|
37 | fog?: Fog | FogExp2 | undefined;
|
38 | fogNode?: Node | undefined;
|
39 | environment?: Texture | undefined;
|
40 | environmentNode?: Node | undefined;
|
41 | }
|
42 | declare module "../../../scenes/Scene.js" {
|
43 | interface Scene {
|
44 | environmentNode?: Node | null | undefined;
|
45 | backgroundNode?: Node | null | undefined;
|
46 | fogNode?: Node | null | undefined;
|
47 | }
|
48 | }
|
49 | declare class Nodes extends DataMap<{
|
50 | nodeUniformsGroup: {
|
51 | key: NodeUniformsGroup;
|
52 | value: NodeUniformsGroupData;
|
53 | };
|
54 | renderObject: {
|
55 | key: RenderObject;
|
56 | value: RenderObjectData;
|
57 | };
|
58 | computeNode: {
|
59 | key: ComputeNode;
|
60 | value: ComputeNodeData;
|
61 | };
|
62 | scene: {
|
63 | key: Scene;
|
64 | value: SceneData;
|
65 | };
|
66 | }> {
|
67 | renderer: Renderer;
|
68 | backend: Backend;
|
69 | nodeFrame: NodeFrame;
|
70 | nodeBuilderCache: Map<string, NodeBuilderState>;
|
71 | callHashCache: ChainMap<readonly [Scene, LightsNode], {
|
72 | callId: number;
|
73 | cacheKey: string;
|
74 | }>;
|
75 | groupsData: ChainMap<readonly [UniformGroupNode, NodeUniformsGroup], {
|
76 | version?: number;
|
77 | }>;
|
78 | constructor(renderer: Renderer, backend: Backend);
|
79 | updateGroup(nodeUniformsGroup: NodeUniformsGroup): boolean;
|
80 | getForRenderCacheKey(renderObject: RenderObject): string;
|
81 | getForRender(renderObject: RenderObject): NodeBuilderState;
|
82 | delete(
|
83 | object: NodeUniformsGroup | RenderObject | ComputeNode | Scene,
|
84 | ): SceneData | RenderObjectData | NodeUniformsGroupData | ComputeNodeData;
|
85 | getForCompute(computeNode: ComputeNode): NodeBuilderState;
|
86 | _createNodeBuilderState(nodeBuilder: NodeBuilder): NodeBuilderState;
|
87 | getEnvironmentNode(scene: Scene): Node | null;
|
88 | getBackgroundNode(scene: Scene): Node | null;
|
89 | getFogNode(scene: Scene): Node | null;
|
90 | getCacheKey(scene: Scene, lightsNode: LightsNode): string;
|
91 | updateScene(scene: Scene): void;
|
92 | get isToneMappingState(): boolean;
|
93 | updateBackground(scene: Scene): void;
|
94 | updateFog(scene: Scene): void;
|
95 | updateEnvironment(scene: Scene): void;
|
96 | getNodeFrame(
|
97 | renderer?: Renderer,
|
98 | scene?: Scene | null,
|
99 | object?: Object3D | null,
|
100 | camera?: Camera | null,
|
101 | material?: Material | null,
|
102 | ): NodeFrame;
|
103 | getNodeFrameForRender(renderObject: RenderObject): NodeFrame;
|
104 | getOutputCacheKey(): string;
|
105 | hasOutputChange(outputTarget: Texture): boolean;
|
106 | getOutputNode(outputTexture: Texture): ShaderNodeObject<Node>;
|
107 | updateBefore(renderObject: RenderObject): void;
|
108 | updateAfter(renderObject: RenderObject): void;
|
109 | updateForCompute(computeNode: ComputeNode): void;
|
110 | updateForRender(renderObject: RenderObject): void;
|
111 | needsRefresh(renderObject: RenderObject): boolean;
|
112 | dispose(): void;
|
113 | }
|
114 | export default Nodes;
|