Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InternalTexture

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

Hierarchy

Index

Constructors

constructor

  • 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

baseDepthSearch playground for baseDepth

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)

baseHeightSearch playground for baseHeight

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)

baseWidthSearch playground for baseWidth

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)

depthSearch playground for depth

depth: number

Gets the depth of the texture

formatSearch playground for format

format: number

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

generateMipMapsSearch playground for generateMipMaps

generateMipMaps: boolean

Gets a boolean indicating if the texture needs mipmaps generation

heightSearch playground for height

height: number

Gets the height of the texture

invertYSearch playground for invertY

invertY: boolean

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

is2DArraySearch playground for is2DArray

is2DArray: boolean

Defines if the texture contains 2D array data

is3DSearch playground for is3D

is3D: boolean

Defines if the texture contains 3D data

isCubeSearch playground for isCube

isCube: boolean

Defines if the texture is a cube texture

isMultiviewSearch playground for isMultiview

isMultiview: boolean

Defines if the texture contains multiview data

isReadySearch playground for isReady

isReady: boolean

Defines if the texture is ready

onErrorObservableSearch playground for onErrorObservable

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

Observable called when the texture load is raising an error

onLoadedObservableSearch playground for onLoadedObservable

onLoadedObservable: Observable<InternalTexture>

Observable called when the texture is loaded

onRebuildCallbackSearch playground for onRebuildCallback

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

samplesSearch playground for samples

samples: number

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

samplingModeSearch playground for samplingMode

samplingMode: number

Gets the sampling mode of the texture

typeSearch playground for type

type: number

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

urlSearch playground for url

url: string

Gets the URL used to load this texture

widthSearch playground for width

width: number

Gets the width of the texture

Accessors

anisotropicFilteringLevel

  • get anisotropicFilteringLevel(): Nullable<number>
  • set anisotropicFilteringLevel(value: Nullable<number>): any
  • 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 any

comparisonFunction

  • get comparisonFunction(): number
  • set comparisonFunction(value: number): any
  • 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 any

source

  • Gets the data source type of the texture

    Returns InternalTextureSource

uniqueId

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

    Returns number

useMipMaps

  • get useMipMaps(): boolean
  • set useMipMaps(value: boolean): any
  • 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 any

wrapR

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns any

wrapU

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns any

wrapV

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns Nullable<number>

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    Returns any

Methods

compareSamplerSearch playground for compareSampler

  • Compares this sampler with another one

    Parameters

    Returns boolean

    true if the samplers have the same parametres, else false

disposeSearch playground for dispose

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

    Returns void

getEngineSearch playground for getEngine

  • Gets the Engine the texture belongs to.

    Returns ThinEngine

    The babylon engine

incrementReferencesSearch playground for incrementReferences

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

    Returns void

setParametersSearch playground for setParameters

  • 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

updateSizeSearch playground for updateSize

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

    Parameters

    • width: int

      defines the new width

    • height: int

      defines the new height

    • Optional depth: int

      defines the new depth (1 by default)

    Returns void

Legend

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