Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class UniformBufferFormat

    A descriptor that defines the layout of data inside the uniform buffer.

    Index
    • Create a new UniformBufferFormat instance.

      Parameters

      • graphicsDevice: GraphicsDevice

        The graphics device.

      • uniforms: UniformFormat[]

        An array of uniforms to be stored in the buffer.

      • Optionaloptions: { pack?: boolean } = {}

        Options.

        • Optionalpack?: boolean

          Reorder the uniforms to minimize the padding of the std140 layout: uniforms occupying whole 16-byte rows first (vec4, matrices and arrays), then each vec3 followed by a scalar, then vec2s and the remaining scalars. The uniforms of the format are then in layout order rather than in the order of the array. Only use it when the shader declaration of the buffer is generated from this format, and never against a hand-written declaration, whose member order has to match the array. Defaults to false.

      Returns UniformBufferFormat

    uniforms: UniformFormat[]