u-space 0.0.18 → 0.0.19

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.
@@ -1,6 +1,6 @@
1
1
  # atmosphere
2
2
 
3
- 天空和大气渲染插件,基于 `@takram/three-atmosphere` 的 WebGPU 节点实现。启用后会接入 Viewer 的 `renderer.contextNode`、`scene.backgroundNode` 和 RenderPipeline 的 output effect/MRT 扩展点,提供天空背景、太阳光、aerial perspective 大气透视、lens flare、tone mapping 和 temporal antialias。
3
+ 天空和大气渲染插件,基于 `@takram/three-atmosphere` 的 WebGPU 节点实现。启用后会接入 Viewer 的 `renderer.contextNode`、`scene.backgroundNode` 和 RenderPipeline 的 output effect/MRT 扩展点,提供天空背景、太阳/月亮方向、aerial perspective 大气透视、lens flare、tone mapping、temporal antialias 和大气方向光阴影。
4
4
 
5
5
  ```typescript
6
6
  import { Atmosphere } from 'u-space/plugins/atmosphere';
@@ -13,6 +13,14 @@ atmosphere.enable({
13
13
  });
14
14
  ```
15
15
 
16
+ ## 能力
17
+
18
+ - 使用经纬高将本地场景原点映射到 WGS84/ECEF,用 `date` 计算太阳和月亮方向。
19
+ - 写入 `scene.backgroundNode`,可选写入 `scene.environmentNode`,让天空背景和环境光保持一致。
20
+ - 通过 RenderPipeline output effect 追加大气透视、lens flare、tone mapping、temporal antialias 和 dithering,不占用业务侧的 `setOutputComposer()`。
21
+ - 开启 `temporalAntialias` 时注册独立的 `atmosphereVelocity` MRT 通道,并避免和 RenderPipeline 自带 TRAA 重复运行。
22
+ - 创建 `AtmosphereLight` 作为太阳方向光,并在每帧跟随相机控制器 target 更新阴影目标。
23
+
16
24
  ## API
17
25
 
18
26
  ### `new Atmosphere(viewer)`
@@ -99,4 +107,6 @@ atmosphere.update({
99
107
 
100
108
  `Atmosphere` 不会占用 `viewer.renderPipeline.setOutputComposer()`。它通过 output effect 追加大气后处理;开启 `temporalAntialias` 时才会注册独立的 `atmosphereVelocity` MRT 通道,并会避免和 RenderPipeline 自带 TRAA 重复运行。业务设置自定义 composer 时,大气 output effect 和它的输出变换开关都会被 RenderPipeline 跳过,让 composer 保持完整接管输出的原语义。
101
109
 
110
+ 插件会在 `beforeRender` 中刷新相机 ECEF 位置、太阳/月亮方向和阴影 target,因此相机移动时的大气状态会跟随每一帧更新。`setDate()` 只更新传入的时间,不会自动推进时钟;需要动态昼夜变化时,由业务侧定时调用 `setDate()` 或 `update({ date })`。
111
+
102
112
  如果看到明显的方形阴影边界,通常是 `shadowCameraSize` 小于当前可见场景范围。可以调大该值,或让相机 target 更贴近需要观察的区域。阴影偏糊时优先减小 `shadowCameraSize` 或增大 `shadowMapSize`;底部阴影有脱离感时优先减小 `shadowNormalBias`;边缘仍有轻微锯齿时可略微增大 `shadowRadius`。
package/docs/changelog.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # 更新日志
2
2
 
3
+ ## 0.0.18
4
+
5
+ ### 变更
6
+
7
+ - **版本发布** — 同步发布包含新版大气插件实现、RenderPipeline output effects 和一键 MCP 发布脚本的 npm 包。
8
+
9
+ ## 0.0.17
10
+
11
+ ### 新增
12
+
13
+ - **atmosphere 插件** — `Atmosphere.enable(options)` 从占位实现升级为可用的大气渲染:支持 WGS84 经纬高定位、太阳/月亮方向、天空背景、天空环境、aerial perspective、lens flare、tone mapping、temporal antialias、dithering 和 `AtmosphereLight` 阴影。
14
+ - **RenderPipeline** — 新增 `addOutputEffect()` / `removeOutputEffect()` 与 `addMRTChannel()` / `removeMRTChannel()`,插件可追加输出后处理和独立 MRT 通道,不再占用业务侧 `setOutputComposer()`。
15
+
16
+ ### 变更
17
+
18
+ - **大气状态更新** — 大气插件在 `beforeRender` 中刷新相机 ECEF 位置、太阳/月亮方向和阴影 target,相机控制器驱动的移动也能逐帧更新大气状态。
19
+ - **MCP 发布** — 根目录 MCP 发布入口合并为 `pnpm publish:mcp`,命令会先构建 `u-space-mcp` 文档索引,再发布 npm 包。
20
+
3
21
  ## 0.0.16
4
22
 
5
23
  ### 新增
package/docs/index.md CHANGED
@@ -55,7 +55,7 @@ features:
55
55
  | [u-manager](./api-plugin-u-manager) | 场景加载、语义楼层、拓扑、动画、属性、视点管理 |
56
56
  | [curve-movement](./api-plugin-curve-movement) | 沿样条曲线移动相机或对象 |
57
57
  | [tracking-controls](./api-plugin-tracking-controls) | 相机跟随移动目标 |
58
- | [atmosphere](./api-plugin-atmosphere) | 天空/大气渲染(开发中) |
58
+ | [atmosphere](./api-plugin-atmosphere) | 天空背景、大气透视、太阳/月亮光照与阴影 |
59
59
  | [object-controls](./api-plugin-object-controls) | 交互式移动、旋转、缩放 3D 对象 |
60
60
  | [topology-drawer](./api-plugin-topology-drawer) | 在场景任意表面交互式绘制拓扑路径图 |
61
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-space",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "module": "dist/index.js",