@ericchen1990/pano-view 3.3.0 → 3.4.1
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/README.md +30 -6
- package/README.zh-CN.md +9 -3
- package/dist/index.cjs +1267 -904
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +995 -632
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -703,10 +703,13 @@ a single non-stereo cube panorama.
|
|
|
703
703
|
## Scenes
|
|
704
704
|
|
|
705
705
|
`Scenes` switches controlled sphere, cube-tile, and equirectangular-tile scenes with GPU-only
|
|
706
|
-
snapshot blending. The
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
706
|
+
snapshot blending. The incoming scene stays hidden while it preloads its preview and base
|
|
707
|
+
tiles. Once that preview can be drawn, the current framebuffer becomes a temporary GPU
|
|
708
|
+
texture and the outgoing source textures are released. The incoming scene then switches to
|
|
709
|
+
full detail immediately: tiles that are already sharp replace the preview during the blend,
|
|
710
|
+
and tiles that are still loading keep the coarser parent tile or the preview. The viewer
|
|
711
|
+
does not keep two high-resolution tile sets resident, and it does not preload tiles outside
|
|
712
|
+
the current view.
|
|
710
713
|
|
|
711
714
|
```tsx
|
|
712
715
|
import {
|
|
@@ -749,7 +752,25 @@ GPU framebuffer snapshot over the incoming panorama; they do not mix two full
|
|
|
749
752
|
360 textures. Pass `{ preset: "crossfade", duration: 0.6 }` to override a
|
|
750
753
|
preset duration.
|
|
751
754
|
|
|
752
|
-
|
|
755
|
+
`transitionWaitForDetailMs` defaults to `0`. The blend starts as soon as the incoming
|
|
756
|
+
scene can paint, and detail keeps loading during that blend. A positive value such as
|
|
757
|
+
`200` starts only after the outgoing snapshot is stored and the incoming scene is in
|
|
758
|
+
`full`. The blend starts early when the current view is already sharp, and otherwise
|
|
759
|
+
waits at most that many milliseconds. This wait is timed separately from the blend
|
|
760
|
+
duration. During the wait the outgoing snapshot stays fully visible while the incoming
|
|
761
|
+
scene draws and uploads underneath. For a normal `Sphere`, sharp means the full image
|
|
762
|
+
can be drawn. For cube and sphere tiles, sharp means every in-view tile at the level
|
|
763
|
+
chosen from viewport size, device pixel ratio, field of view, and the existing memory
|
|
764
|
+
budget can be drawn. Tiles outside the view are not required. Negative and non-finite
|
|
765
|
+
values are treated as `0`. `transition="none"` uses the same condition and then cuts
|
|
766
|
+
over directly. A new target, an interrupt, unmount, or a lost WebGL context cancels a
|
|
767
|
+
pending wait so a stale readiness report cannot affect the next scene.
|
|
768
|
+
|
|
769
|
+
`onReady` still means a source can paint for the first time. `onSceneReady` still fires
|
|
770
|
+
for the first paintable scene and when an incoming scene takes over after the outgoing
|
|
771
|
+
snapshot. It does not mean the current view's full detail has finished loading.
|
|
772
|
+
|
|
773
|
+
While a detail wait or transition runs, panorama drag/zoom input is locked and
|
|
753
774
|
`renderHotspots` is hidden. New `activeSceneId` values supersede a target that
|
|
754
775
|
is still being prepared. `maxTextureMemoryMb` and `maxConcurrentTileLoads`
|
|
755
776
|
apply to the whole `Scenes` viewer rather than to each tile scene.
|
|
@@ -1860,7 +1881,10 @@ const scenes: Scene[] = [
|
|
|
1860
1881
|
`onSceneReady(sceneId)` fires when the first scene becomes paintable and when an
|
|
1861
1882
|
incoming scene takes over after the outgoing snapshot is captured. The transition
|
|
1862
1883
|
may still be running; use this callback to apply the incoming camera view without
|
|
1863
|
-
changing the outgoing snapshot.
|
|
1884
|
+
changing the outgoing snapshot. Full detail loads after that handoff, including during
|
|
1885
|
+
the blend. `transitionWaitForDetailMs` can hold the outgoing snapshot until the current
|
|
1886
|
+
view is sharp; it does not change when `onSceneReady` fires. `onTransitionEnd` marks
|
|
1887
|
+
completion of the blend.
|
|
1864
1888
|
|
|
1865
1889
|
`SphereTileScene` accepts the source options of `SphereTile`, including
|
|
1866
1890
|
`indexBase`, `resolveTileUrl`, and `yawOffset`. `Scenes` owns visibility,
|
package/README.zh-CN.md
CHANGED
|
@@ -637,7 +637,7 @@ MAKE PANO (MULTIRES) 文件夹布局常为 `tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg`,
|
|
|
637
637
|
|
|
638
638
|
## Scenes
|
|
639
639
|
|
|
640
|
-
`Scenes` 在受控的普通球面、立方体瓦片与球面多级瓦片场景之间切换,采用纯 GPU
|
|
640
|
+
`Scenes` 在受控的普通球面、立方体瓦片与球面多级瓦片场景之间切换,采用纯 GPU 快照混合。目标场景在隐藏状态下预加载预览和基础层。预览可绘制后,当前帧缓冲成为临时 GPU 纹理,并释放旧场景的源纹理。目标随即进入 `full`:转场期间已经清晰的瓦片立刻盖住预览,尚未就绪的区域继续显示父层瓦片或预览。查看器不会同时保留两套高清瓦片,也不会预加载当前视野之外的瓦片。
|
|
641
641
|
|
|
642
642
|
```tsx
|
|
643
643
|
import {
|
|
@@ -671,7 +671,11 @@ const scenes: Scene[] = [
|
|
|
671
671
|
|
|
672
672
|
可用的 KRpano 风格预设包括 `none`、`crossfade`、`zoom`、`blackout`、`whiteFlash`、`slideRightToLeft`、`slideTopToBottom`、`slideDiagonal`、`circleOpen`、`verticalOpen`、`horizontalOpen`、`ellipticZoomOpen`。网格类预设为 `pixelate`、`gridWipe`、`gridWipeUp`、`gridWipeRight`、`gridWipeDiagonal`、`gridWipeCenter`、`gridWipeChecker`、`hexDissolve`。电影感预设为 `dissolve`、`shatter`、`particles`、`glitch`、`swirl`、`clockWipe`、`ripple`、`zoomBlur`、`filmBurn`。它们均在入画全景之上混合 GPU 帧缓冲快照,不会混合两个完整 360 纹理。传 `{ preset: "crossfade", duration: 0.6 }` 可覆盖预设时长。
|
|
673
673
|
|
|
674
|
-
|
|
674
|
+
`transitionWaitForDetailMs` 默认为 `0`:目标一旦可绘制就开始转场,高清在转场期间继续加载。正数(例如 `200`)从旧画面快照完成、目标进入 `full` 之后开始计时;当前视野已经清晰就提前转场,否则最多再等待指定毫秒。该等待与转场动画时长分开计算。等待期间完整显示旧快照,目标在其下正常绘制并上传纹理。普通球面的“清晰”指完整图片可绘制;立方体和球面瓦片指按视口尺寸、设备像素比、FOV 和现有内存预算选出的当前视野目标层级全部可绘制,不要求视野外瓦片。负值或非有限值按 `0` 处理。`transition="none"` 使用同一条件,满足后直接切换。新的目标、中断、卸载或 WebGL 上下文丢失会取消尚未结束的等待,避免过期的就绪通知影响下一个场景。
|
|
675
|
+
|
|
676
|
+
`onReady` 仍表示源第一次可绘制。`onSceneReady` 仍在首个场景可绘制,或旧画面快照完成且新场景接管时触发,并不表示当前视野的高清已经到齐。
|
|
677
|
+
|
|
678
|
+
清晰等待或转场进行时,全景拖拽/缩放输入被锁定,`renderHotspots` 被隐藏。新的 `activeSceneId` 会取代仍在准备中的目标。`maxTextureMemoryMb` 与 `maxConcurrentTileLoads` 作用于整个 `Scenes` 查看器,而非每个 tile 场景单独计算。
|
|
675
679
|
|
|
676
680
|
## PanoFilter
|
|
677
681
|
|
|
@@ -1553,7 +1557,9 @@ const scenes: Scene[] = [
|
|
|
1553
1557
|
```
|
|
1554
1558
|
|
|
1555
1559
|
`onSceneReady(sceneId)` 在首个场景可绘制、或旧画面截图完成且新场景接管时触发。
|
|
1556
|
-
|
|
1560
|
+
此时过渡可能仍在进行,可在该回调中设置新场景视角而不改变旧画面快照。
|
|
1561
|
+
高清在这次交接之后加载,转场期间也会继续加载。`transitionWaitForDetailMs`
|
|
1562
|
+
可以让旧快照多停留到当前视野清晰,但不会改变 `onSceneReady` 的触发时机。
|
|
1557
1563
|
`onTransitionEnd` 表示混合效果播放完成。
|
|
1558
1564
|
|
|
1559
1565
|
`SphereTileScene` 保留 `SphereTile` 的资源选项,包括 `indexBase`、`resolveTileUrl`
|