You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/framework/visibility_region.md
+31-13
Original file line number
Diff line number
Diff line change
@@ -2,34 +2,52 @@
2
2
3
3

4
4
5
-
A `VisibilityRegion` is a ref-counted wrapper around 2 `Zones`. One of the zones is designated "static" and the other designated "dynamic". When registering objects with the region, the application may pick if it is "static" or "dynamic" -- this will assign it to the corresponding `Zone` and return a `VisibilityObjectArc`. Note that the "static" or "dynamic" assignment is not a meaningful distinction by the underlying `VisibilityWorld` -- it is ok to move an object that was registered as "static". The reason for separating "static" and "dynamic" assignments is to support a future capability for running the "static" visibility calculation earlier in the frame and combining it with the "dynamic" visibility later in the frame. [1] An application view is registered with the `VisibilityRegion` and returned as a `ViewFrustumArc`.
6
-
7
-
The `VisibilityObjectArc` is a ref-counted wrapper around an `ObjectHandle`. This struct contains functions for setting the position, `id`, and other fields. The set functions are implemented under the hood using async commands over a channel to the `VisibilityWorld`. Each `VisibilityObjectArc` contains a list of features registered with that handle. Particular features may be shown or hidden on an entity in the world by adding or removing the feature from the `VisibilityObjectArc` associated with that entiy.
8
-
9
-
The `ViewFrustumArc` is a ref-counted wrapper around 1 or 2 `ViewFrustumHandle` representing a view of the "static" `Zone` and a view of the "dynamic" `Zone` in the `VisibilityRegion`. This struct contains functions for setting the location, `id`, projection, and querying for visibility. The set functions are implemented under the hood using async commands over a channel to the `VisibilityWorld`. Each `RenderView` requires a `ViewFrustumArc` so that visibility can be calculated for that view.
10
-
11
-
`EntityId` is a helper to transmute between a struct `T: Copy` with the same as a `u64` and the `u64` required for the `id` in the `VisibilityWorld`.
5
+
A `VisibilityRegion` is a ref-counted wrapper around 2 `Zones`. One of the zones is designated "static" and the other
6
+
designated "dynamic". When registering objects with the region, the application may pick if it is "static" or "dynamic"
7
+
-- this will assign it to the corresponding `Zone` and return a `VisibilityObjectArc`. Note that the "static" or "dynamic"
8
+
assignment is not a meaningful distinction by the underlying `VisibilityWorld` -- it is ok to move an object that was
9
+
registered as "static". The reason for separating "static" and "dynamic" assignments is to support a future capability
10
+
for running the "static" visibility calculation earlier in the frame and combining it with the "dynamic" visibility later
11
+
in the frame. [1] An application view is registered with the `VisibilityRegion` and returned as a `ViewFrustumArc`.
12
+
13
+
The `VisibilityObjectArc` is a ref-counted wrapper around an `ObjectHandle`. This struct contains functions for setting
14
+
the position, `id`, and other fields. The set functions are implemented under the hood using async commands over a channel
15
+
to the `VisibilityWorld`. Each `VisibilityObjectArc` contains a list of features registered with that handle. Particular
16
+
features may be shown or hidden on an entity in the world by adding or removing the feature from the `VisibilityObjectArc`
17
+
associated with that entiy.
18
+
19
+
The `ViewFrustumArc` is a ref-counted wrapper around 1 or 2 `ViewFrustumHandle` representing a view of the "static" `Zone`
20
+
and a view of the "dynamic" `Zone` in the `VisibilityRegion`. This struct contains functions for setting the location,
21
+
`id`, projection, and querying for visibility. The set functions are implemented under the hood using async commands over
22
+
a channel to the `VisibilityWorld`. Each `RenderView` requires a `ViewFrustumArc` so that visibility can be calculated
23
+
for that view.
24
+
25
+
`ObjectId` is a helper to transmute between a struct `T: 'static + Copy + Hash + Eq + PartialEq` with the same size as a
26
+
`u64` and the `u64` required for the `id` in the `VisibilityWorld`.
When a `RenderView` is aded to the frame packet using `add_view`, the associated `ViewFrustum` is queried for visibility. Only visible features relevant to the `RenderView` will be added to the frame packet.
48
+
When a `RenderView` is needed in the current frame, the associated `ViewFrustum` is queried for visibility. The visible
49
+
`ObjectHandle`s are mapped to their `VisibilityObjectArc`s and the associated `RenderObject`s are added to the `FramePacket`
50
+
of the relevant `RenderFeature` -- if the `RenderView` is registered for the `RenderFeature` and any `RenderPhase` required
0 commit comments