@realsee/five 6.8.0-alpha.5 → 6.8.0-alpha.7
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 +2 -5
- package/ai_guides/README.md +5 -0
- package/ai_guides/api.md +13 -0
- package/ai_guides/features/flowing-light-2d-pass.md +218 -0
- package/ai_guides/features/flowing-light-3d-pass.md +240 -0
- package/ai_guides/features/gaussian-blur-pass.md +202 -0
- package/ai_guides/features/load-external-model.md +16 -0
- package/ai_guides/features/load-progress.md +140 -0
- package/ai_guides/features/parameter.md +7 -0
- package/ai_guides/features/postprocessing.md +35 -2
- package/ai_guides/features/raycast.md +9 -0
- package/ai_guides/features/view-layer.md +8 -3
- package/ai_guides/features/work.md +17 -0
- package/ai_guides/glossary.md +17 -0
- package/ai_guides/release_notes/6.8.md +81 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/five.BoundingMesh.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +71 -71
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +31 -31
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGSObject.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3D.html +30 -26
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Trajectory.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +27 -2
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/README.html +5 -0
- package/docs/documents/api.html +28 -3
- package/docs/documents/features_flowing-light-2d-pass.html +124 -0
- package/docs/documents/features_flowing-light-3d-pass.html +129 -0
- package/docs/documents/features_gaussian-blur-pass.html +182 -0
- package/docs/documents/features_load-external-model.html +19 -2
- package/docs/documents/features_load-progress.html +110 -0
- package/docs/documents/features_parameter.html +7 -0
- package/docs/documents/features_postprocessing.html +17 -3
- package/docs/documents/features_raycast.html +1 -1
- package/docs/documents/features_view-layer.html +9 -3
- package/docs/documents/features_work.html +1 -1
- package/docs/documents/glossary.html +21 -1
- package/docs/documents/release_notes_6.8.html +92 -0
- package/docs/functions/five.loadAt3d.html +1 -1
- package/docs/functions/five.loadB3dm.html +1 -1
- package/docs/functions/five.loadDome.html +1 -1
- package/docs/functions/five.loadDomez.html +1 -1
- package/docs/functions/five.loadFbx.html +1 -1
- package/docs/functions/five.loadGltf.html +1 -1
- package/docs/functions/five.loadPbm.html +1 -1
- package/docs/functions/five.loadPly.html +1 -1
- package/docs/functions/five.loadPnts.html +1 -1
- package/docs/functions/five.loadSplat.html +1 -1
- package/docs/functions/five.loadSpz.html +1 -1
- package/docs/functions/five.loadX3p.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/vue.useFiveWorks.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +5 -0
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +2 -2
- package/docs/interfaces/five.EventCallback.html +15 -11
- package/docs/interfaces/five.GestureEvent.html +2 -2
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +2 -2
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +4 -3
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.ModeChangeEvent.html +2 -2
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +2 -2
- package/docs/interfaces/five.ModelSceneEvent.html +2 -2
- package/docs/interfaces/five.ModelTileEvent.html +8 -0
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +2 -2
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +2 -2
- package/docs/interfaces/five.PanoTextureEvent.html +2 -2
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +2 -2
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +2 -2
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +30 -26
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkModel.html +8 -8
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +27 -2
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +2 -2
- package/docs/interfaces/five.XRControllerEvent.html +2 -2
- package/docs/interfaces/five.XRGestureEvent.html +2 -2
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +2 -2
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
- package/docs/modules/five.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/five.EventTypes.html +12 -10
- package/docs/types/five.NetworkProgressCallback.html +1 -1
- package/docs/types/five.ParseOptions.html +6 -6
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/five/application/events.d.ts +5 -1
- package/five/declare.d.ts +2 -1
- package/five/index.d.ts +1 -1
- package/five/index.js +429 -73
- package/five/index.mjs +5385 -4485
- package/five/model/intersection.d.ts +2 -0
- package/five/model/loaders/at3d.d.ts +1 -0
- package/five/model/loaders/b3dm.d.ts +1 -0
- package/five/model/loaders/dome.d.ts +1 -0
- package/five/model/loaders/domez.d.ts +1 -0
- package/five/model/loaders/fbx.d.ts +1 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/index.d.ts +4 -0
- package/five/model/loaders/gltf.d.ts +1 -0
- package/five/model/loaders/obj.d.ts +1 -0
- package/five/model/loaders/pbm.d.ts +1 -0
- package/five/model/loaders/ply.d.ts +1 -0
- package/five/model/loaders/pnts.d.ts +1 -0
- package/five/model/loaders/splat.d.ts +1 -0
- package/five/model/loaders/spz.d.ts +1 -0
- package/five/model/loaders/x3p.d.ts +1 -0
- package/five/model/model.d.ts +26 -1
- package/five/model/tile3d/index.d.ts +5 -1
- package/five/model/tile3d/tile.d.ts +1 -0
- package/five/model/tile3d/trajectory.d.ts +1 -0
- package/five/model/view-layer.d.ts +1 -2
- package/five/renderer/postprocessing/index.d.ts +2 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +22 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +22 -0
- package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +1 -0
- package/five/utils/ajax.d.ts +1 -1
- package/five/utils/event.d.ts +6 -0
- package/five/work/work.d.ts +35 -2
- package/five/work/workObserverUtils.d.ts +36 -0
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/llms.txt +5 -0
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +429 -73
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/docs/documents/api.html
CHANGED
|
@@ -153,7 +153,17 @@
|
|
|
153
153
|
<li><strong>raycaster</strong>: <code>THREE.Raycaster</code>.</li>
|
|
154
154
|
<li><strong>returns</strong>: <code>THREE.Intersection[]</code>.</li>
|
|
155
155
|
</ul>
|
|
156
|
-
<h3 id="-10" class="tsd-anchor-link"><code>
|
|
156
|
+
<h3 id="-10" class="tsd-anchor-link"><code>addPass(pass)</code><a href="#-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
157
|
+
<p>Add a post-processing pass to the rendering chain.</p>
|
|
158
|
+
<ul>
|
|
159
|
+
<li><strong>pass</strong>: <code>FivePass</code> instance (e.g. <code>Gaussian Blur Pass</code>).</li>
|
|
160
|
+
</ul>
|
|
161
|
+
<h3 id="-11" class="tsd-anchor-link"><code>removePass(pass)</code><a href="#-11" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
162
|
+
<p>Remove a post-processing pass from the rendering chain.</p>
|
|
163
|
+
<ul>
|
|
164
|
+
<li><strong>pass</strong>: <code>FivePass</code> instance to remove.</li>
|
|
165
|
+
</ul>
|
|
166
|
+
<h3 id="-12" class="tsd-anchor-link"><code>dispose()</code><a href="#-12" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
157
167
|
<p>Destroys the Five instance and releases resources.</p>
|
|
158
168
|
<h2 id="state-management" class="tsd-anchor-link">State Management<a href="#state-management" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
159
169
|
<p>The <code>State</code> interface defines the complete status of the Five instance at any moment.</p>
|
|
@@ -161,7 +171,7 @@
|
|
|
161
171
|
</code><button type="button">Copy</button></pre>
|
|
162
172
|
|
|
163
173
|
<h2 id="data-structures" class="tsd-anchor-link">Data Structures<a href="#data-structures" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
164
|
-
<h3 id="-
|
|
174
|
+
<h3 id="-13" class="tsd-anchor-link"><code>Work</code><a href="#-13" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
165
175
|
<p>The main data object containing the scene description.</p>
|
|
166
176
|
<pre><code class="typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-7">Work</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">workCode</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">; </span><span class="hl-8">// Unique identifier</span><br/><span class="hl-1"> </span><span class="hl-6">name</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1">; </span><span class="hl-8">// Project name</span><br/><span class="hl-1"> </span><span class="hl-6">observers</span><span class="hl-1">: </span><span class="hl-7">WorkObserver</span><span class="hl-1">[]; </span><span class="hl-8">// List of panorama points</span><br/><span class="hl-1"> </span><span class="hl-6">model</span><span class="hl-1">: </span><span class="hl-7">WorkModel</span><span class="hl-1">; </span><span class="hl-8">// 3D model data</span><br/><span class="hl-1"> </span><span class="hl-6">initial</span><span class="hl-1">: </span><span class="hl-7">WorkInitial</span><span class="hl-1">; </span><span class="hl-8">// Initial view state</span><br/><span class="hl-1"> </span><span class="hl-6">transform</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Matrix4</span><span class="hl-1">; </span><span class="hl-8">// World transform matrix</span><br/><span class="hl-1">}</span>
|
|
167
177
|
</code><button type="button">Copy</button></pre>
|
|
@@ -256,11 +266,26 @@
|
|
|
256
266
|
<td style="text-align:left"><code>ModelSceneEvent</code></td>
|
|
257
267
|
</tr>
|
|
258
268
|
<tr>
|
|
269
|
+
<td style="text-align:left"><code>model.tileLoad</code></td>
|
|
270
|
+
<td style="text-align:left">Triggered when a 3D tile is loaded.</td>
|
|
271
|
+
<td style="text-align:left"><code>Tile</code></td>
|
|
272
|
+
</tr>
|
|
273
|
+
<tr>
|
|
274
|
+
<td style="text-align:left"><code>model.tileUnload</code></td>
|
|
275
|
+
<td style="text-align:left">Triggered when a 3D tile is unloaded.</td>
|
|
276
|
+
<td style="text-align:left"><code>Tile</code></td>
|
|
277
|
+
</tr>
|
|
278
|
+
<tr>
|
|
259
279
|
<td style="text-align:left"><code>pano.arrived</code></td>
|
|
260
280
|
<td style="text-align:left">Triggered when arrival at a panorama node.</td>
|
|
261
281
|
<td style="text-align:left"><code>PanoEvent</code></td>
|
|
262
282
|
</tr>
|
|
263
283
|
<tr>
|
|
284
|
+
<td style="text-align:left"><code>pano.texture.progress</code></td>
|
|
285
|
+
<td style="text-align:left">Triggered when panorama texture loading progresses.</td>
|
|
286
|
+
<td style="text-align:left"><code>{ progress, panoIndex }</code></td>
|
|
287
|
+
</tr>
|
|
288
|
+
<tr>
|
|
264
289
|
<td style="text-align:left"><code>render</code></td>
|
|
265
290
|
<td style="text-align:left">Triggered after each render frame.</td>
|
|
266
291
|
<td style="text-align:left"><code>RenderEvent</code></td>
|
|
@@ -309,4 +334,4 @@
|
|
|
309
334
|
<pre><code class="typescript"><span class="hl-8">// Recommended: Use the new event system</span><br/><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-5">on</span><span class="hl-1">(</span><span class="hl-9">'gesture.tap'</span><span class="hl-1">, (</span><span class="hl-6">event</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-9">'User tapped at:'</span><span class="hl-1">, </span><span class="hl-6">event</span><span class="hl-1">);</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-8">// Legacy (Avoid):</span><br/><span class="hl-8">// five.on('wantsTapGesture', (raycaster) => { ... });</span>
|
|
310
335
|
</code><button type="button">Copy</button></pre>
|
|
311
336
|
|
|
312
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#five-sdk-api-reference"><span>Five <wbr/>SDK <wbr/>API <wbr/>Reference</span></a><ul><li><a href="#core-class"><span>Core <wbr/>Class: </span></a></li><li><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><a href="#static-properties"><span>Static <wbr/>Properties</span></a></li></ul></li><li><a href="#initialization-configuration-"><span>Initialization <wbr/>Configuration ()</span></a></li><li><a href="#core-methods"><span>Core <wbr/>Methods</span></a></li><li><ul><li><a href="#"><span></span></a></li><li><a href="#-1"><span></span></a></li><li><a href="#-2"><span></span></a></li><li><a href="#-3"><span></span></a></li><li><a href="#-4"><span></span></a></li><li><a href="#-5"><span></span></a></li><li><a href="#-6"><span></span></a></li><li><a href="#-7"><span></span></a></li><li><a href="#-8"><span></span></a></li><li><a href="#-9"><span></span></a></li><li><a href="#-10"><span></span></a></li></ul></li><li><a href="#state-management"><span>State <wbr/>Management</span></a></li><li><a href="#data-structures"><span>Data <wbr/>Structures</span></a></li><li><ul><li><a href="#-
|
|
337
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#five-sdk-api-reference"><span>Five <wbr/>SDK <wbr/>API <wbr/>Reference</span></a><ul><li><a href="#core-class"><span>Core <wbr/>Class: </span></a></li><li><ul><li><a href="#constructor"><span>Constructor</span></a></li><li><a href="#properties"><span>Properties</span></a></li><li><a href="#static-properties"><span>Static <wbr/>Properties</span></a></li></ul></li><li><a href="#initialization-configuration-"><span>Initialization <wbr/>Configuration ()</span></a></li><li><a href="#core-methods"><span>Core <wbr/>Methods</span></a></li><li><ul><li><a href="#"><span></span></a></li><li><a href="#-1"><span></span></a></li><li><a href="#-2"><span></span></a></li><li><a href="#-3"><span></span></a></li><li><a href="#-4"><span></span></a></li><li><a href="#-5"><span></span></a></li><li><a href="#-6"><span></span></a></li><li><a href="#-7"><span></span></a></li><li><a href="#-8"><span></span></a></li><li><a href="#-9"><span></span></a></li><li><a href="#-10"><span></span></a></li><li><a href="#-11"><span></span></a></li><li><a href="#-12"><span></span></a></li></ul></li><li><a href="#state-management"><span>State <wbr/>Management</span></a></li><li><a href="#data-structures"><span>Data <wbr/>Structures</span></a></li><li><ul><li><a href="#-13"><span></span></a></li><li><a href="#panorama-point"><span> (<wbr/>Panorama <wbr/>Point)</span></a></li></ul></li><li><a href="#events"><span>Events</span></a></li><li><ul><li><a href="#recommended-events-modern"><span>Recommended <wbr/>Events (<wbr/>Modern)</span></a></li><li><ul><li><a href="#interaction-gestures"><span>Interaction & <wbr/>Gestures</span></a></li><li><a href="#state-mode"><span>State & <wbr/>Mode</span></a></li><li><a href="#lifecycle-resources"><span>Lifecycle & <wbr/>Resources</span></a></li></ul></li><li><a href="#legacy-events-deprecated"><span>Legacy <wbr/>Events (<wbr/>Deprecated)</span></a></li><li><a href="#usage-example"><span>Usage <wbr/>Example</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">如视 Five SDK</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>features/flowing-light-2d-pass | 如视 Five SDK</title><meta name="description" content="Documentation for 如视 Five SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">如视 Five SDK</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">features/flowing-light-2d-pass</a></li></ul></div><div class="tsd-panel tsd-typography"><h1 id="flowing-light-2d-pass-流光-2d-通道" class="tsd-anchor-link">Flowing Light 2D Pass (流光 2D 通道)<a href="#flowing-light-2d-pass-流光-2d-通道" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1>
|
|
2
|
+
<ul>
|
|
3
|
+
<li><strong>Summary</strong>: <code>FlowingLight2DPass</code> 提供屏幕空间的流光(光带)特效,沿着 2D 路径点绘制动态光流,适用于突出导航路径、指示线或动态路径演示。</li>
|
|
4
|
+
<li><strong>Schema</strong>: <code>FlowingLight2DPass</code> 类及 Line 数据结构。</li>
|
|
5
|
+
<li><strong>Concepts</strong>: 后处理通道、屏幕空间光带、路径数据驱动、时间动画。</li>
|
|
6
|
+
<li><strong>Configuration</strong>: 路径点集合、颜色、不透明度、动画时长。</li>
|
|
7
|
+
<li><strong>Examples</strong>: 基础集成、多条路径、动态更新。</li>
|
|
8
|
+
</ul>
|
|
9
|
+
<h2 id="schema" class="tsd-anchor-link">Schema<a href="#schema" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
10
|
+
<blockquote>
|
|
11
|
+
<p><strong>Definition</strong>: <a href="../../five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts">FlowingLight2DPass</a></p>
|
|
12
|
+
</blockquote>
|
|
13
|
+
<p><code>FlowingLight2DPass</code> 是 <code>FivePass</code> 的子类,核心接口如下:</p>
|
|
14
|
+
<pre><code class="ts"><span class="hl-10">import</span><span class="hl-1"> </span><span class="hl-3">*</span><span class="hl-1"> </span><span class="hl-10">as</span><span class="hl-1"> </span><span class="hl-6">THREE</span><span class="hl-1"> </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'three'</span><span class="hl-1">;</span><br/><span class="hl-10">import</span><span class="hl-1"> { </span><span class="hl-6">FivePass</span><span class="hl-1"> } </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'./pass'</span><span class="hl-1">;</span><br/><span class="hl-10">import</span><span class="hl-1"> { </span><span class="hl-10">type</span><span class="hl-1"> </span><span class="hl-6">Camera</span><span class="hl-1"> } </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'../../../core/camera'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">type</span><span class="hl-1"> </span><span class="hl-7">Line</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-6">points</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">[]; </span><span class="hl-8">// 屏幕空间路径点 [x, y]</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// 路径总长度(像素)</span><br/><span class="hl-1"> </span><span class="hl-6">color</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Color</span><span class="hl-1">; </span><span class="hl-8">// 光带颜色</span><br/><span class="hl-1"> </span><span class="hl-6">opacity</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// 光带不透明度(0-1)</span><br/><span class="hl-1"> </span><span class="hl-6">duration</span><span class="hl-1">?: </span><span class="hl-7">number</span><span class="hl-1">; </span><span class="hl-8">// 动画时长(毫秒)</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-10">export</span><span class="hl-1"> </span><span class="hl-3">class</span><span class="hl-1"> </span><span class="hl-7">FlowingLight2DPass</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-7">FivePass</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">constructor</span><span class="hl-1">(</span><span class="hl-6">camera</span><span class="hl-1">: </span><span class="hl-7">Camera</span><span class="hl-1">);</span><br/><br/><span class="hl-1"> </span><span class="hl-8">// 设置要渲染的路径列表</span><br/><span class="hl-1"> </span><span class="hl-3">public</span><span class="hl-1"> </span><span class="hl-5">setLines</span><span class="hl-1">(</span><span class="hl-6">lines</span><span class="hl-1">: </span><span class="hl-7">Line</span><span class="hl-1">[]): </span><span class="hl-7">void</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-3">public</span><span class="hl-1"> </span><span class="hl-5">render</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">renderer</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">WebGLRenderer</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">writeBuffer</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">WebGLRenderTarget</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">readBuffer</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">WebGLRenderTarget</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">deltaTime</span><span class="hl-1">: </span><span class="hl-7">number</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">maskActive</span><span class="hl-1">?: </span><span class="hl-7">boolean</span><span class="hl-1">,</span><br/><span class="hl-1"> ): </span><span class="hl-7">void</span><span class="hl-1">;</span><br/><br/><span class="hl-1"> </span><span class="hl-3">public</span><span class="hl-1"> </span><span class="hl-5">dispose</span><span class="hl-1">(): </span><span class="hl-7">void</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
|
|
15
|
+
</code><button type="button">Copy</button></pre>
|
|
16
|
+
|
|
17
|
+
<h2 id="concepts" class="tsd-anchor-link">Concepts<a href="#concepts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
18
|
+
<h3 id="屏幕空间路径-screen-space-lines" class="tsd-anchor-link">屏幕空间路径 (Screen-space Lines)<a href="#屏幕空间路径-screen-space-lines" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
19
|
+
<p>路径点在屏幕坐标系中定义(像素单位),不受 3D 场景变化影响。光流沿路径顶点顺序流动,自动计算相邻顶点间距离。</p>
|
|
20
|
+
<h3 id="时间驱动光头-time-driven-head" class="tsd-anchor-link">时间驱动光头 (Time-driven Head)<a href="#时间驱动光头-time-driven-head" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
21
|
+
<p>光带"头部"根据 <code>duration</code> 和经过时间循环移动。<code>duration</code> 定义一个完整周期(从起点到终点再回到起点)所需的毫秒数。光带尾部长度固定为路径总长的 1/4。</p>
|
|
22
|
+
<h3 id="数据纹理驱动-data-texture" class="tsd-anchor-link">数据纹理驱动 (Data Texture)<a href="#数据纹理驱动-data-texture" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
23
|
+
<p>路径数据编码为 Float32 纹理上传到 GPU,使 shader 能高效计算光效。支持同时渲染多条路径。</p>
|
|
24
|
+
<h2 id="configuration" class="tsd-anchor-link">Configuration<a href="#configuration" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
25
|
+
<h3 id="line-配置参数" class="tsd-anchor-link">Line 配置参数<a href="#line-配置参数" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
26
|
+
<table>
|
|
27
|
+
<thead>
|
|
28
|
+
<tr>
|
|
29
|
+
<th style="text-align:left">Parameter</th>
|
|
30
|
+
<th style="text-align:left">Type</th>
|
|
31
|
+
<th style="text-align:left">Required</th>
|
|
32
|
+
<th style="text-align:left">Default</th>
|
|
33
|
+
<th style="text-align:left">Description</th>
|
|
34
|
+
</tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr>
|
|
38
|
+
<td style="text-align:left"><code>points</code></td>
|
|
39
|
+
<td style="text-align:left"><code>THREE.Vector2[]</code></td>
|
|
40
|
+
<td style="text-align:left">✓</td>
|
|
41
|
+
<td style="text-align:left">-</td>
|
|
42
|
+
<td style="text-align:left">屏幕空间路径点数组。至少 2 个点。</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td style="text-align:left"><code>totalLength</code></td>
|
|
46
|
+
<td style="text-align:left"><code>number</code></td>
|
|
47
|
+
<td style="text-align:left">✓</td>
|
|
48
|
+
<td style="text-align:left">-</td>
|
|
49
|
+
<td style="text-align:left">路径总长度(像素)。通常为所有相邻点间距离之和。</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td style="text-align:left"><code>color</code></td>
|
|
53
|
+
<td style="text-align:left"><code>THREE.Color</code></td>
|
|
54
|
+
<td style="text-align:left">✓</td>
|
|
55
|
+
<td style="text-align:left">-</td>
|
|
56
|
+
<td style="text-align:left">光带颜色(RGB)。</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td style="text-align:left"><code>opacity</code></td>
|
|
60
|
+
<td style="text-align:left"><code>number</code></td>
|
|
61
|
+
<td style="text-align:left"></td>
|
|
62
|
+
<td style="text-align:left"><code>1</code></td>
|
|
63
|
+
<td style="text-align:left">光带不透明度(0-1)。控制与背景的混合强度。</td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td style="text-align:left"><code>duration</code></td>
|
|
67
|
+
<td style="text-align:left"><code>number</code></td>
|
|
68
|
+
<td style="text-align:left"></td>
|
|
69
|
+
<td style="text-align:left"><code>1000</code></td>
|
|
70
|
+
<td style="text-align:left">动画周期(毫秒)。光头从路径起点完成一个周期的时长。</td>
|
|
71
|
+
</tr>
|
|
72
|
+
</tbody>
|
|
73
|
+
</table>
|
|
74
|
+
<blockquote>
|
|
75
|
+
<p><strong>注意</strong>: <code>totalLength</code> 应精确计算。若传入错误值,光流速度会显著偏差。</p>
|
|
76
|
+
</blockquote>
|
|
77
|
+
<h2 id="instance-methods" class="tsd-anchor-link">Instance Methods<a href="#instance-methods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
78
|
+
<h3 id="" class="tsd-anchor-link"><code>constructor(camera: Camera)</code></h3>
|
|
79
|
+
<p>初始化 Pass,需传入相机以获取屏幕分辨率。</p>
|
|
80
|
+
<h3 id="-1" class="tsd-anchor-link"><code>setLines(lines: Line[])</code><a href="#-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
81
|
+
<p>更新要渲染的路径列表。可随时调用以修改或新增路径。</p>
|
|
82
|
+
<p><strong>示例</strong>:</p>
|
|
83
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">pathLine</span><span class="hl-1">: </span><span class="hl-7">Line</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> [</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">100</span><span class="hl-1">, </span><span class="hl-11">100</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">300</span><span class="hl-1">, </span><span class="hl-11">150</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">500</span><span class="hl-1">, </span><span class="hl-11">100</span><span class="hl-1">),</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-11">400</span><span class="hl-1">, </span><span class="hl-8">// 实际路径总长度</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-11">0x00c2ff</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">opacity:</span><span class="hl-1"> </span><span class="hl-11">0.8</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">2000</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-6">pass</span><span class="hl-1">.</span><span class="hl-5">setLines</span><span class="hl-1">([</span><span class="hl-6">pathLine</span><span class="hl-1">]);</span>
|
|
84
|
+
</code><button type="button">Copy</button></pre>
|
|
85
|
+
|
|
86
|
+
<h3 id="-2" class="tsd-anchor-link"><code>render(...)</code><a href="#-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
87
|
+
<p>由 EffectComposer 自动调用,无需手动调用。</p>
|
|
88
|
+
<h3 id="-3" class="tsd-anchor-link"><code>dispose()</code><a href="#-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
89
|
+
<p>释放着色材质和纹理资源,避免内存泄漏。销毁 Pass 时必须调用。</p>
|
|
90
|
+
<h2 id="examples" class="tsd-anchor-link">Examples<a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
91
|
+
<h3 id="快速上手-quick-example" class="tsd-anchor-link">快速上手 (Quick Example)<a href="#快速上手-quick-example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
92
|
+
<pre><code class="ts"><span class="hl-10">import</span><span class="hl-1"> { </span><span class="hl-6">Five</span><span class="hl-1"> } </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'@realsee/five'</span><span class="hl-1">;</span><br/><span class="hl-10">import</span><span class="hl-1"> { </span><span class="hl-6">FlowingLight2DPass</span><span class="hl-1"> } </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'../../lib/five/renderer/postprocessing'</span><span class="hl-1">;</span><br/><span class="hl-10">import</span><span class="hl-1"> </span><span class="hl-3">*</span><span class="hl-1"> </span><span class="hl-10">as</span><span class="hl-1"> </span><span class="hl-6">THREE</span><span class="hl-1"> </span><span class="hl-10">from</span><span class="hl-1"> </span><span class="hl-9">'three'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">five</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-5">Five</span><span class="hl-1">();</span><br/><br/><span class="hl-8">// 创建 2D 流光通道</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">flowing2D</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-5">FlowingLight2DPass</span><span class="hl-1">(</span><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-6">camera</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 定义一条屏幕空间的路径</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">path</span><span class="hl-1"> = [</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">100</span><span class="hl-1">, </span><span class="hl-11">100</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">300</span><span class="hl-1">, </span><span class="hl-11">200</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">500</span><span class="hl-1">, </span><span class="hl-11">100</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Vector2</span><span class="hl-1">(</span><span class="hl-11">700</span><span class="hl-1">, </span><span class="hl-11">250</span><span class="hl-1">),</span><br/><span class="hl-1">];</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">totalLen</span><span class="hl-1"> = </span><span class="hl-11">600</span><span class="hl-1">; </span><span class="hl-8">// 近似路径长度</span><br/><br/><span class="hl-6">flowing2D</span><span class="hl-1">.</span><span class="hl-5">setLines</span><span class="hl-1">([{</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> </span><span class="hl-6">path</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-6">totalLen</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-11">0x00ff00</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">opacity:</span><span class="hl-1"> </span><span class="hl-11">0.9</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">2000</span><span class="hl-1">,</span><br/><span class="hl-1">}]);</span><br/><br/><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-5">addPass</span><span class="hl-1">(</span><span class="hl-6">flowing2D</span><span class="hl-1">);</span><br/><br/><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-5">animate</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-5">requestAnimationFrame</span><span class="hl-1">(</span><span class="hl-6">animate</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-5">render</span><span class="hl-1">();</span><br/><span class="hl-1">}</span><br/><span class="hl-5">animate</span><span class="hl-1">();</span>
|
|
93
|
+
</code><button type="button">Copy</button></pre>
|
|
94
|
+
|
|
95
|
+
<h3 id="多条路径-动态更新" class="tsd-anchor-link">多条路径 & 动态更新<a href="#多条路径-动态更新" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
96
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">pass</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-5">FlowingLight2DPass</span><span class="hl-1">(</span><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-6">camera</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 初始路径集合</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">paths</span><span class="hl-1"> = [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> [...],</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-11">500</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-11">0xff6600</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">1500</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> [...],</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-11">400</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-11">0x0066ff</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">opacity:</span><span class="hl-1"> </span><span class="hl-11">0.7</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">2000</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">];</span><br/><br/><span class="hl-6">pass</span><span class="hl-1">.</span><span class="hl-5">setLines</span><span class="hl-1">(</span><span class="hl-6">paths</span><span class="hl-1">);</span><br/><span class="hl-6">five</span><span class="hl-1">.</span><span class="hl-5">addPass</span><span class="hl-1">(</span><span class="hl-6">pass</span><span class="hl-1">);</span><br/><br/><span class="hl-8">// 响应用户交互动态更新路径</span><br/><span class="hl-6">document</span><span class="hl-1">.</span><span class="hl-5">addEventListener</span><span class="hl-1">(</span><span class="hl-9">'click'</span><span class="hl-1">, (</span><span class="hl-6">e</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">newPath</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> [</span><span class="hl-8">/* 鼠标点击生成的路径点 */</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-11">300</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-6">Math</span><span class="hl-1">.</span><span class="hl-5">random</span><span class="hl-1">() * </span><span class="hl-11">0xffffff</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">1200</span><span class="hl-1">,</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-6">pass</span><span class="hl-1">.</span><span class="hl-5">setLines</span><span class="hl-1">([...</span><span class="hl-6">paths</span><span class="hl-1">, </span><span class="hl-6">newPath</span><span class="hl-1">]);</span><br/><span class="hl-1">});</span>
|
|
97
|
+
</code><button type="button">Copy</button></pre>
|
|
98
|
+
|
|
99
|
+
<h3 id="计算路径总长度" class="tsd-anchor-link">计算路径总长度<a href="#计算路径总长度" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
100
|
+
<pre><code class="ts"><span class="hl-3">function</span><span class="hl-1"> </span><span class="hl-5">calculatePathLength</span><span class="hl-1">(</span><span class="hl-6">points</span><span class="hl-1">: </span><span class="hl-7">THREE</span><span class="hl-1">.</span><span class="hl-7">Vector2</span><span class="hl-1">[]): </span><span class="hl-7">number</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-6">length</span><span class="hl-1"> = </span><span class="hl-11">0</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-10">for</span><span class="hl-1"> (</span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-6">i</span><span class="hl-1"> = </span><span class="hl-11">1</span><span class="hl-1">; </span><span class="hl-6">i</span><span class="hl-1"> < </span><span class="hl-6">points</span><span class="hl-1">.</span><span class="hl-6">length</span><span class="hl-1">; </span><span class="hl-6">i</span><span class="hl-1">++) {</span><br/><span class="hl-1"> </span><span class="hl-6">length</span><span class="hl-1"> += </span><span class="hl-6">points</span><span class="hl-1">[</span><span class="hl-6">i</span><span class="hl-1">].</span><span class="hl-5">distanceTo</span><span class="hl-1">(</span><span class="hl-6">points</span><span class="hl-1">[</span><span class="hl-6">i</span><span class="hl-1"> - </span><span class="hl-11">1</span><span class="hl-1">]);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> </span><span class="hl-10">return</span><span class="hl-1"> </span><span class="hl-6">length</span><span class="hl-1">;</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">pathLine</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-6">points:</span><span class="hl-1"> [...],</span><br/><span class="hl-1"> </span><span class="hl-6">totalLength:</span><span class="hl-1"> </span><span class="hl-5">calculatePathLength</span><span class="hl-1">(</span><span class="hl-6">points</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">color:</span><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-4">THREE</span><span class="hl-1">.</span><span class="hl-5">Color</span><span class="hl-1">(</span><span class="hl-11">0x00ffff</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-6">duration:</span><span class="hl-1"> </span><span class="hl-11">2000</span><span class="hl-1">,</span><br/><span class="hl-1">};</span>
|
|
101
|
+
</code><button type="button">Copy</button></pre>
|
|
102
|
+
|
|
103
|
+
<h2 id="debugging" class="tsd-anchor-link">Debugging<a href="#debugging" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
104
|
+
<ul>
|
|
105
|
+
<li><strong>光带不出现</strong>:检查 <code>color</code> 和 <code>opacity</code>,确保非全透明;验证 <code>points</code> 至少 2 个。</li>
|
|
106
|
+
<li><strong>流速不对</strong>:检查 <code>totalLength</code> 计算是否准确;若流速过快/过慢,调整 <code>duration</code>。</li>
|
|
107
|
+
<li><strong>性能问题</strong>:降低路径点数或使用更简单的路径。</li>
|
|
108
|
+
</ul>
|
|
109
|
+
<h2 id="common-pitfalls" class="tsd-anchor-link">Common Pitfalls<a href="#common-pitfalls" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
110
|
+
<ol>
|
|
111
|
+
<li><strong>totalLength 计算错误</strong>:光流速度直接依赖 <code>totalLength</code>。手动计算时务必精确。</li>
|
|
112
|
+
<li><strong>屏幕坐标系混淆</strong>:<code>points</code> 使用屏幕坐标(原点通常在左下角),不是 Canvas 默认坐标系。</li>
|
|
113
|
+
<li><strong>未及时 dispose()</strong>:移除 Pass 时必须调用 <code>dispose()</code>,否则 GPU 纹理资源泄漏。</li>
|
|
114
|
+
</ol>
|
|
115
|
+
<h2 id="related" class="tsd-anchor-link">Related<a href="#related" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
116
|
+
<ul>
|
|
117
|
+
<li><a href="features_postprocessing.html">Postprocessing</a>: 后处理通用概念与 EffectComposer 使用指南。</li>
|
|
118
|
+
<li><a href="features_flowing-light-3d-pass.html">Flowing Light 3D Pass</a>: 基于 3D 世界坐标的流光效果。</li>
|
|
119
|
+
</ul>
|
|
120
|
+
<hr>
|
|
121
|
+
<pre><code class="yaml"><span class="hl-0">tags</span><span class="hl-1">: [</span><span class="hl-2">postprocessing</span><span class="hl-1">, </span><span class="hl-2">effect</span><span class="hl-1">, </span><span class="hl-2">flowing</span><span class="hl-1">, </span><span class="hl-2">light</span><span class="hl-1">, </span><span class="hl-2">pass</span><span class="hl-1">, </span><span class="hl-2">rendering</span><span class="hl-1">, </span><span class="hl-2">screenspace</span><span class="hl-1">]</span>
|
|
122
|
+
</code><button type="button">Copy</button></pre>
|
|
123
|
+
|
|
124
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#flowing-light-2d-pass-流光-2d-通道"><span>Flowing <wbr/>Light 2<wbr/>D <wbr/>Pass (流光 2<wbr/>D 通道)</span></a><ul><li><a href="#schema"><span>Schema</span></a></li><li><a href="#concepts"><span>Concepts</span></a></li><li><ul><li><a href="#屏幕空间路径-screen-space-lines"><span>屏幕空间路径 (<wbr/>Screen-<wbr/>space <wbr/>Lines)</span></a></li><li><a href="#时间驱动光头-time-driven-head"><span>时间驱动光头 (<wbr/>Time-<wbr/>driven <wbr/>Head)</span></a></li><li><a href="#数据纹理驱动-data-texture"><span>数据纹理驱动 (<wbr/>Data <wbr/>Texture)</span></a></li></ul></li><li><a href="#configuration"><span>Configuration</span></a></li><li><ul><li><a href="#line-配置参数"><span>Line 配置参数</span></a></li></ul></li><li><a href="#instance-methods"><span>Instance <wbr/>Methods</span></a></li><li><ul><li><a href="#"><span></span></a></li><li><a href="#-1"><span></span></a></li><li><a href="#-2"><span></span></a></li><li><a href="#-3"><span></span></a></li></ul></li><li><a href="#examples"><span>Examples</span></a></li><li><ul><li><a href="#快速上手-quick-example"><span>快速上手 (<wbr/>Quick <wbr/>Example)</span></a></li><li><a href="#多条路径-动态更新"><span>多条路径 & 动态更新</span></a></li><li><a href="#计算路径总长度"><span>计算路径总长度</span></a></li></ul></li><li><a href="#debugging"><span>Debugging</span></a></li><li><a href="#common-pitfalls"><span>Common <wbr/>Pitfalls</span></a></li><li><a href="#related"><span>Related</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">如视 Five SDK</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|