three-base 2.0.134 → 2.0.142
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/DirectionalLight.d.ts +6 -6
- package/DirectionalLight.js +68 -68
- package/DirectionalLight.ts +70 -0
- package/EventMap.d.ts +103 -0
- package/EventMap.js +17 -0
- package/EventMap.ts +139 -0
- package/EventMesh.d.ts +18 -18
- package/EventMesh.js +59 -59
- package/EventMesh.ts +60 -0
- package/ExtrudeMesh.d.ts +112 -112
- package/ExtrudeMesh.js +342 -366
- package/ExtrudeMesh.ts +553 -0
- package/FPScontrol.d.ts +511 -71
- package/FPScontrol.js +1799 -505
- package/FPScontrol.ts +1855 -0
- package/Fire/Fire.d.ts +28 -28
- package/Fire/Fire.js +80 -79
- package/Fire/Fire.ts +89 -0
- package/Fire/{FireGromtry.d.ts → FireGeometry.d.ts} +9 -9
- package/Fire/{FireGromtry.js → FireGeometry.js} +40 -40
- package/Fire/FireGeometry.ts +40 -0
- package/Fire/FireMaterial.d.ts +28 -28
- package/Fire/FireMaterial.js +32 -32
- package/Fire/FireMaterial.ts +89 -0
- package/Fire/index.d.ts +2 -1
- package/Fire/index.js +2 -1
- package/Fire/index.ts +2 -0
- package/GLTFDracoLoader.d.ts +71 -0
- package/GLTFDracoLoader.js +266 -0
- package/GLTFDracoLoader.ts +430 -0
- package/Grass/Grass.d.ts +8 -8
- package/Grass/Grass.js +38 -38
- package/Grass/Grass.ts +38 -0
- package/Grass/index.d.ts +2 -1
- package/Grass/index.js +2 -1
- package/Grass/index.ts +2 -0
- package/Ground1/Ground1.d.ts +10 -11
- package/Ground1/Ground1.js +95 -91
- package/Ground1/Ground1.ts +114 -0
- package/Ground1/index.d.ts +1 -1
- package/Ground1/index.js +1 -1
- package/Ground1/index.ts +1 -0
- package/MeshBase.d.ts +36 -35
- package/MeshBase.js +247 -223
- package/MeshBase.ts +253 -0
- package/Mirror.d.ts +25 -25
- package/Mirror.js +143 -139
- package/Mirror.ts +203 -0
- package/MktMesh/MktMesh.d.ts +291 -0
- package/MktMesh/MktMesh.js +1045 -0
- package/MktMesh/MktMesh.ts +1075 -0
- package/MktMesh/assetUrl.d.ts +35 -0
- package/MktMesh/assetUrl.js +69 -0
- package/MktMesh/assetUrl.ts +69 -0
- package/MktMesh/mktMappingShader.d.ts +12 -0
- package/MktMesh/mktMappingShader.js +139 -0
- package/MktMesh/mktMappingShader.ts +139 -0
- package/MktMesh/mktShader.d.ts +263 -0
- package/MktMesh/mktShader.js +1248 -0
- package/MktMesh/mktShader.ts +1344 -0
- package/MktMesh/panoBitmapTexture.d.ts +25 -0
- package/MktMesh/panoBitmapTexture.js +52 -0
- package/MktMesh/panoBitmapTexture.ts +54 -0
- package/MktMesh/panoSlotBind.d.ts +29 -0
- package/MktMesh/panoSlotBind.js +106 -0
- package/MktMesh/panoSlotBind.ts +153 -0
- package/MktMesh/panoSlotRoster.d.ts +22 -0
- package/MktMesh/panoSlotRoster.js +169 -0
- package/MktMesh/panoSlotRoster.ts +168 -0
- package/MktMesh/panoTileStitcher.d.ts +119 -0
- package/MktMesh/panoTileStitcher.js +533 -0
- package/MktMesh/panoTileStitcher.ts +616 -0
- package/MktMesh/types.d.ts +75 -0
- package/MktMesh/types.js +1 -0
- package/MktMesh/types.ts +87 -0
- package/MktMesh/wallCapTessellate.d.ts +33 -0
- package/MktMesh/wallCapTessellate.js +97 -0
- package/MktMesh/wallCapTessellate.ts +68 -0
- package/PipeMesh/PathGeometry.d.ts +44 -44
- package/PipeMesh/PathGeometry.js +307 -300
- package/PipeMesh/PathGeometry.ts +343 -0
- package/PipeMesh/PathPoint.d.ts +17 -17
- package/PipeMesh/PathPoint.js +31 -31
- package/PipeMesh/PathPoint.ts +36 -0
- package/PipeMesh/PathPointList.d.ts +31 -31
- package/PipeMesh/PathPointList.js +209 -208
- package/PipeMesh/PathPointList.ts +227 -0
- package/PipeMesh/PathTubeGeometry.d.ts +25 -25
- package/PipeMesh/PathTubeGeometry.js +130 -130
- package/PipeMesh/PathTubeGeometry.ts +146 -0
- package/PipeMesh/PipeMesh.d.ts +25 -25
- package/PipeMesh/PipeMesh.js +63 -63
- package/PipeMesh/PipeMesh.ts +76 -0
- package/PipeMesh/index.d.ts +1 -1
- package/PipeMesh/index.js +1 -1
- package/PipeMesh/index.ts +1 -0
- package/PlaneModal1/PlaneModal1.d.ts +34 -31
- package/PlaneModal1/PlaneModal1.js +109 -105
- package/PlaneModal1/PlaneModal1.ts +138 -0
- package/PlaneModal1/index.d.ts +1 -1
- package/PlaneModal1/index.js +1 -1
- package/PlaneModal1/index.ts +1 -0
- package/PlaneText.d.ts +27 -39
- package/PlaneText.js +35 -30
- package/PlaneText.ts +55 -0
- package/PlaneWithHtml.d.ts +13 -11
- package/PlaneWithHtml.js +64 -63
- package/PlaneWithHtml.ts +70 -0
- package/PointLight/PointLight.d.ts +13 -14
- package/PointLight/PointLight.js +64 -70
- package/PointLight/PointLight.ts +67 -0
- package/PointLight/index.d.ts +1 -1
- package/PointLight/index.js +1 -1
- package/PointLight/index.ts +1 -0
- package/README.md +110 -79
- package/Sky/Sky.d.ts +9 -9
- package/Sky/Sky.js +22 -22
- package/Sky/Sky.ts +22 -0
- package/Sky/index.d.ts +1 -1
- package/Sky/index.js +1 -1
- package/Sky/index.ts +1 -0
- package/SpotLight.d.ts +6 -6
- package/SpotLight.js +72 -72
- package/SpotLight.ts +74 -0
- package/SpriteModal1/SpriteModal1.d.ts +33 -30
- package/SpriteModal1/SpriteModal1.js +116 -110
- package/SpriteModal1/SpriteModal1.ts +146 -0
- package/SpriteModal1/index.d.ts +1 -1
- package/SpriteModal1/index.js +1 -1
- package/SpriteModal1/index.ts +1 -0
- package/SpriteText.d.ts +46 -45
- package/SpriteText.js +176 -163
- package/SpriteText.ts +205 -0
- package/SpriteText2.d.ts +48 -47
- package/SpriteText2.js +223 -198
- package/SpriteText2.ts +258 -0
- package/SpriteText3.d.ts +86 -0
- package/SpriteText3.js +519 -0
- package/SpriteText3.ts +599 -0
- package/SpriteWithHtml.d.ts +9 -7
- package/SpriteWithHtml.js +44 -44
- package/SpriteWithHtml.ts +50 -0
- package/Text3D/Text3D.d.ts +20 -20
- package/Text3D/Text3D.js +58 -62
- package/Text3D/Text3D.ts +77 -0
- package/Text3D/fontController.d.ts +60 -59
- package/Text3D/fontController.js +166 -199
- package/Text3D/fontController.ts +209 -0
- package/Text3D/index.d.ts +1 -1
- package/Text3D/index.js +1 -1
- package/Text3D/index.ts +1 -0
- package/ThreeBase.d.ts +248 -97
- package/ThreeBase.js +1202 -613
- package/ThreeBase.ts +1314 -0
- package/ThreeMouse.d.ts +54 -40
- package/ThreeMouse.js +453 -407
- package/ThreeMouse.ts +472 -0
- package/Transition.d.ts +45 -40
- package/Transition.js +209 -210
- package/Transition.ts +242 -0
- package/Water/Water.d.ts +5 -5
- package/Water/Water.js +44 -26
- package/Water/Water.ts +45 -0
- package/Water/index.d.ts +2 -0
- package/Water/index.js +2 -0
- package/Water/index.ts +2 -0
- package/WaterFlow/FloatingDuck.d.ts +88 -0
- package/WaterFlow/FloatingDuck.js +307 -0
- package/WaterFlow/FloatingDuck.ts +445 -0
- package/WaterFlow/GPUFluidSimulation.d.ts +56 -0
- package/WaterFlow/GPUFluidSimulation.js +785 -0
- package/WaterFlow/GPUFluidSimulation.ts +827 -0
- package/WaterFlow/ReservoirSystem.d.ts +106 -0
- package/WaterFlow/ReservoirSystem.js +621 -0
- package/WaterFlow/ReservoirSystem.ts +754 -0
- package/WaterFlow/SPHField.d.ts +35 -0
- package/WaterFlow/SPHField.js +204 -0
- package/WaterFlow/SPHField.ts +228 -0
- package/WaterFlow/ScreenSpaceFluidPass.d.ts +69 -0
- package/WaterFlow/ScreenSpaceFluidPass.js +736 -0
- package/WaterFlow/ScreenSpaceFluidPass.ts +789 -0
- package/WaterFlow/ShallowWaterSurface.d.ts +45 -0
- package/WaterFlow/ShallowWaterSurface.js +441 -0
- package/WaterFlow/ShallowWaterSurface.ts +510 -0
- package/WaterFlow/WaterFlow.d.ts +87 -0
- package/WaterFlow/WaterFlow.js +171 -0
- package/WaterFlow/WaterFlow.ts +219 -0
- package/WaterFlow/types.d.ts +161 -0
- package/WaterFlow/types.js +1 -0
- package/WaterFlow/types.ts +189 -0
- package/WaterFlow/waterFlowPass.d.ts +3 -0
- package/WaterFlow/waterFlowPass.js +20 -0
- package/WaterFlow/waterFlowPass.ts +40 -0
- package/collisionOBB.d.ts +42 -0
- package/collisionOBB.js +112 -0
- package/collisionOBB.ts +108 -0
- package/declare.d.ts +23 -165
- package/index.d.ts +1 -1
- package/index.js +1 -2
- package/index.ts +1 -0
- package/instanced/InstancedBatch.d.ts +57 -0
- package/instanced/InstancedBatch.js +348 -0
- package/instanced/InstancedBatch.ts +406 -0
- package/instanced/InstancedChild.d.ts +174 -0
- package/instanced/InstancedChild.js +264 -0
- package/instanced/InstancedChild.ts +327 -0
- package/instanced/InstancedGroup.d.ts +43 -0
- package/instanced/InstancedGroup.js +126 -0
- package/instanced/InstancedGroup.ts +137 -0
- package/{InstancedMeshBase.d.ts → instanced/InstancedMeshBase.d.ts} +38 -39
- package/{InstancedMeshBase.js → instanced/InstancedMeshBase.js} +282 -293
- package/instanced/InstancedMeshBase.ts +292 -0
- package/instanced/InstancedTemplate.d.ts +46 -0
- package/instanced/InstancedTemplate.js +125 -0
- package/instanced/InstancedTemplate.ts +188 -0
- package/keyControls.d.ts +30 -0
- package/{keyContorls.js → keyControls.js} +101 -98
- package/keyControls.ts +107 -0
- package/lensflare/LensFlare.d.ts +39 -0
- package/lensflare/LensFlare.js +373 -0
- package/lensflare/LensFlare.ts +448 -0
- package/lensflare/lensflare0.png +0 -0
- package/lensflare/lensflare3.png +0 -0
- package/lensflare/lensflare_custom.png +0 -0
- package/lensflare/lensflare_hex_ghost.png +0 -0
- package/lensflare/lensflare_hex_main.png +0 -0
- package/package.json +101 -26
- package/pass/bloom_pass.d.ts +2 -2
- package/pass/bloom_pass.js +188 -101
- package/pass/bloom_pass.ts +243 -0
- package/pass/cover_pass.d.ts +2 -2
- package/pass/cover_pass.js +122 -99
- package/pass/cover_pass.ts +182 -0
- package/pass/debugDepthState.d.ts +20 -0
- package/pass/debugDepthState.js +9 -0
- package/pass/debugDepthState.ts +22 -0
- package/pass/depthTestBias.d.ts +12 -0
- package/pass/depthTestBias.js +12 -0
- package/pass/depthTestBias.ts +12 -0
- package/pass/effectUserData.d.ts +27 -0
- package/pass/effectUserData.js +1 -0
- package/pass/effectUserData.ts +46 -0
- package/pass/frosted_glass_pass.d.ts +2 -2
- package/pass/frosted_glass_pass.js +167 -186
- package/pass/frosted_glass_pass.ts +288 -0
- package/pass/fsQuad.d.ts +9 -9
- package/pass/fsQuad.js +28 -28
- package/pass/fsQuad.ts +34 -0
- package/pass/glow_pass.d.ts +2 -2
- package/pass/glow_pass.js +449 -233
- package/pass/glow_pass.ts +654 -0
- package/pass/screen_bloom_pass.d.ts +11 -0
- package/pass/screen_bloom_pass.js +235 -0
- package/pass/screen_bloom_pass.ts +263 -0
- package/pass/ssao_pass.d.ts +88 -11
- package/pass/ssao_pass.js +802 -288
- package/pass/ssao_pass.ts +918 -0
- package/pass/stroke_pass.d.ts +2 -2
- package/pass/stroke_pass.js +329 -258
- package/pass/stroke_pass.ts +638 -0
- package/shaders/FXAAShaderMaterial.d.ts +3 -3
- package/shaders/FXAAShaderMaterial.js +23 -66
- package/shaders/FXAAShaderMaterial.ts +201 -0
- package/shaders/baseDepthVisShader.d.ts +11 -0
- package/shaders/baseDepthVisShader.js +36 -0
- package/shaders/baseDepthVisShader.ts +36 -0
- package/shaders/baseTextureToRenderShader.d.ts +2 -2
- package/shaders/baseTextureToRenderShader.js +55 -60
- package/shaders/baseTextureToRenderShader.ts +232 -0
- package/shaders/copyShader.d.ts +3 -3
- package/shaders/copyShader.js +13 -14
- package/shaders/copyShader.ts +32 -0
- package/shaders/debugDepthCompareShader.d.ts +14 -0
- package/shaders/debugDepthCompareShader.js +49 -0
- package/shaders/debugDepthCompareShader.ts +50 -0
- package/shaders/debugDepthJudgeShader.d.ts +18 -0
- package/shaders/debugDepthJudgeShader.js +52 -0
- package/shaders/debugDepthJudgeShader.ts +54 -0
- package/shaders/debugExcludedShader.d.ts +13 -0
- package/shaders/debugExcludedShader.js +46 -0
- package/shaders/debugExcludedShader.ts +48 -0
- package/spriteTextBg.d.ts +1 -0
- package/spriteTextBg.js +20 -0
- package/spriteTextBg.ts +20 -0
- package/threeLoader.d.ts +35 -34
- package/threeLoader.js +518 -527
- package/threeLoader.ts +525 -0
- package/threeUtils.d.ts +53 -52
- package/threeUtils.js +329 -330
- package/threeUtils.ts +373 -0
- package/types.d.ts +2 -0
- package/types.js +6 -0
- package/types.ts +8 -0
- package/ApngTexture.d.ts +0 -13
- package/ApngTexture.js +0 -61
- package/ApngTextureManage.d.ts +0 -18
- package/ApngTextureManage.js +0 -87
- package/KeyFrameAnimation.d.ts +0 -25
- package/KeyFrameAnimation.js +0 -78
- package/keyContorls.d.ts +0 -25
- package/lib/draco/draco_decoder.js +0 -34
- package/lib/draco/draco_decoder.wasm +0 -0
- package/lib/draco/draco_wasm_wrapper.js +0 -117
- package/shaders.d.ts +0 -5
- package/shaders.js +0 -93
package/ThreeBase.d.ts
CHANGED
|
@@ -1,97 +1,248 @@
|
|
|
1
|
-
import { AxesHelper, DepthTexture, EventDispatcher, GridHelper, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Texture, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
import { AxesHelper, DepthTexture, EventDispatcher, GridHelper, MeshNormalMaterial, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Texture, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
2
|
+
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
|
3
|
+
import ThreeMouse from "./ThreeMouse";
|
|
4
|
+
import InstancedGroup from "./instanced/InstancedGroup";
|
|
5
|
+
import Transition from "./Transition";
|
|
6
|
+
import { type DebugDepthMode } from "./pass/debugDepthState";
|
|
7
|
+
import { WaterFlow } from "./WaterFlow/WaterFlow";
|
|
8
|
+
import type { ThreeBaseEventTypeMap } from "./EventMap";
|
|
9
|
+
type CameraType = "perspectiveCamera" | "orthographicCamera";
|
|
10
|
+
type ControlType = "OrbitControls" | "MapControls";
|
|
11
|
+
interface SSAOConfig {
|
|
12
|
+
enable: boolean;
|
|
13
|
+
debug: boolean;
|
|
14
|
+
radius: number;
|
|
15
|
+
falloff: number;
|
|
16
|
+
bias: number;
|
|
17
|
+
/** AO 叠加强度:finalOcclusion = mix(1.0, ao, intensity)。0 = 不叠加,1 = 原始强度,>1 外插加深。默认 1.0 */
|
|
18
|
+
intensity: number;
|
|
19
|
+
sampleCount: number;
|
|
20
|
+
/** 去噪(模糊)最大采样半径,单位 = 像素,默认 4。1 = 几乎不去噪 */
|
|
21
|
+
blurRadius: number;
|
|
22
|
+
/** 与 intensity 同义的备用名,两者都设时以 strength 为准 */
|
|
23
|
+
strength: number;
|
|
24
|
+
/** SSAO 计算分辨率缩放比例,默认 0.5(半分辨率计算,性能更好) */
|
|
25
|
+
resolutionScale?: number;
|
|
26
|
+
/** GTAO 地平线积分:采样点沿半径分布的幂次,默认 1.0 */
|
|
27
|
+
distanceExponent?: number;
|
|
28
|
+
/** GTAO 地平线积分:距离衰减混合系数,默认 1.0 */
|
|
29
|
+
distanceFallOff?: number;
|
|
30
|
+
/** AO 次幂(gamma 校正),默认 1.0 */
|
|
31
|
+
scale?: number;
|
|
32
|
+
}
|
|
33
|
+
interface BloomConfig {
|
|
34
|
+
enable: boolean;
|
|
35
|
+
/** 辉光强度,默认 0.6 */
|
|
36
|
+
strength: number;
|
|
37
|
+
/** 辉光半径,默认 0.4 */
|
|
38
|
+
radius: number;
|
|
39
|
+
/** 亮度阈值(高于该值的像素才参与辉光),默认 0.85 */
|
|
40
|
+
threshold: number;
|
|
41
|
+
}
|
|
42
|
+
export default class ThreeBase extends EventDispatcher<ThreeBaseEventTypeMap> {
|
|
43
|
+
constructor();
|
|
44
|
+
minDevicePixelRatio: number;
|
|
45
|
+
maxPixelRatio: number;
|
|
46
|
+
renderScale: number;
|
|
47
|
+
private _resolution;
|
|
48
|
+
get resolution(): number;
|
|
49
|
+
set resolution(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* 终处理抖动强度(消除 8bit 输出量化的色带,见 baseTextureToRenderShader)。
|
|
52
|
+
* 1.0 = 标准 ±0.5 LSB(默认,肉眼无感但能打散色带);0 = 完全关闭。
|
|
53
|
+
* ⚠️ 若某处柔和渐变(外辉光/天空)看着"发脏/有颗粒",先把它设 0 做 A/B 对比:
|
|
54
|
+
* 0 时若色带回来,说明抖动是必需的,应调小到 0.5 而不是关掉。
|
|
55
|
+
*/
|
|
56
|
+
get ditherStrength(): number;
|
|
57
|
+
set ditherStrength(value: number);
|
|
58
|
+
/**
|
|
59
|
+
* 渲染目标(RT)底层配置(运行时可调,改即重建 base / screen 两个主颜色 RT)。
|
|
60
|
+
* 皇上要的「RT 上面的配置」= type / format / colorSpace / filter;
|
|
61
|
+
* 默认与原始硬编码一致(HalfFloatType + RGBAFormat + 线性 NoColorSpace + Linear 滤波)。
|
|
62
|
+
* 调这些能直观复现/消除典型问题:
|
|
63
|
+
* - type=UnsignedByteType(8bit 线性):柔和渐变被压成 3~6 色阶 → 同心环色带(banding)
|
|
64
|
+
* - colorSpace=SRGBColorSpace:RT 已按 sRGB 编码 + 终处理再编一次 → 双重编码发白
|
|
65
|
+
* - filter=NearestFilter:颜色插值变最近邻 → 边缘像素化/糊
|
|
66
|
+
*/
|
|
67
|
+
private _rtOptions;
|
|
68
|
+
/** 面板/代码里的字符串名 → THREE 常量(单一映射点,避免散落硬编码数字) */
|
|
69
|
+
private static rtNameToConstant;
|
|
70
|
+
/**
|
|
71
|
+
* 运行时改 RT 底层配置:更新 _rtOptions 后重建 base / screen 两个主颜色 RT(保留当前尺寸)。
|
|
72
|
+
* 必须在已布局(size>0)后才重建;否则等下次 setSize 自然带新选项。
|
|
73
|
+
* 仅重建主颜色 RT(base/screen);深度/法线/aoDepth 是辅助通道,其 type 由对应 depthTexture 决定,
|
|
74
|
+
* 不在面板暴露,避免破坏深度比对 / SSAO 深度黑。
|
|
75
|
+
*/
|
|
76
|
+
applyRenderTargetOption(key: "type" | "colorSpace" | "format" | "filter", name: string): void;
|
|
77
|
+
private rebuildRenderTargets;
|
|
78
|
+
effectMaxPixelRatio: number;
|
|
79
|
+
get effectiveRatio(): number;
|
|
80
|
+
baseDepthTexture: DepthTexture;
|
|
81
|
+
baseRenderTarget: WebGLRenderTarget<Texture>;
|
|
82
|
+
/** 可选的屏幕空间水流对象(WaterFlow)。默认 null;调用 enableWaterFlow() 后创建。启用时
|
|
83
|
+
* 每帧消费 baseRenderTarget/baseDepthTexture,把水面合成进后处理链(不额外渲染主场景)。 */
|
|
84
|
+
waterFlow: WaterFlow | null;
|
|
85
|
+
private _waterFlowLastTime;
|
|
86
|
+
waterFlowElapsed: number;
|
|
87
|
+
excludedMaskRenderTarget: WebGLRenderTarget<Texture>;
|
|
88
|
+
depthRenderTarget: WebGLRenderTarget<Texture>;
|
|
89
|
+
aoDepthTexture: DepthTexture;
|
|
90
|
+
/**
|
|
91
|
+
* 调试用:深度预览模式。由面板「深度调试」切换,便于逐一看各深度图排查"深度测试全部失效"根因。
|
|
92
|
+
* - "none" :正常渲染(默认)
|
|
93
|
+
* - "global" :仅预览全局深度图(baseDepthTexture,排除地板)。全白=深度为空→renderAoDepthPass 没写进深度。
|
|
94
|
+
* - "ao" :仅预览 AO 深度图(aoDepthTexture = 法线 pass 顺带写入的含地板深度)。用于确认深度管线本身是否工作。
|
|
95
|
+
* - "compare" :R=全局 base 深度,G=最近一次 glow/stroke 选区 select 深度。两路任一全白即该侧写入失败。
|
|
96
|
+
* - "excluded":深度图灰度 + 「被排除出深度图的面」叠红(红=该面写不进深度,永远挡不住后处理)。
|
|
97
|
+
* 物体区域(G 暗)若 B 全黑 → 判定从不触发;再看该区 R/G 谁大即可定位是谁缺深度。
|
|
98
|
+
* 兼容旧控制台入口:设置 `window.__BASE_DEPTH_VIS = true` 等价于切到 "global"。
|
|
99
|
+
* 通用控制台入口:任意页面都可 `window.__TB_DEBUG_DEPTH = "judge"`(优先级高于面板属性)。
|
|
100
|
+
*/
|
|
101
|
+
debugDepthPreview: DebugDepthMode;
|
|
102
|
+
/**
|
|
103
|
+
* 可见深度图是否包含「标了 userData.aoFloor 的地板」(如 Ground1)。
|
|
104
|
+
*
|
|
105
|
+
* 默认 false —— 原设计:地板可透视,透过地板看到的物体照常显示(不被地板挡住)。
|
|
106
|
+
* 置 true 后地板会写进 baseDepthTexture,**被地板挡住的描边/辉光/毛玻璃/覆盖色会被正确遮挡**。
|
|
107
|
+
* 排查"怎么都挡不住"时先开这个试一下:若开了就正常,说明挡你的正是可透视地板。
|
|
108
|
+
*/
|
|
109
|
+
get baseDepthIncludeFloor(): boolean;
|
|
110
|
+
set baseDepthIncludeFloor(v: boolean);
|
|
111
|
+
normalRenderTarget: WebGLRenderTarget<Texture>;
|
|
112
|
+
screenRenderTarget: WebGLRenderTarget<Texture>;
|
|
113
|
+
screenCopyShader: import("three").ShaderMaterial;
|
|
114
|
+
normalMaterial: MeshNormalMaterial;
|
|
115
|
+
renderTarget: WebGLRenderTarget<Texture>;
|
|
116
|
+
renderTarget2: WebGLRenderTarget<Texture>;
|
|
117
|
+
tempVector2: Vector2;
|
|
118
|
+
tempVector3: Vector3;
|
|
119
|
+
size: Vector2;
|
|
120
|
+
rendererLost: boolean;
|
|
121
|
+
renderer: WebGLRenderer;
|
|
122
|
+
perspectiveCamera: PerspectiveCamera;
|
|
123
|
+
orthographicCamera: OrthographicCamera;
|
|
124
|
+
cameraType: CameraType;
|
|
125
|
+
setCameraType(cameraType: CameraType): void;
|
|
126
|
+
getCamera(): PerspectiveCamera | OrthographicCamera;
|
|
127
|
+
scene: Scene;
|
|
128
|
+
add(...object: Object3D[]): this;
|
|
129
|
+
threeMouse: ThreeMouse;
|
|
130
|
+
controls: OrbitControls;
|
|
131
|
+
private _lastControlsTime;
|
|
132
|
+
instancedGroup: InstancedGroup;
|
|
133
|
+
/**
|
|
134
|
+
* 自定义描边目标:不在 scene 内的独立对象(如 InstancedChild 的"选择代理"),
|
|
135
|
+
* 渲染循环在效果阶段单独对其调用 stroke_pass,使其获得与普通 Mesh 一致的描边,
|
|
136
|
+
* 且不会被正常 base pass 重复绘制(因为它不在 scene 树内)。
|
|
137
|
+
* 典型用途:InstancedChild / 一组 InstancedChild 没有自身几何,无法直接描边,
|
|
138
|
+
* 用 buildSelectProxy 重建其几何代理后再注册到这里即可。
|
|
139
|
+
*/
|
|
140
|
+
private _strokeObjects;
|
|
141
|
+
/** 注册一个自定义描边对象(效果阶段对其描边) */
|
|
142
|
+
addStrokeObject(object: Object3D): this;
|
|
143
|
+
/** 移除自定义描边对象 */
|
|
144
|
+
removeStrokeObject(object: Object3D): this;
|
|
145
|
+
setContainer(div: HTMLDivElement | null): Promise<void>;
|
|
146
|
+
setSize(width: number, height: number): void;
|
|
147
|
+
/**
|
|
148
|
+
* 按「容器尺寸 × effectiveRatio × resolution」重建所有渲染目标尺寸。
|
|
149
|
+
* 由 setSize()(容器尺寸变化)与 resolution setter(运行时调倍率)共用 ——
|
|
150
|
+
* 关键:resolution 是运行时可调的性能/质量旋钮,改完必须立刻重建 RT,
|
|
151
|
+
* 否则倍率变了而 RT 尺寸没变,画面毫无变化(历史坑:"调分辨率没感觉")。
|
|
152
|
+
*/
|
|
153
|
+
private updateRenderTargetSizes;
|
|
154
|
+
controlsDistanceTransition: Transition<{
|
|
155
|
+
distance: number;
|
|
156
|
+
}, "distance">;
|
|
157
|
+
controlsYTransition: Transition<{
|
|
158
|
+
y: number;
|
|
159
|
+
}, "y">;
|
|
160
|
+
controlsXZTransition: Transition<{
|
|
161
|
+
x: number;
|
|
162
|
+
z: number;
|
|
163
|
+
}, "x" | "z">;
|
|
164
|
+
controlsCenter: Transition<{
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
z: number;
|
|
168
|
+
}, "x" | "y" | "z">;
|
|
169
|
+
controlsPosition: Transition<{
|
|
170
|
+
x: number;
|
|
171
|
+
y: number;
|
|
172
|
+
z: number;
|
|
173
|
+
}, "x" | "y" | "z">;
|
|
174
|
+
gridHelper: GridHelper;
|
|
175
|
+
axesHelper: AxesHelper;
|
|
176
|
+
init(): void;
|
|
177
|
+
/**
|
|
178
|
+
* 启用屏幕空间水流(GPGPU 粒子流体)。默认关闭,需显式调用或携带 ?waterflow=1。
|
|
179
|
+
* 创建后每帧自动消费 base 深度 + 当前合成画面,把水面合成进后处理链,不自渲染主场景。
|
|
180
|
+
* @param options.size 粒子网格边长(size×size 粒子),越大越细腻、越费
|
|
181
|
+
* @param options.speed 射流初速
|
|
182
|
+
* @param options.aperture 喷嘴开度
|
|
183
|
+
* @param options.nozzle 喷流起点坐标 [x,y,z],默认 [0.58,1.55,0]
|
|
184
|
+
* @param options.jetDirection 喷流方向(轴向,会被归一化),默认 [1,0,0](沿 +X)
|
|
185
|
+
* @param options.collision 是否开启粒子与 basin/地面碰撞回弹,默认 true
|
|
186
|
+
*/
|
|
187
|
+
enableWaterFlow(options?: {
|
|
188
|
+
size?: number;
|
|
189
|
+
speed?: number;
|
|
190
|
+
aperture?: number;
|
|
191
|
+
nozzle?: [number, number, number];
|
|
192
|
+
jetDirection?: [number, number, number];
|
|
193
|
+
collision?: boolean;
|
|
194
|
+
}): void;
|
|
195
|
+
/** 运行时改喷流起点(喷嘴)坐标(WaterFlow 已启用时有效) */
|
|
196
|
+
setWaterFlowNozzle(x: number, y: number, z: number): void;
|
|
197
|
+
/** 运行时改喷流方向(轴向,会被归一化) */
|
|
198
|
+
setWaterFlowJetDirection(x: number, y: number, z: number): void;
|
|
199
|
+
/** 运行时开关粒子与 basin/地面碰撞回弹 */
|
|
200
|
+
setWaterFlowCollision(enabled: boolean): void;
|
|
201
|
+
/**
|
|
202
|
+
* 关闭屏幕空间水流并释放其 GPU 资源(enableWaterFlow 的反操作)。
|
|
203
|
+
* 切走页面时必须调用,否则其它页面 render 仍会合成水面(this.waterFlow 非空)。
|
|
204
|
+
*/
|
|
205
|
+
disableWaterFlow(): void;
|
|
206
|
+
resetLookAt({ position, center, }: {
|
|
207
|
+
position: Vector3;
|
|
208
|
+
center: Vector3;
|
|
209
|
+
}): void;
|
|
210
|
+
setLookAt({ position, center, duration, }: {
|
|
211
|
+
position: Vector3;
|
|
212
|
+
center: Vector3;
|
|
213
|
+
duration?: number;
|
|
214
|
+
}): Promise<void>;
|
|
215
|
+
getLookAt(): {
|
|
216
|
+
center: Vector3;
|
|
217
|
+
position: Vector3;
|
|
218
|
+
centerPosition: string;
|
|
219
|
+
};
|
|
220
|
+
lookatObjects({ objects, duration, direction, offset, distance, }: {
|
|
221
|
+
objects: Array<Object3D>;
|
|
222
|
+
duration?: number;
|
|
223
|
+
direction?: Vector3;
|
|
224
|
+
offset?: Vector3;
|
|
225
|
+
distance?: number;
|
|
226
|
+
}): void;
|
|
227
|
+
v3tov2(v3: Vector3): Vector2;
|
|
228
|
+
controlType: ControlType;
|
|
229
|
+
originScreenSpacePanning: boolean;
|
|
230
|
+
setControlType(controlType: ControlType): void;
|
|
231
|
+
autoRender: boolean;
|
|
232
|
+
needRender: boolean;
|
|
233
|
+
ssao: SSAOConfig;
|
|
234
|
+
bloom: BloomConfig;
|
|
235
|
+
stopRender(): void;
|
|
236
|
+
dispose(): void;
|
|
237
|
+
/** 释放单个材质及其引用的纹理(遍历材质属性找 Texture 并 dispose) */
|
|
238
|
+
private _disposeMaterial;
|
|
239
|
+
render(): void;
|
|
240
|
+
private renderBindThis;
|
|
241
|
+
getThumbBlob(): Promise<Blob>;
|
|
242
|
+
getThumbBase64(): string;
|
|
243
|
+
getThumbFile(): Promise<File>;
|
|
244
|
+
download(fileName?: string): Promise<void>;
|
|
245
|
+
renderRendererTarget(renderTarget: WebGLRenderTarget): void;
|
|
246
|
+
renderTexture(texture: Texture, alpha?: boolean): void;
|
|
247
|
+
}
|
|
248
|
+
export {};
|