Engine API Reference - v2.6.1
    Preparing search index...

    Function basisInitialize

    • Initialize the Basis transcode worker.

      Parameters

      • Optionalconfig: {
            eagerWorkers?: boolean;
            fallbackUrl?: string;
            glueUrl?: string;
            lazyInit?: boolean;
            maxRetries?: number;
            numWorkers?: number;
            rgbaPriority?: string[];
            rgbPriority?: string[];
            wasmUrl?: string;
        }

        The Basis configuration.

        • OptionaleagerWorkers?: boolean

          Use eager workers (default is true). When enabled, jobs are assigned to workers immediately, independent of their work load. This can result in unbalanced workloads, however there is no delay between jobs. If disabled, new jobs are assigned to workers only when their previous job has completed. This will result in balanced workloads across workers, however workers can be idle for a short time between jobs.

        • OptionalfallbackUrl?: string

          URL of the fallback script to use when wasm modules aren't supported.

        • OptionalglueUrl?: string

          URL of glue script.

        • OptionallazyInit?: boolean

          Wait for first transcode request before initializing Basis (default is false). Otherwise initialize Basis immediately.

        • OptionalmaxRetries?: number

          Number of http load retry attempts. Defaults to 5.

        • OptionalnumWorkers?: number

          Number of workers to use for transcoding (default is 1). While it is possible to improve transcode performance using multiple workers, this will likely depend on the runtime platform. For example, desktop will likely benefit from more workers compared to mobile. Also keep in mind that it takes time to initialize workers and increasing this value could impact application startup time. Make sure to test your application performance on all target platforms when changing this parameter.

        • OptionalrgbaPriority?: string[]

          Array of texture compression formats in priority order for textures with alpha. The supported compressed formats are: 'astc', 'atc', 'dxt', 'etc1', 'etc2', 'pvr'.

        • OptionalrgbPriority?: string[]

          Array of texture compression formats in priority order for textures without alpha. The supported compressed formats are: 'astc', 'atc', 'dxt', 'etc1', 'etc2', 'pvr'.

        • OptionalwasmUrl?: string

          URL of the wasm module.

      Returns void