• Packs a View's active section planes into a flat uniform buffer as (normal.xyz, dist) per plane, ready for upload via gl.uniform4fv.

    Active planes densely fill out[0 .. count*4 - 1] so a clipping shader's loop bound (uSectionPlaneCount) stays uniform and inactive planes cost nothing; the shader evaluates each plane as a single dot(normal, p) + dist > 0 test. At most MAX_SECTION_PLANES planes are packed — extras are ignored.

    Shared by the mesh (_bind), splat and splat-pick passes so the clip convention can't drift between them.

    Parameters

    • planes: readonly SectionPlaneLike[]

      The View's section planes (e.g. view.sectionPlanesList), or undefined.

    • out: Float32Array<any>

      Scratch buffer of length MAX_SECTION_PLANES * 4, filled in place.

    Returns number

    The number of active planes packed (0 .. MAX_SECTION_PLANES).