endset_three_editor 0.10.35 → 0.10.36
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/three/index.d.ts
CHANGED
|
@@ -8,24 +8,31 @@ import { ScriptItem } from './scriptStore';
|
|
|
8
8
|
*/
|
|
9
9
|
import * as THREE from "three";
|
|
10
10
|
/**
|
|
11
|
-
* 水体(Water.js 水体 /
|
|
11
|
+
* 水体(Water.js 水体 / 标准材质水面)在透明队列中的绘制顺序(1 = 最后绘制)。
|
|
12
12
|
*
|
|
13
13
|
* three 渲染器对透明物体按「groupOrder → renderOrder → 相机距离(z 大者先画)」排序,
|
|
14
14
|
* 默认所有物体 renderOrder = 0:此时半透明模型(例如透明度 0.7 的外墙)与水体的
|
|
15
15
|
* 先后完全取决于二者"物体原点"的相机距离。像墙体这种"几何很大、原点却偏离几何中心"
|
|
16
16
|
* 的对象,距离排序会随相机移动而翻转 → 水体随视角时隐时现。
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* ⚠️ 两个半透明面在屏幕上重叠时,像素只能"二选一"(谁后绘制谁就盖在对方之上,
|
|
19
|
+
* 这是光栅化 alpha 混合的固有取舍),两种取值各有利弊:
|
|
20
|
+
*
|
|
21
|
+
* 1(水体最后绘制,当前取值)="水体优先":
|
|
22
|
+
* 水体保持自身 alpha,看起来清晰完整;
|
|
23
|
+
* 代价:与水体重叠的半透明模型会被水体的 alpha 压低
|
|
24
|
+
* (墙的权重 ≈ 0.7 × (1 - 水体覆盖率),水体叠两层时约 0.34,叠一层约 0.49)。
|
|
25
|
+
*
|
|
26
|
+
* -1(水体最先绘制)="模型优先":
|
|
27
|
+
* 半透明模型保持自身 alpha,墙在重叠 / 不重叠处观感一致(都是 0.7);
|
|
28
|
+
* 代价:水体像素被模型的 alpha 盖住,重叠处水体会明显变淡甚至看不见
|
|
29
|
+
* (墙 0.7 时水体只剩 0.3 × 0.3 ≈ 9%)。
|
|
23
30
|
*
|
|
24
31
|
* 注意:
|
|
25
32
|
* - 只影响透明队列内部的先后,不改变不透明物体的遮挡关系(不透明物体先绘制);
|
|
26
|
-
* -
|
|
33
|
+
* - 半透明材质统一不写深度,因此不会出现"谁把谁按深度剔除、整块消失"。
|
|
27
34
|
*/
|
|
28
|
-
export declare const WATER_RENDER_ORDER =
|
|
35
|
+
export declare const WATER_RENDER_ORDER = 1;
|
|
29
36
|
/**
|
|
30
37
|
* 初始化编辑器,挂载到指定 DOM 容器
|
|
31
38
|
* @param container - 编辑器挂载的 DOM 元素
|