Documentation
    Preparing search index...

    Function buildViewRenderList

    • Derives the render list for one view from the frame's list, into out, and returns out (§64 stages 2–3; R-8).

      Two filters, in this order and for a reason:

      1. §46's layer mask — view.layerMask when the viewport sets one, the camera's own layers otherwise, which is §48's fallback rule resolved by viewLayerMask so that every caller spells it the same way. Both default to every layer, so a view that never mentions layers keeps every item.
      2. §87's frustum test, when options.frustum is given and the item says it may be culled. It runs second because it is the expensive one: a masked-out item never has its bounds computed.

      Order is preserved exactly — this is a subsequence, so §66's keys 1, 2 and 5 (and key 3, if groupRenderListByPipeline was applied to the source) survive untouched. out is truncated to the number of items kept.

      • An item whose node set frustumCulled = false (§49). That is the flag's entire job: geometry a vertex shader displaces, a skybox, a node whose bounds lie about where it draws.
      • A particle system (§36) that has not published live bounds. Its item carries the shared unit quad as geometry, so the quad's box is a square at the emitter and says nothing about the particles. The builders write frustumCulled = false in that case. When the emitter publishes a local AABB (computeBounds), they copy a world sphere onto item.worldBounds and set frustumCulled so this scan can hide it (R-8 follow-up b) — still no kind check here.
      • An item whose geometry cannot be bounded — see computeWorldBoundingSphere for the three cases and why each one fails towards drawing.

      With no frustum and a view that names no layers this function copies its source, item for item, in order. That is what let it replace the WebGL backend's inline per-item mask test without changing one GL call of any existing scene — the filter moved, the set did not.

      Parameters

      • source: readonly RenderItem[]

        the frame's list, from buildRenderList or buildInterpolatedRenderList. Read only; the derived list shares its pooled items, so building the frame list again invalidates both.

      • view: Viewport

        the viewport being drawn (§48).

      • out: RenderItem[]

        rewritten and truncated in place, then returned. One array per concurrently live list; views drawn one after another can share one.

      • options: ViewRenderListOptions = {}

      Returns RenderItem[]

      FourError INVALID_SCENE_GRAPH in a development build when the resolved layer mask is not an integer in [0, 0xffffffff] (§85) — see viewLayerMask.