pixi.js
    Preparing search index...

    Class TexturePoolClassAdvanced

    Texture pool, used by FilterSystem and plugins.

    Stores collection of temporary pow2 or screen-sized renderTextures

    If you use custom RenderTexturePool for your filters, you can use methods getFilterTexture and returnFilterTexture same as in default pool

    Index

    Constructors

    • Parameters

      • OptionaltextureOptions: TextureSourceOptions

        options that will be passed to BaseRenderTexture constructor

        options for creating a new TextureSource

        • Optional_resourceId?: number
        • OptionaladdressMode?: WRAP_MODE

          setting this will set wrapModeU,wrapModeV and wrapModeW all at once!

        • OptionaladdressModeU?: WRAP_MODE

          specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.

        • OptionaladdressModeV?: WRAP_MODE

          specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.

        • OptionaladdressModeW?: WRAP_MODE

          Specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.

        • OptionalalphaMode?: ALPHA_MODES

          the alpha mode of the texture

        • Optionalantialias?: boolean

          Only really affects RenderTextures. Should we use antialiasing for this texture. It will look better, but may impact performance as a Blit operation will be required to resolve the texture.

        • OptionalautoGarbageCollect?: boolean

          If true, the Garbage Collector will unload this texture if it is not used after a period of time

        • OptionalautoGenerateMipmaps?: boolean

          Should we auto generate mipmaps for this texture? This will automatically generate mipmaps for this texture when uploading to the GPU. Mipmapped textures take up more memory, but can look better when scaled down.

          For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame. If you do, make sure to call updateMipmaps after you update the texture.

        • Optionalcompare?: COMPARE_FUNCTION

          When provided the sampler will be a comparison sampler with the specified COMPARE_FUNCTION. Note: Comparison samplers may use filtering, but the sampling results will be implementation-dependent and may differ from the normal filtering rules.

        • Optional Readonlydestroyed?: boolean

          Has the style been destroyed?

        • Optionaldimensions?: TEXTURE_DIMENSIONS

          how many dimensions does this texture have? currently v8 only supports 2d

        • Optionalformat?: TEXTURE_FORMATS

          the format that the texture data has

        • Optionalheight?: number

          the pixel height of this texture source. This is the REAL pure number, not accounting resolution

        • Optionallabel?: string

          optional label, can be used for debugging

        • OptionallodMaxClamp?: number

          Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.

        • OptionallodMinClamp?: number

          specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.

        • OptionalmagFilter?: SCALE_MODE

          specifies the sampling behavior when the sample footprint is smaller than or equal to one texel.

        • OptionalmaxAnisotropy?: number

          Specifies the maximum anisotropy value clamp used by the sampler. Note: Most implementations support TextureStyle#maxAnisotropy values in range between 1 and 16, inclusive. The used value of TextureStyle#maxAnisotropy will be clamped to the maximum value that the platform supports.

          setting this to anything higher than 1 will set scale modes to 'linear'

        • OptionalminFilter?: SCALE_MODE

          specifies the sampling behavior when the sample footprint is larger than one texel.

        • OptionalmipLevelCount?: number

          The number of mip levels to generate for this texture. this is overridden if autoGenerateMipmaps is true

        • OptionalmipmapFilter?: SCALE_MODE

          specifies behavior for sampling between mipmap levels.

        • Optionalresolution?: number

          the resolution of the texture.

        • Optionalresource?: T

          the resource that will be uploaded to the GPU. This is where we get our pixels from eg an ImageBimt / Canvas / Video etc

        • OptionalscaleMode?: SCALE_MODE

          setting this will set magFilter,minFilter and mipmapFilter all at once!

        • Optionalwidth?: number

          the pixel width of this texture source. This is the REAL pure number, not accounting resolution

        • OptionalwrapMode?: WRAP_MODE
        • destroy?: function
        • update?: function

      Returns TexturePoolClass

    Properties

    enableFullScreen: boolean

    Allow renderTextures of the same size as screen, not just pow2

    Automatically sets to true after setScreenSize

    false
    
    textureOptions: TextureSourceOptions

    The default options for texture pool

    textureStyle: TextureStyle

    The default texture style for the pool

    Methods

    • Clears the pool.

      Parameters

      • OptionaldestroyTextures: boolean

        Destroy all stored textures.

      Returns void

    • Creates texture with params that were specified in pool constructor.

      Parameters

      • pixelWidth: number

        Width of texture in pixels.

      • pixelHeight: number

        Height of texture in pixels.

      • antialias: boolean

      Returns Texture

    • Gets a Power-of-Two render texture or fullScreen texture

      Parameters

      • frameWidth: number

        The minimum width of the render texture.

      • frameHeight: number

        The minimum height of the render texture.

      • resolution: number = 1

        The resolution of the render texture.

      • antialias: boolean

      Returns Texture

      The new render texture.

    • Gets extra texture of the same size as input renderTexture

      Parameters

      • texture: Texture

        The texture to check what size it is.

      • antialias: boolean = false

        Whether to use antialias.

      Returns Texture<TextureSource<any>>

      A texture that is a power of two

    • Place a render texture back into the pool. Optionally reset the style of the texture to the default texture style. useful if you modified the style of the texture after getting it from the pool.

      Parameters

      • renderTexture: Texture

        The renderTexture to free

      • resetStyle: boolean = false

        Whether to reset the style of the texture to the default texture style

      Returns void