babylon.quarks - v1.0.0
    Preparing search index...

    Class VFXBatchAbstract

    One draw call of a BatchedRenderer: the systems that share a material, texture and geometry, drawn together from one instanced mesh. The renderer makes and frees batches as systems are added and their settings change; read them through renderer.batches to inspect what is drawn, not to change it.

    Index
    mesh: Mesh

    The Babylon mesh the batch draws with. Its world matrix is frozen at identity: the instance data is already in world space, so no parent's transform moves the particles again.

    The settings every system in the batch shares, with what the render mode ignores at its default.

    systems: Set<IParticleSystem>

    The systems drawn by this batch.

    time: number = 0

    Seconds of renderer time, set by the renderer before each fill; what UV and erosion mask scrolling advance by.

    SHRINK_AFTER_FILLS: 300

    How many fills in a row a batch may use under a quarter of its buffers before it halves them: about five seconds at 60 frames per second. A burst that grew the buffers does not hold that memory for the rest of the session, and a batch whose count swings does not reallocate every few frames.

    • Sets the soft-particle and alpha-test values on a material, and decodes the depth for the camera of each draw.

      Parameters

      • material: ShaderMaterial

      Returns void

    • Sets the material colour, the texture effects' textures and constants, and advances their scrolling on every bind.

      Parameters

      • material: ShaderMaterial

      Returns void

    • Applies the batch-level scene settings to mesh. Called on every mesh the batch creates, since the buffers rebuild it.

      alphaIndex from the system's render order puts the batch where the author said among the scene's transparent meshes, and the rendering group and layer mask reach the mesh at all (they used to stop at the settings).

      Returns void

    • Sets mesh's bounds to the union of the world bounds of the systems from from to to among those the batch draws this frame, so Babylon skips the draw when none of them is in view: the batch mesh over the systems it draws, a run's mesh over its own. Called after each fill. A draw whose systems have no measured bounds stays always drawn.

      Parameters

      • mesh: AbstractMesh = ...
      • from: number = 0
      • to: number = ...

      Returns void

    • Writes a uniform that changes per bind, such as one read off the active camera, to the material for the next bind and to its bound effect for this one: ShaderMaterial uploads its stored values before the bind observers run, so a value written only to the material would reach the GPU one draw late, and with two cameras it would always be the other camera's.

      Parameters

      • material: ShaderMaterial
      • write: (target: Effect | ShaderMaterial) => void

      Returns void