@shapediver/viewer.rendering-engine.rendering-engine-threejs 3.14.2 → 3.14.4
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/loaders/MaterialLoader.d.ts +1 -1
- package/package.json +17 -17
- package/dist/interfaces/IPostProcessingEffectDefinitions.d.ts +0 -307
- package/dist/interfaces/IPostProcessingEffectDefinitions.d.ts.map +0 -1
- package/dist/interfaces/IPostProcessingEffectDefinitions.js +0 -31
- package/dist/interfaces/IPostProcessingEffectDefinitions.js.map +0 -1
- package/dist/managers/postprocessing/utils/TransparencyAwareNormalPass.d.ts +0 -31
- package/dist/managers/postprocessing/utils/TransparencyAwareNormalPass.d.ts.map +0 -1
- package/dist/managers/postprocessing/utils/TransparencyAwareNormalPass.js +0 -120
- package/dist/managers/postprocessing/utils/TransparencyAwareNormalPass.js.map +0 -1
- package/dist/managers/sceneTree/ThreeJsDataManager.d.ts +0 -1
- package/dist/managers/sceneTree/ThreeJsDataManager.d.ts.map +0 -1
- package/dist/managers/sceneTree/ThreeJsDataManager.js +0 -2
- package/dist/managers/sceneTree/ThreeJsDataManager.js.map +0 -1
|
@@ -71,7 +71,7 @@ export declare class MaterialLoader implements ILoader {
|
|
|
71
71
|
assignEnvironmentMapRotation(value: quat): void;
|
|
72
72
|
assignPointSize(p: number): void;
|
|
73
73
|
cacheSize(): number;
|
|
74
|
-
createMaterial(type: GEOMETRY_MATERIAL_TYPE, incomingData: IMaterialAbstractData | GeometryData, materialData: IMaterialAbstractData | null, materialSettings?: MaterialSettings): THREE.Material | THREE.MeshBasicMaterial | THREE.PointsMaterial | MultiPointsMaterial
|
|
74
|
+
createMaterial(type: GEOMETRY_MATERIAL_TYPE, incomingData: IMaterialAbstractData | GeometryData, materialData: IMaterialAbstractData | null, materialSettings?: MaterialSettings): THREE.LineBasicMaterial | THREE.Material | THREE.MeshBasicMaterial | THREE.PointsMaterial | MultiPointsMaterial;
|
|
75
75
|
emptyMaterialCache(): void;
|
|
76
76
|
getMaterialProperties(materialData: IMaterialAbstractData | null, type: GEOMETRY_MATERIAL_TYPE, materialSettings?: MaterialSettings): {
|
|
77
77
|
properties: ThreeJsMaterialParameterTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.rendering-engine.rendering-engine-threejs",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"testEnvironment": "node"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@shapediver/viewer.data-engine.gltf-converter": "3.14.
|
|
42
|
-
"@shapediver/viewer.data-engine.shared-types": "3.14.
|
|
43
|
-
"@shapediver/viewer.data-engine.tag3d-engine": "3.14.
|
|
44
|
-
"@shapediver/viewer.rendering-engine.animation-engine": "3.14.
|
|
45
|
-
"@shapediver/viewer.rendering-engine.animation-frame-engine": "3.14.
|
|
46
|
-
"@shapediver/viewer.rendering-engine.camera-engine": "3.14.
|
|
47
|
-
"@shapediver/viewer.rendering-engine.canvas-engine": "3.14.
|
|
48
|
-
"@shapediver/viewer.rendering-engine.intersection-engine": "3.14.
|
|
49
|
-
"@shapediver/viewer.rendering-engine.light-engine": "3.14.
|
|
50
|
-
"@shapediver/viewer.rendering-engine.rendering-engine": "3.14.
|
|
51
|
-
"@shapediver/viewer.shared.global-access-objects": "3.14.
|
|
52
|
-
"@shapediver/viewer.shared.math": "3.14.
|
|
53
|
-
"@shapediver/viewer.shared.node-tree": "3.14.
|
|
54
|
-
"@shapediver/viewer.shared.services": "3.14.
|
|
55
|
-
"@shapediver/viewer.shared.types": "3.14.
|
|
41
|
+
"@shapediver/viewer.data-engine.gltf-converter": "3.14.4",
|
|
42
|
+
"@shapediver/viewer.data-engine.shared-types": "3.14.4",
|
|
43
|
+
"@shapediver/viewer.data-engine.tag3d-engine": "3.14.4",
|
|
44
|
+
"@shapediver/viewer.rendering-engine.animation-engine": "3.14.4",
|
|
45
|
+
"@shapediver/viewer.rendering-engine.animation-frame-engine": "3.14.4",
|
|
46
|
+
"@shapediver/viewer.rendering-engine.camera-engine": "3.14.4",
|
|
47
|
+
"@shapediver/viewer.rendering-engine.canvas-engine": "3.14.4",
|
|
48
|
+
"@shapediver/viewer.rendering-engine.intersection-engine": "3.14.4",
|
|
49
|
+
"@shapediver/viewer.rendering-engine.light-engine": "3.14.4",
|
|
50
|
+
"@shapediver/viewer.rendering-engine.rendering-engine": "3.14.4",
|
|
51
|
+
"@shapediver/viewer.shared.global-access-objects": "3.14.4",
|
|
52
|
+
"@shapediver/viewer.shared.math": "3.14.4",
|
|
53
|
+
"@shapediver/viewer.shared.node-tree": "3.14.4",
|
|
54
|
+
"@shapediver/viewer.shared.services": "3.14.4",
|
|
55
|
+
"@shapediver/viewer.shared.types": "3.14.4",
|
|
56
56
|
"@tweenjs/tween.js": "^18.6.4",
|
|
57
57
|
"@types/stats.js": "^0.17.0",
|
|
58
58
|
"@types/three": "0.162.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"stats.js": "^0.17.0",
|
|
62
62
|
"three": "0.162.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "0d69a4f3b348579abcd893921bf0c2f39813b0fe"
|
|
65
65
|
}
|
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
import { Color } from "@shapediver/viewer.shared.types";
|
|
2
|
-
import { vec2 } from "gl-matrix";
|
|
3
|
-
import { BlendFunction, KernelSize, VignetteTechnique } from "postprocessing";
|
|
4
|
-
export declare enum POST_PROCESSING_EFFECT_TYPE {
|
|
5
|
-
BLOOM = "bloom",
|
|
6
|
-
CHROMATIC_ABERRATION = "chromatic_aberration",
|
|
7
|
-
DEPTH_OF_FIELD = "depth_of_field",
|
|
8
|
-
DOT_SCREEN = "dot_screen",
|
|
9
|
-
GOD_RAYS = "god_rays",
|
|
10
|
-
GRID = "grid",
|
|
11
|
-
HBAO = "hbao",
|
|
12
|
-
HUE_SATURATION = "hue_saturation",
|
|
13
|
-
NOISE = "noise",
|
|
14
|
-
OUTLINE = "outline",
|
|
15
|
-
PIXELATION = "pixelation",
|
|
16
|
-
SSAO = "ssao",
|
|
17
|
-
SCANLINE = "scanline",
|
|
18
|
-
SELECTIVE_BLOOM = "selective_bloom",
|
|
19
|
-
SEPIA = "sepia",
|
|
20
|
-
TILT_SHIFT = "tilt_shift",
|
|
21
|
-
VIGNETTE = "vignette"
|
|
22
|
-
}
|
|
23
|
-
export declare enum ANTI_ALIASING_TECHNIQUE {
|
|
24
|
-
FXAA = "fxaa",
|
|
25
|
-
NONE = "none",
|
|
26
|
-
SMAA = "smaa",
|
|
27
|
-
SSAA = "ssaa"
|
|
28
|
-
}
|
|
29
|
-
export interface IPostProcessingEffectDefinition {
|
|
30
|
-
/** The type of this effect. */
|
|
31
|
-
type: POST_PROCESSING_EFFECT_TYPE;
|
|
32
|
-
/** The token of the effect, is only returned by the viewer, but ignored as an input. */
|
|
33
|
-
token?: string;
|
|
34
|
-
properties?: any;
|
|
35
|
-
}
|
|
36
|
-
export interface IBloomEffectDefinition extends IPostProcessingEffectDefinition {
|
|
37
|
-
properties?: {
|
|
38
|
-
/** The blend function of this effect. (default: BlendFunction.ADD) */
|
|
39
|
-
blendFunction?: BlendFunction;
|
|
40
|
-
/** The bloom intensity. (default: 1.0) */
|
|
41
|
-
intensity?: number;
|
|
42
|
-
/** The blur kernel size. (default: KernelSize.LARGE) */
|
|
43
|
-
kernelSize?: KernelSize;
|
|
44
|
-
/** Controls the smoothness of the luminance threshold. Range is [0, 1]. (default: 0.025) */
|
|
45
|
-
luminanceSmoothing?: number;
|
|
46
|
-
/** The luminance threshold. Raise this value to mask out darker elements in the scene. Range is [0, 1]. (default: 0.9) */
|
|
47
|
-
luminanceThreshold?: number;
|
|
48
|
-
/** Enables or disables mipmap blur. (default: false) */
|
|
49
|
-
mipmapBlur?: boolean;
|
|
50
|
-
};
|
|
51
|
-
type: POST_PROCESSING_EFFECT_TYPE.BLOOM;
|
|
52
|
-
}
|
|
53
|
-
export interface IChromaticAberrationEffectDefinition extends IPostProcessingEffectDefinition {
|
|
54
|
-
properties?: {
|
|
55
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
56
|
-
blendFunction?: BlendFunction;
|
|
57
|
-
/** The modulation offset. Only applies if `radialModulation` is enabled. (default: 0.15) */
|
|
58
|
-
modulationOffset?: number;
|
|
59
|
-
/** The color offset. (default: [0.001, 0.0005]) */
|
|
60
|
-
offset?: vec2 | {
|
|
61
|
-
x: number;
|
|
62
|
-
y: number;
|
|
63
|
-
};
|
|
64
|
-
/** Whether the effect should be modulated with a radial gradient. (default: false) */
|
|
65
|
-
radialModulation?: boolean;
|
|
66
|
-
};
|
|
67
|
-
type: POST_PROCESSING_EFFECT_TYPE.CHROMATIC_ABERRATION;
|
|
68
|
-
}
|
|
69
|
-
export interface IDepthOfFieldEffectDefinition extends IPostProcessingEffectDefinition {
|
|
70
|
-
properties?: {
|
|
71
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
72
|
-
blendFunction?: BlendFunction;
|
|
73
|
-
/** The scale of the bokeh blur. (default: 5.0) */
|
|
74
|
-
bokehScale?: number;
|
|
75
|
-
/** The normalized focus distance. Range is [0.0, 1.0]. (default: 0.0) */
|
|
76
|
-
focusDistance?: number;
|
|
77
|
-
/** The focus range. Range is [0.0, 1.0]. (default: 0.01) */
|
|
78
|
-
focusRange?: number;
|
|
79
|
-
};
|
|
80
|
-
type: POST_PROCESSING_EFFECT_TYPE.DEPTH_OF_FIELD;
|
|
81
|
-
}
|
|
82
|
-
export interface IDotScreenEffectDefinition extends IPostProcessingEffectDefinition {
|
|
83
|
-
properties?: {
|
|
84
|
-
/** The angle of the dot pattern. (default: 1.57) */
|
|
85
|
-
angle?: number;
|
|
86
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
87
|
-
blendFunction?: BlendFunction;
|
|
88
|
-
/** The scale of the dot pattern. (default: 1.0) */
|
|
89
|
-
scale?: number;
|
|
90
|
-
};
|
|
91
|
-
type: POST_PROCESSING_EFFECT_TYPE.DOT_SCREEN;
|
|
92
|
-
}
|
|
93
|
-
export interface IGodRaysEffectDefinition extends IPostProcessingEffectDefinition {
|
|
94
|
-
properties?: {
|
|
95
|
-
/** The blend function of this effect. (default: BlendFunction.SCREEN) */
|
|
96
|
-
blendFunction?: BlendFunction;
|
|
97
|
-
/** Whether the god rays should be blurred to reduce artifacts. (default: true) */
|
|
98
|
-
blur?: boolean;
|
|
99
|
-
/** An upper bound for the saturation of the overall effect. (default: 1.0) */
|
|
100
|
-
clampMax?: number;
|
|
101
|
-
/** An illumination decay factor. (default: 0.9) */
|
|
102
|
-
decay?: number;
|
|
103
|
-
/** The density of the light rays. (default: 0.96) */
|
|
104
|
-
density?: number;
|
|
105
|
-
/** A constant attenuation coefficient. (default: 0.6) */
|
|
106
|
-
exposure?: number;
|
|
107
|
-
/** The blur kernel size. Has no effect if blur is disabled. (default: KernelSize.SMALL) */
|
|
108
|
-
kernelSize?: KernelSize;
|
|
109
|
-
/** A light ray weight factor. (default: 0.4) */
|
|
110
|
-
weight?: number;
|
|
111
|
-
};
|
|
112
|
-
type: POST_PROCESSING_EFFECT_TYPE.GOD_RAYS;
|
|
113
|
-
}
|
|
114
|
-
export interface IGridEffectDefinition extends IPostProcessingEffectDefinition {
|
|
115
|
-
properties?: {
|
|
116
|
-
/** The blend function of this effect. (default: BlendFunction.MULTIPLY) */
|
|
117
|
-
blendFunction?: BlendFunction;
|
|
118
|
-
/** The scale of the grid pattern. (default: 1.0) */
|
|
119
|
-
scale?: number;
|
|
120
|
-
};
|
|
121
|
-
type: POST_PROCESSING_EFFECT_TYPE.GRID;
|
|
122
|
-
}
|
|
123
|
-
export interface IHBAOEffectDefinition extends IPostProcessingEffectDefinition {
|
|
124
|
-
properties?: {
|
|
125
|
-
/** The resolution scale of the ambient occlusion. (default: 1) */
|
|
126
|
-
resolutionScale?: number;
|
|
127
|
-
/** The samples that are taken per pixel to compute the ambient occlusion. (default: 16) */
|
|
128
|
-
spp?: number;
|
|
129
|
-
/** Controls the radius/size of the ambient occlusion in world units. (default: 1) */
|
|
130
|
-
distance?: number;
|
|
131
|
-
/** Controls how fast the ambient occlusion fades away with distance in world units. (default: 1) */
|
|
132
|
-
distanceIntensity?: number;
|
|
133
|
-
/** A purely artistic control for the intensity of the AO - runs the ao through the function pow(ao, intensity), which has the effect of darkening areas with more ambient occlusion. (default: 2.5) */
|
|
134
|
-
intensity?: number;
|
|
135
|
-
/** The color of the ambient occlusion. (default: black) */
|
|
136
|
-
color?: Color;
|
|
137
|
-
/** The bias that is used for the effect in world units. (default: 10) */
|
|
138
|
-
bias?: number;
|
|
139
|
-
/** The thickness if the ambient occlusion effect. (default: 0.5) */
|
|
140
|
-
thickness?: number;
|
|
141
|
-
/** The number of iterations of the denoising pass. (default: 1) */
|
|
142
|
-
iterations?: number;
|
|
143
|
-
/** The radius of the poisson disk. (default: 12) */
|
|
144
|
-
radius?: number;
|
|
145
|
-
/** The rings of the poisson disk. (default: 11) */
|
|
146
|
-
rings?: number;
|
|
147
|
-
/** Allows to adjust the influence of the luma difference in the denoising pass. (default: 10) */
|
|
148
|
-
lumaPhi?: number;
|
|
149
|
-
/** Allows to adjust the influence of the depth difference in the denoising pass. (default: 2) */
|
|
150
|
-
depthPhi?: number;
|
|
151
|
-
/** Allows to adjust the influence of the normal difference in the denoising pass. (default: 3.25) */
|
|
152
|
-
normalPhi?: number;
|
|
153
|
-
/** The samples that are used in the poisson disk. (default: 16) */
|
|
154
|
-
samples?: number;
|
|
155
|
-
};
|
|
156
|
-
type: POST_PROCESSING_EFFECT_TYPE.HBAO;
|
|
157
|
-
}
|
|
158
|
-
export interface IHueSaturationEffectDefinition extends IPostProcessingEffectDefinition {
|
|
159
|
-
properties?: {
|
|
160
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
161
|
-
blendFunction?: BlendFunction;
|
|
162
|
-
/** The hue in radians. (default: 0.0) */
|
|
163
|
-
hue?: number;
|
|
164
|
-
/** The saturation factor, ranging from -1 to 1, where 0 means no change. (default: 0.0) */
|
|
165
|
-
saturation?: number;
|
|
166
|
-
};
|
|
167
|
-
type: POST_PROCESSING_EFFECT_TYPE.HUE_SATURATION;
|
|
168
|
-
}
|
|
169
|
-
export interface INoiseEffectDefinition extends IPostProcessingEffectDefinition {
|
|
170
|
-
properties?: {
|
|
171
|
-
/** The blend function of this effect. (default: BlendFunction.SCREEN) */
|
|
172
|
-
blendFunction?: BlendFunction;
|
|
173
|
-
/** Whether the noise should be multiplied with the input colors prior to blending. (default: false) */
|
|
174
|
-
premultiply?: boolean;
|
|
175
|
-
};
|
|
176
|
-
type: POST_PROCESSING_EFFECT_TYPE.NOISE;
|
|
177
|
-
}
|
|
178
|
-
export interface IOutlineEffectDefinition extends IPostProcessingEffectDefinition {
|
|
179
|
-
properties?: {
|
|
180
|
-
/** The blend function of this effect. (default: BlendFunction.SCREEN) */
|
|
181
|
-
blendFunction?: BlendFunction;
|
|
182
|
-
/** Whether the outline should be blurred. (default: false) */
|
|
183
|
-
blur?: boolean;
|
|
184
|
-
/** The edge strength. (default: 1.0) */
|
|
185
|
-
edgeStrength?: number;
|
|
186
|
-
/** The color of hidden edges. (default: #22090a) */
|
|
187
|
-
hiddenEdgeColor?: Color;
|
|
188
|
-
/** The blur kernel size. (default: KernelSize.VERY_SMALL) */
|
|
189
|
-
kernelSize?: KernelSize;
|
|
190
|
-
/** The number of samples used for multisample antialiasing. Requires WebGL 2. (default: 0) */
|
|
191
|
-
multisampling?: number;
|
|
192
|
-
/** The pulse speed. A value of zero disables the pulse effect. (default: 0.0) */
|
|
193
|
-
pulseSpeed?: number;
|
|
194
|
-
/** The resolution that is used for the effect. (default: 480) */
|
|
195
|
-
resolution?: number;
|
|
196
|
-
/** The color of visible edges. (default: #ffffff) */
|
|
197
|
-
visibleEdgeColor?: Color;
|
|
198
|
-
/** Whether occluded parts of selected objects should be visible. (default: true) */
|
|
199
|
-
xRay?: boolean;
|
|
200
|
-
};
|
|
201
|
-
type: POST_PROCESSING_EFFECT_TYPE.OUTLINE;
|
|
202
|
-
}
|
|
203
|
-
export interface IPixelationEffectDefinition extends IPostProcessingEffectDefinition {
|
|
204
|
-
properties?: {
|
|
205
|
-
/** The pixel granularity. (default: 30.0) */
|
|
206
|
-
granularity?: number;
|
|
207
|
-
};
|
|
208
|
-
type: POST_PROCESSING_EFFECT_TYPE.PIXELATION;
|
|
209
|
-
}
|
|
210
|
-
export interface ISSAOEffectDefinition extends IPostProcessingEffectDefinition {
|
|
211
|
-
properties?: {
|
|
212
|
-
/** The resolution scale of the ambient occlusion. (default: 1) */
|
|
213
|
-
resolutionScale?: number;
|
|
214
|
-
/** The samples that are taken per pixel to compute the ambient occlusion. (default: 16) */
|
|
215
|
-
spp?: number;
|
|
216
|
-
/** Controls the radius/size of the ambient occlusion in world units. (default: 1) */
|
|
217
|
-
distance?: number;
|
|
218
|
-
/** Controls how fast the ambient occlusion fades away with distance in world units. (default: 1) */
|
|
219
|
-
distanceIntensity?: number;
|
|
220
|
-
/** A purely artistic control for the intensity of the AO - runs the ao through the function pow(ao, intensity), which has the effect of darkening areas with more ambient occlusion. (default: 2.5) */
|
|
221
|
-
intensity?: number;
|
|
222
|
-
/** The color of the ambient occlusion. (default: black) */
|
|
223
|
-
color?: Color;
|
|
224
|
-
/** The number of iterations of the denoising pass. (default: 1) */
|
|
225
|
-
iterations?: number;
|
|
226
|
-
/** The radius of the poisson disk. (default: 12) */
|
|
227
|
-
radius?: number;
|
|
228
|
-
/** The rings of the poisson disk. (default: 11) */
|
|
229
|
-
rings?: number;
|
|
230
|
-
/** Allows to adjust the influence of the luma difference in the denoising pass. (default: 10) */
|
|
231
|
-
lumaPhi?: number;
|
|
232
|
-
/** Allows to adjust the influence of the depth difference in the denoising pass. (default: 2) */
|
|
233
|
-
depthPhi?: number;
|
|
234
|
-
/** Allows to adjust the influence of the normal difference in the denoising pass. (default: 3.25) */
|
|
235
|
-
normalPhi?: number;
|
|
236
|
-
/** The samples that are used in the poisson disk. (default: 16) */
|
|
237
|
-
samples?: number;
|
|
238
|
-
};
|
|
239
|
-
type: POST_PROCESSING_EFFECT_TYPE.SSAO;
|
|
240
|
-
}
|
|
241
|
-
export interface IScanlineEffectDefinition extends IPostProcessingEffectDefinition {
|
|
242
|
-
properties?: {
|
|
243
|
-
/** The blend function of this effect. (default: BlendFunction.OVERLAY) */
|
|
244
|
-
blendFunction?: BlendFunction;
|
|
245
|
-
/** The scanline density. (default: 1.25) */
|
|
246
|
-
density?: number;
|
|
247
|
-
};
|
|
248
|
-
type: POST_PROCESSING_EFFECT_TYPE.SCANLINE;
|
|
249
|
-
}
|
|
250
|
-
export interface ISelectiveBloomEffectDefinition extends IPostProcessingEffectDefinition {
|
|
251
|
-
properties?: {
|
|
252
|
-
/** The blend function of this effect. (default: BlendFunction.ADD) */
|
|
253
|
-
blendFunction?: BlendFunction;
|
|
254
|
-
/** The bloom intensity. (default: 1.0) */
|
|
255
|
-
intensity?: number;
|
|
256
|
-
/** The blur kernel size. (default: KernelSize.LARGE) */
|
|
257
|
-
kernelSize?: KernelSize;
|
|
258
|
-
/** Controls the smoothness of the luminance threshold. Range is [0, 1]. (default: 0.025) */
|
|
259
|
-
luminanceSmoothing?: number;
|
|
260
|
-
/** The luminance threshold. Raise this value to mask out darker elements in the scene. Range is [0, 1]. (default: 0.9) */
|
|
261
|
-
luminanceThreshold?: number;
|
|
262
|
-
/** Enables or disables mipmap blur. (default: false) */
|
|
263
|
-
mipmapBlur?: boolean;
|
|
264
|
-
/** Enables or disables if the background is evaluated for the bloom calculation. (default: true) */
|
|
265
|
-
ignoreBackground?: boolean;
|
|
266
|
-
};
|
|
267
|
-
type: POST_PROCESSING_EFFECT_TYPE.SELECTIVE_BLOOM;
|
|
268
|
-
}
|
|
269
|
-
export interface ISepiaEffectDefinition extends IPostProcessingEffectDefinition {
|
|
270
|
-
properties?: {
|
|
271
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
272
|
-
blendFunction?: BlendFunction;
|
|
273
|
-
};
|
|
274
|
-
type: POST_PROCESSING_EFFECT_TYPE.SEPIA;
|
|
275
|
-
}
|
|
276
|
-
export interface ITiltShiftEffectDefinition extends IPostProcessingEffectDefinition {
|
|
277
|
-
properties?: {
|
|
278
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
279
|
-
blendFunction?: BlendFunction;
|
|
280
|
-
/** The softness of the focus area edges. (default: 0.3) */
|
|
281
|
-
feather?: number;
|
|
282
|
-
/** The relative size of the focus area. (default: 0.4) */
|
|
283
|
-
focusArea?: number;
|
|
284
|
-
/** The blur kernel size. (default: KernelSize.MEDIUM) */
|
|
285
|
-
kernelSize?: KernelSize;
|
|
286
|
-
/** The relative offset of the focus area. (default: 0.0) */
|
|
287
|
-
offset?: number;
|
|
288
|
-
/** The rotation of the focus area in radians. (default: 0.0) */
|
|
289
|
-
rotation?: number;
|
|
290
|
-
};
|
|
291
|
-
type: POST_PROCESSING_EFFECT_TYPE.TILT_SHIFT;
|
|
292
|
-
}
|
|
293
|
-
export interface IVignetteEffectDefinition extends IPostProcessingEffectDefinition {
|
|
294
|
-
properties?: {
|
|
295
|
-
/** The blend function of this effect. (default: BlendFunction.NORMAL) */
|
|
296
|
-
blendFunction?: BlendFunction;
|
|
297
|
-
/** The Vignette darkness. (default: 0.5) */
|
|
298
|
-
darkness?: number;
|
|
299
|
-
/** The Vignette offset. (default: 0.5) */
|
|
300
|
-
offset?: number;
|
|
301
|
-
/** The Vignette technique. (default: VignetteTechnique.DEFAULT) */
|
|
302
|
-
technique?: VignetteTechnique;
|
|
303
|
-
};
|
|
304
|
-
type: POST_PROCESSING_EFFECT_TYPE.VIGNETTE;
|
|
305
|
-
}
|
|
306
|
-
export declare type IPostProcessingEffectsArray = (IBloomEffectDefinition | IChromaticAberrationEffectDefinition | IDepthOfFieldEffectDefinition | IDotScreenEffectDefinition | IGridEffectDefinition | IHBAOEffectDefinition | IHueSaturationEffectDefinition | INoiseEffectDefinition | IPixelationEffectDefinition | ISSAOEffectDefinition | IScanlineEffectDefinition | ISepiaEffectDefinition | ITiltShiftEffectDefinition | IVignetteEffectDefinition)[];
|
|
307
|
-
//# sourceMappingURL=IPostProcessingEffectDefinitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IPostProcessingEffectDefinitions.d.ts","sourceRoot":"","sources":["../../src/interfaces/IPostProcessingEffectDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAE5E,oBAAY,2BAA2B;IACtC,KAAK,UAAU;IACf,oBAAoB,yBAAyB;IAC7C,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,QAAQ,aAAa;CACrB;AAED,oBAAY,uBAAuB;IAClC,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED,MAAM,WAAW,+BAA+B;IAG/C,+BAA+B;IAC/B,IAAI,EAAE,2BAA2B,CAAC;IAClC,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EA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,KAAK,CAAC;CAGxC;AAED,MAAM,WAAW,0BAChB,SAAQ,+BAA+B;IAGvC,UAAU,CAAC,EAAE;QACZ,yEAAyE;QACzE,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,2DAA2D;QAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,0DAA0D;QAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,yDAAyD;QACzD,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,4DAA4D;QAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,gEAAgE;QAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,EAAE,2BAA2B,CAAC,UAAU,CAAC;CAG7C;AAED,MAAM,WAAW,yBAChB,SAAQ,+BAA+B;IAGvC,UAAU,CAAC,EAAE;QACZ,yEAAyE;QACzE,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,0CAA0C;QAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,mEAAmE;QACnE,SAAS,CAAC,EAAE,iBAAiB,CAAC;KAC9B,CAAC;IACF,IAAI,EAAE,2BAA2B,CAAC,QAAQ,CAAC;CAG3C;AAED,oBAAY,2BAA2B,GAAG,CACvC,sBAAsB,GACtB,oCAAoC,GACpC,6BAA6B,GAC7B,0BAA0B,GAC1B,qBAAqB,GACrB,qBAAqB,GACrB,8BAA8B,GAC9B,sBAAsB,GACtB,2BAA2B,GAC3B,qBAAqB,GACrB,yBAAyB,GACzB,sBAAsB,GACtB,0BAA0B,GAC1B,yBAAyB,CAC3B,EAAE,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ANTI_ALIASING_TECHNIQUE = exports.POST_PROCESSING_EFFECT_TYPE = void 0;
|
|
4
|
-
var POST_PROCESSING_EFFECT_TYPE;
|
|
5
|
-
(function (POST_PROCESSING_EFFECT_TYPE) {
|
|
6
|
-
POST_PROCESSING_EFFECT_TYPE["BLOOM"] = "bloom";
|
|
7
|
-
POST_PROCESSING_EFFECT_TYPE["CHROMATIC_ABERRATION"] = "chromatic_aberration";
|
|
8
|
-
POST_PROCESSING_EFFECT_TYPE["DEPTH_OF_FIELD"] = "depth_of_field";
|
|
9
|
-
POST_PROCESSING_EFFECT_TYPE["DOT_SCREEN"] = "dot_screen";
|
|
10
|
-
POST_PROCESSING_EFFECT_TYPE["GOD_RAYS"] = "god_rays";
|
|
11
|
-
POST_PROCESSING_EFFECT_TYPE["GRID"] = "grid";
|
|
12
|
-
POST_PROCESSING_EFFECT_TYPE["HBAO"] = "hbao";
|
|
13
|
-
POST_PROCESSING_EFFECT_TYPE["HUE_SATURATION"] = "hue_saturation";
|
|
14
|
-
POST_PROCESSING_EFFECT_TYPE["NOISE"] = "noise";
|
|
15
|
-
POST_PROCESSING_EFFECT_TYPE["OUTLINE"] = "outline";
|
|
16
|
-
POST_PROCESSING_EFFECT_TYPE["PIXELATION"] = "pixelation";
|
|
17
|
-
POST_PROCESSING_EFFECT_TYPE["SSAO"] = "ssao";
|
|
18
|
-
POST_PROCESSING_EFFECT_TYPE["SCANLINE"] = "scanline";
|
|
19
|
-
POST_PROCESSING_EFFECT_TYPE["SELECTIVE_BLOOM"] = "selective_bloom";
|
|
20
|
-
POST_PROCESSING_EFFECT_TYPE["SEPIA"] = "sepia";
|
|
21
|
-
POST_PROCESSING_EFFECT_TYPE["TILT_SHIFT"] = "tilt_shift";
|
|
22
|
-
POST_PROCESSING_EFFECT_TYPE["VIGNETTE"] = "vignette";
|
|
23
|
-
})(POST_PROCESSING_EFFECT_TYPE = exports.POST_PROCESSING_EFFECT_TYPE || (exports.POST_PROCESSING_EFFECT_TYPE = {}));
|
|
24
|
-
var ANTI_ALIASING_TECHNIQUE;
|
|
25
|
-
(function (ANTI_ALIASING_TECHNIQUE) {
|
|
26
|
-
ANTI_ALIASING_TECHNIQUE["FXAA"] = "fxaa";
|
|
27
|
-
ANTI_ALIASING_TECHNIQUE["NONE"] = "none";
|
|
28
|
-
ANTI_ALIASING_TECHNIQUE["SMAA"] = "smaa";
|
|
29
|
-
ANTI_ALIASING_TECHNIQUE["SSAA"] = "ssaa";
|
|
30
|
-
})(ANTI_ALIASING_TECHNIQUE = exports.ANTI_ALIASING_TECHNIQUE || (exports.ANTI_ALIASING_TECHNIQUE = {}));
|
|
31
|
-
//# sourceMappingURL=IPostProcessingEffectDefinitions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IPostProcessingEffectDefinitions.js","sourceRoot":"","sources":["../../src/interfaces/IPostProcessingEffectDefinitions.ts"],"names":[],"mappings":";;;AAIA,IAAY,2BAkBX;AAlBD,WAAY,2BAA2B;IACtC,8CAAe,CAAA;IACf,4EAA6C,CAAA;IAC7C,gEAAiC,CAAA;IACjC,wDAAyB,CAAA;IACzB,oDAAqB,CAAA;IACrB,4CAAa,CAAA;IACb,4CAAa,CAAA;IACb,gEAAiC,CAAA;IACjC,8CAAe,CAAA;IACf,kDAAmB,CAAA;IACnB,wDAAyB,CAAA;IACzB,4CAAa,CAAA;IACb,oDAAqB,CAAA;IACrB,kEAAmC,CAAA;IACnC,8CAAe,CAAA;IACf,wDAAyB,CAAA;IACzB,oDAAqB,CAAA;AACtB,CAAC,EAlBW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAkBtC;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IAClC,wCAAa,CAAA;IACb,wCAAa,CAAA;IACb,wCAAa,CAAA;IACb,wCAAa,CAAA;AACd,CAAC,EALW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAKlC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Pass, Resolution } from "postprocessing";
|
|
2
|
-
import { Camera, DepthTexture, Scene, Texture, WebGLRenderer, WebGLRenderTarget } from "three";
|
|
3
|
-
/**
|
|
4
|
-
* A pass that renders normals and depth with transparency awareness.
|
|
5
|
-
* Objects with lower opacity will have reduced contribution to the normal and depth buffers.
|
|
6
|
-
*/
|
|
7
|
-
export declare class TransparencyAwareNormalPass extends Pass {
|
|
8
|
-
private _scene;
|
|
9
|
-
private _camera;
|
|
10
|
-
private _renderTarget;
|
|
11
|
-
private _resolution;
|
|
12
|
-
private _depthTexture;
|
|
13
|
-
private _originalMaterials;
|
|
14
|
-
constructor(scene: Scene, camera: Camera, { renderTarget, resolutionScale, width, height, resolutionX, resolutionY, }?: {
|
|
15
|
-
renderTarget?: WebGLRenderTarget;
|
|
16
|
-
resolutionScale?: number;
|
|
17
|
-
resolutionX?: number;
|
|
18
|
-
resolutionY?: number;
|
|
19
|
-
width?: number;
|
|
20
|
-
height?: number;
|
|
21
|
-
});
|
|
22
|
-
set mainScene(value: Scene);
|
|
23
|
-
set mainCamera(value: Camera);
|
|
24
|
-
get texture(): Texture | undefined;
|
|
25
|
-
get depthTexture(): DepthTexture | undefined;
|
|
26
|
-
get resolution(): Resolution;
|
|
27
|
-
private createTransparencyAwareNormalMaterial;
|
|
28
|
-
render(renderer: WebGLRenderer): void;
|
|
29
|
-
setSize(width: number, height: number): void;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=TransparencyAwareNormalPass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransparencyAwareNormalPass.d.ts","sourceRoot":"","sources":["../../../../src/managers/postprocessing/utils/TransparencyAwareNormalPass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACN,MAAM,EAGN,YAAY,EAKZ,KAAK,EACL,OAAO,EAGP,aAAa,EACb,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,IAAI;IACpD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,kBAAkB,CAA+C;gBAGxE,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,EACC,YAAY,EACZ,eAAqB,EACrB,KAA4B,EAC5B,MAA6B,EAC7B,WAAmB,EACnB,WAAoB,GACpB,GAAE;QACF,YAAY,CAAC,EAAE,iBAAiB,CAAC;QACjC,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACX;IAqCP,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,EAEzB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED,IAAI,OAAO,IAAI,OAAO,GAAG,SAAS,CAEjC;IAED,IAAI,YAAY,IAAI,YAAY,GAAG,SAAS,CAE3C;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,OAAO,CAAC,qCAAqC;IA0C7C,MAAM,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAkCrC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAK5C"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransparencyAwareNormalPass = void 0;
|
|
4
|
-
const postprocessing_1 = require("postprocessing");
|
|
5
|
-
const three_1 = require("three");
|
|
6
|
-
/**
|
|
7
|
-
* A pass that renders normals and depth with transparency awareness.
|
|
8
|
-
* Objects with lower opacity will have reduced contribution to the normal and depth buffers.
|
|
9
|
-
*/
|
|
10
|
-
class TransparencyAwareNormalPass extends postprocessing_1.Pass {
|
|
11
|
-
constructor(scene, camera, { renderTarget, resolutionScale = 1.0, width = postprocessing_1.Resolution.AUTO_SIZE, height = postprocessing_1.Resolution.AUTO_SIZE, resolutionX = width, resolutionY = height, } = {}) {
|
|
12
|
-
super("TransparencyAwareNormalPass");
|
|
13
|
-
this._originalMaterials = new Map();
|
|
14
|
-
this.needsSwap = false;
|
|
15
|
-
this._scene = scene;
|
|
16
|
-
this._camera = camera;
|
|
17
|
-
this._renderTarget = renderTarget || new three_1.WebGLRenderTarget(1, 1, {
|
|
18
|
-
minFilter: three_1.NearestFilter,
|
|
19
|
-
magFilter: three_1.NearestFilter,
|
|
20
|
-
});
|
|
21
|
-
this._renderTarget.texture.name = "TransparencyAwareNormalPass.Target";
|
|
22
|
-
this._depthTexture = new three_1.DepthTexture(1, 1);
|
|
23
|
-
this._renderTarget.depthTexture = this._depthTexture;
|
|
24
|
-
this._renderTarget.dispose();
|
|
25
|
-
if (this._renderTarget.stencilBuffer) {
|
|
26
|
-
this._depthTexture.format = three_1.DepthStencilFormat;
|
|
27
|
-
this._depthTexture.type = three_1.UnsignedInt248Type;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this._depthTexture.type = three_1.UnsignedIntType;
|
|
31
|
-
}
|
|
32
|
-
this._resolution = new postprocessing_1.Resolution(this, resolutionX, resolutionY, resolutionScale);
|
|
33
|
-
this._resolution.addEventListener("change", (e) => this.setSize(this._resolution.baseWidth, this._resolution.baseHeight));
|
|
34
|
-
}
|
|
35
|
-
set mainScene(value) {
|
|
36
|
-
this._scene = value;
|
|
37
|
-
}
|
|
38
|
-
set mainCamera(value) {
|
|
39
|
-
this._camera = value;
|
|
40
|
-
}
|
|
41
|
-
get texture() {
|
|
42
|
-
var _a;
|
|
43
|
-
return (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.texture;
|
|
44
|
-
}
|
|
45
|
-
get depthTexture() {
|
|
46
|
-
var _a;
|
|
47
|
-
return (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.depthTexture;
|
|
48
|
-
}
|
|
49
|
-
get resolution() {
|
|
50
|
-
return this._resolution;
|
|
51
|
-
}
|
|
52
|
-
createTransparencyAwareNormalMaterial(originalMaterial) {
|
|
53
|
-
let materialOpacity = 1.0;
|
|
54
|
-
let isTransparent = false;
|
|
55
|
-
// Extract opacity and transparency from the original material
|
|
56
|
-
if (Array.isArray(originalMaterial)) {
|
|
57
|
-
const materialWithOpacity = originalMaterial.find((mat) => "opacity" in mat && typeof mat.opacity === "number");
|
|
58
|
-
if (materialWithOpacity) {
|
|
59
|
-
materialOpacity = materialWithOpacity.opacity;
|
|
60
|
-
isTransparent = materialWithOpacity.transparent || materialOpacity < 1.0;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else if ("opacity" in originalMaterial && typeof originalMaterial.opacity === "number") {
|
|
64
|
-
materialOpacity = originalMaterial.opacity;
|
|
65
|
-
isTransparent = originalMaterial.transparent || materialOpacity < 1.0;
|
|
66
|
-
}
|
|
67
|
-
// If the material is not transparent or has full opacity, treat it as opaque
|
|
68
|
-
if (!isTransparent || materialOpacity >= 1.0) {
|
|
69
|
-
materialOpacity = 1.0;
|
|
70
|
-
}
|
|
71
|
-
// Create a normal material that considers opacity
|
|
72
|
-
const normalMaterial = new three_1.MeshNormalMaterial();
|
|
73
|
-
normalMaterial.side = originalMaterial.side || 2; // DoubleSide by default
|
|
74
|
-
normalMaterial.userData.materialOpacity = { value: materialOpacity };
|
|
75
|
-
normalMaterial.onBeforeCompile = (shader) => {
|
|
76
|
-
shader.uniforms.materialOpacity = normalMaterial.userData.materialOpacity;
|
|
77
|
-
shader.fragmentShader = /* glsl */ `
|
|
78
|
-
uniform float materialOpacity;
|
|
79
|
-
${shader.fragmentShader.replace("gl_FragColor = vec4( packNormalToRGB( normal ), opacity );", "gl_FragColor = vec4( packNormalToRGB( normal ), opacity * materialOpacity );")}
|
|
80
|
-
`;
|
|
81
|
-
};
|
|
82
|
-
return normalMaterial;
|
|
83
|
-
}
|
|
84
|
-
render(renderer) {
|
|
85
|
-
// Store original materials and apply transparency-aware normal materials
|
|
86
|
-
this._originalMaterials.clear();
|
|
87
|
-
this._scene.traverse((object) => {
|
|
88
|
-
if (object instanceof three_1.Mesh && object.material) {
|
|
89
|
-
this._originalMaterials.set(object, object.material);
|
|
90
|
-
object.material = this.createTransparencyAwareNormalMaterial(object.material);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
// Store original background and clear settings
|
|
94
|
-
const originalBackground = this._scene.background;
|
|
95
|
-
const originalClearAlpha = renderer.getClearAlpha();
|
|
96
|
-
// Configure for normal rendering
|
|
97
|
-
this._scene.background = new three_1.Color(0x7777ff); // Background color for normals
|
|
98
|
-
renderer.setClearAlpha(1.0);
|
|
99
|
-
// Render to target
|
|
100
|
-
renderer.setRenderTarget(this._renderTarget);
|
|
101
|
-
renderer.render(this._scene, this._camera);
|
|
102
|
-
// Restore original materials
|
|
103
|
-
this._originalMaterials.forEach((originalMaterial, mesh) => {
|
|
104
|
-
mesh.material = originalMaterial;
|
|
105
|
-
});
|
|
106
|
-
this._originalMaterials.clear();
|
|
107
|
-
// Restore original settings
|
|
108
|
-
renderer.setRenderTarget(null);
|
|
109
|
-
renderer.setClearAlpha(originalClearAlpha);
|
|
110
|
-
this._scene.background = originalBackground;
|
|
111
|
-
}
|
|
112
|
-
setSize(width, height) {
|
|
113
|
-
var _a;
|
|
114
|
-
const resolution = this._resolution;
|
|
115
|
-
resolution.setBaseSize(width, height);
|
|
116
|
-
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.setSize(resolution.width, resolution.height);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.TransparencyAwareNormalPass = TransparencyAwareNormalPass;
|
|
120
|
-
//# sourceMappingURL=TransparencyAwareNormalPass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransparencyAwareNormal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ataManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeJsDataManager.d.ts","sourceRoot":"","sources":["../../../src/managers/sceneTree/ThreeJsDataManager.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeJsDataManager.js","sourceRoot":"","sources":["../../../src/managers/sceneTree/ThreeJsDataManager.ts"],"names":[],"mappings":""}
|