Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to store data associated with WebGL texture data for the engine This class should not be used directly

Hierarchy

Index

Constructors

  • Creates a new InternalTexture

    Parameters

    • engine: ThinEngine

      defines the engine to use

    • source: InternalTextureSource

      defines the type of data that will be used

    • Optional delayAllocation: boolean

      if the texture allocation should be delayed (default: false)

    Returns InternalTexture

Properties

baseDepth: number

Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)

baseHeight: number

Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)

baseWidth: number

Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)

depth: number

Gets the depth of the texture

format: number

Gets the format of the texture (RGB, RGBA...)

generateMipMaps: boolean

Gets a boolean indicating if the texture needs mipmaps generation

height: number

Gets the height of the texture

invertY: boolean

Gets a boolean indicating if the texture is inverted on Y axis

is2DArray: boolean

Defines if the texture contains 2D array data

is3D: boolean

Defines if the texture contains 3D data

isCube: boolean

Defines if the texture is a cube texture

isMultiview: boolean

Defines if the texture contains multiview data

isReady: boolean

Defines if the texture is ready

label?: string

Used for debugging purpose only

onErrorObservable: Observable<Partial<{ exception: any; message: string }>>

Observable called when the texture load is raising an error

onLoadedObservable: Observable<InternalTexture>

Observable called when the texture is loaded

onRebuildCallback: Nullable<((internalTexture: InternalTexture) => { isAsync: boolean; isReady: boolean; proxy: Nullable<InternalTexture | Promise<InternalTexture>> })>

If this callback is defined it will be called instead of the default _rebuild function

samples: number

Gets the number of samples used by the texture (WebGL2+ only)

samplingMode: number

Gets the sampling mode of the texture

type: number

Gets the type of the texture (int, float...)

url: string

Gets the URL used to load this texture

width: number

Gets the width of the texture

Accessors

  • get anisotropicFilteringLevel(): Nullable<number>
  • set anisotropicFilteringLevel(value: Nullable<number>): void
  • With compliant hardware and browser (supporting anisotropic filtering) this defines the level of anisotropic filtering in the texture. The higher the better but the slower.

    Returns Nullable<number>

  • With compliant hardware and browser (supporting anisotropic filtering) this defines the level of anisotropic filtering in the texture. The higher the better but the slower.

    Parameters

    Returns void

  • get comparisonFunction(): number
  • set comparisonFunction(value: number): void
  • Gets or sets the comparison function (Constants.LESS, Constants.EQUAL, etc). Set 0 to not use a comparison function

    Returns number

  • Gets or sets the comparison function (Constants.LESS, Constants.EQUAL, etc). Set 0 to not use a comparison function

    Parameters

    • value: number

    Returns void

  • Gets the data source type of the texture

    Returns InternalTextureSource

  • get uniqueId(): number
  • Gets the unique id of the internal texture

    Returns number

  • get useMipMaps(): boolean
  • set useMipMaps(value: boolean): void
  • Gets a boolean indicating if the texture uses mipmaps TODO implements useMipMaps as a separate setting from generateMipMaps

    Returns boolean

  • Gets a boolean indicating if the texture uses mipmaps TODO implements useMipMaps as a separate setting from generateMipMaps

    Parameters

    • value: boolean

    Returns void

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns void

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns void

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns void

Methods

  • Compares this sampler with another one

    Parameters

    Returns boolean

    true if the samplers have the same parametres, else false

  • dispose(): void
  • Dispose the current allocated resources

    Returns void

  • Gets the Engine the texture belongs to.

    Returns ThinEngine

    The babylon engine

  • incrementReferences(): void
  • Increments the number of references (ie. the number of Texture that point to it)

    Returns void

  • setParameters(wrapU?: number, wrapV?: number, wrapR?: number, anisotropicFilteringLevel?: number, samplingMode?: number, comparisonFunction?: number): TextureSampler
  • Sets all the parameters of the sampler

    Parameters

    • Optional wrapU: number

      u address mode (default: TEXTURE_WRAP_ADDRESSMODE)

    • Optional wrapV: number

      v address mode (default: TEXTURE_WRAP_ADDRESSMODE)

    • Optional wrapR: number

      r address mode (default: TEXTURE_WRAP_ADDRESSMODE)

    • Optional anisotropicFilteringLevel: number

      anisotropic level (default: 1)

    • Optional samplingMode: number

      sampling mode (default: Constants.TEXTURE_BILINEAR_SAMPLINGMODE)

    • Optional comparisonFunction: number

      comparison function (default: 0 - no comparison function)

    Returns TextureSampler

    the current sampler instance

  • updateSize(width: number, height: number, depth?: number): void
  • Change the size of the texture (not the size of the content)

    Parameters

    • width: number

      defines the new width

    • height: number

      defines the new height

    • Optional depth: number

      defines the new depth (1 by default)

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static method

Settings

Theme