Class InternalTexture
Hierarchy (View Summary)
- TextureSampler
- InternalTexture
Constructors
constructor
-
new InternalTexture(
engine: AbstractEngine,
source: InternalTextureSource,
delayAllocation?: boolean,
): InternalTextureCreates a new InternalTexture
Parameters
- engine: AbstractEngine
defines the engine to use
- source: InternalTextureSource
defines the type of data that will be used
- delayAllocation: boolean = false
if the texture allocation should be delayed (default: false)
Returns InternalTexture
- engine: AbstractEngine
Properties
base Depth
Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)
base Height
Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)
base Width
Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)
depth
Gets the depth of the texture
format
Gets the format of the texture (RGB, RGBA...)
generate Mip Maps
Gets a boolean indicating if the texture needs mipmaps generation
height
Gets the height of the texture
invert Y
Gets a boolean indicating if the texture is inverted on Y axis
is2 D Array
Defines if the texture contains 2D array data
is3 D
Defines if the texture contains 3D data
is Cube
Defines if the texture is a cube texture
is Multiview
Defines if the texture contains multiview data
is Ready
Defines if the texture is ready
Optionallabel
General label used for debugging or storing a name.
mip Level Count
Gets the number of mip levels for this texture.
Note: This property has the correct value only if the texture was created through
createRawTexture, createRawTexture2DArray, or (on WebGPU) createRawTexture3D.
on Error Observable
Observable called when the texture load is raising an error
on Loaded Observable
Observable called when the texture is loaded
on Rebuild Callback
(
internalTexture: InternalTexture,
) => {
isAsync: boolean;
isReady: boolean;
proxy: Nullable<InternalTexture | Promise<InternalTexture>>;
},
> = null
If this callback is defined it will be called instead of the default _rebuild function
samples
Gets the number of samples used by the texture (WebGL2+ only)
sampling Mode
Gets the sampling mode of the texture
type
Gets the type of the texture (int, float...)
url
Gets the URL used to load this texture
width
Gets the width of the texture
Accessors
anisotropic Filtering Level
comparison Function
-
get comparisonFunction(): number
Gets or sets the comparison function (Constants.LESS, Constants.EQUAL, etc). Set 0 to not use a comparison function
Returns number
-
set comparisonFunction(value: number): void
Parameters
- value: number
Returns void
source
-
Gets the data source type of the texture
Returns InternalTextureSource
unique Id
-
get uniqueId(): number
Gets the unique id of the internal texture
Returns number
use Mip Maps
-
Indicates to use the mip maps (if available on the texture). Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!) If useMipMaps is null, the value of generateMipMaps is returned by the getter (for backward compatibility)
Returns Nullable<boolean>
-
Indicates to use the mip maps (if available on the texture). Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)
Parameters
- value: Nullable<boolean>
Returns void
wrap R
wrap U
wrap V
Methods
compare Sampler
-
Compares this sampler with another one
Parameters
- other: TextureSampler
sampler to compare with
Returns boolean
true if the samplers have the same parametres, else false
- other: TextureSampler
dispose
-
Dispose the current allocated resources
Returns void
get Engine
increment References
-
Increments the number of references (ie. the number of Texture that point to it)
Returns void
set Parameters
-
setParameters(
wrapU?: number,
wrapV?: number,
wrapR?: number,
anisotropicFilteringLevel?: number,
samplingMode?: number,
comparisonFunction?: number,
): TextureSamplerSets all the parameters of the sampler
Parameters
- wrapU: number = Constants.TEXTURE_WRAP_ADDRESSMODE
u address mode (default: TEXTURE_WRAP_ADDRESSMODE)
- wrapV: number = Constants.TEXTURE_WRAP_ADDRESSMODE
v address mode (default: TEXTURE_WRAP_ADDRESSMODE)
- wrapR: number = Constants.TEXTURE_WRAP_ADDRESSMODE
r address mode (default: TEXTURE_WRAP_ADDRESSMODE)
- anisotropicFilteringLevel: number = 1
anisotropic level (default: 1)
- samplingMode: number = Constants.TEXTURE_BILINEAR_SAMPLINGMODE
sampling mode (default: Constants.TEXTURE_BILINEAR_SAMPLINGMODE)
- comparisonFunction: number = 0
comparison function (default: 0 - no comparison function)
Returns TextureSampler
the current sampler instance
- wrapU: number = Constants.TEXTURE_WRAP_ADDRESSMODE
update Size
-
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
- depth: number = 1
defines the new depth (1 by default)
Returns void
- width: number
Class used to store data associated with WebGL texture data for the engine This class should not be used directly