Documentation
    Preparing search index...

    Class ParticleProgram

    The instanced particle pipeline (§36) — the program the §112 tier added to this backend (WP-9.3).

    const program = ParticleProgram.create(gl);
    program.use();
    program.setProjection(camera.projectionMatrix); // once per viewport
    program.setView(camera.viewMatrix); // once per viewport
    program.setModel(item.worldMatrix); // once per system

    Owns its GL objects and nothing else; the renderer re-creates it on context restore exactly as it re-creates the other two (§61).

    Implements

    Index
    • Deletes the GL program (§83). Idempotent.

      Only call this on a live context — after a loss every handle is already invalid and the renderer drops its reference instead (§61).

      Returns void

    • Uploads the camera's projection. Column-major, so transpose is false — the engine's Matrix4 layout is already GL's (§7b).

      Parameters

      Returns void

    • Makes this the current program. Call before any upload below.

      Returns void

    • Compiles and links the particle program on gl.

      Throws a FourError carrying SHADER_COMPILATION_FAILED (§89) with the driver's info log in context.log when a stage fails to compile, when linking fails, when GL refuses to allocate an object, or when a uniform this backend wrote is missing from the linked program — the contract UnlitProgram.create and SpriteProgram.create state, with "particle" in the message. Shader objects are deleted on every path.

      Parameters

      Returns ParticleProgram