Creates a cube texture where the raw buffers are passed in.
defines the scene the texture is attached to
defines the array of data to use to create each face
defines the size of the textures
defines the format of the data
defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
defines if the engine should generate the mip levels
defines if data must be stored with Y axis inverted
defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
defines the compression used (null by default)
Define the list of animation attached to the texture.
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. This defaults to 4 as it seems to be the best tradeoff.
Gets or sets the center of the bounding box associated with the cube texture. It must define where the camera used to render the texture was set
Returns the bounding box size
Get if the texture can rescale.
Define the UV chanel to use starting from 0 and defaulting to 0. This is part of the texture as textures usually maps to one uv set.
How a texture is mapped.
Value | Type | Description |
---|---|---|
0 | EXPLICIT_MODE | |
1 | SPHERICAL_MODE | |
2 | PLANAR_MODE | |
3 | CUBIC_MODE | |
4 | PROJECTION_MODE | |
5 | SKYBOX_MODE | |
6 | INVCUBIC_MODE | |
7 | EQUIRECTANGULAR_MODE | |
8 | FIXED_EQUIRECTANGULAR_MODE | |
9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE |
Define the current state of the loading sequence when in delayed load mode.
Define if the texture contains data in gamma space (most of the png/jpg aside bump). HDR texture are usually stored in linear space. This only impacts the PBR and Background materials
Defines if the alpha value should be determined via the rgb values. If true the luminance of the pixel might be used to find the corresponding alpha value.
Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
Is Z inverted in the texture (useful in a cube texture).
In case a better definition than spherical harmonics is required for the diffuse part of the environment. You can set the irradiance texture to rely on a texture instead of the spherical approach. This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).
Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
Define if the texture is preventinga material to render or not. If not and the texture is not ready, the engine will use a default black texture instead.
Define if the texture is a cube texture or if false a 2d texture.
Gets a boolean indicating if the cube texture contains prefiltered mips (used to simulate roughness with PBR)
Gets or sets whether or not the texture contains RGBD data.
Define if the texture is a render target.
Intensity or strength of the texture. It is commonly used by materials to fine tune the intensity of the texture
With prefiltered texture, defined if the specular generation is based on a linear ramp. By default we are using a log2 of the linear roughness helping to keep a better resolution for average roughness values.
With prefiltered texture, defined the offset used during the prefiltering steps.
With prefiltered texture, defined the scale used during the prefiltering steps.
Gets or sets an object used to store user defined information.
Define the name of the texture.
Are mip maps generated for this texture or not.
Callback triggered when the texture has been disposed. Kept for back compatibility, you can use the onDisposeObservable instead.
An event triggered when the texture is disposed.
For internal use only. Please do not use.
Gets texture matrix rotation angle around Y axis radians.
Get the texture underlying format (RGB, RGBA...)
Get the texture underlying type (INT, FLOAT...)
Define the unique id of the texture in the scene.
Gets or sets the unique id of the texture
The url of the texture
Value | Type | Description |
---|---|---|
0 | CLAMP_ADDRESSMODE | |
1 | WRAP_ADDRESSMODE | |
2 | MIRROR_ADDRESSMODE |
Value | Type | Description |
---|---|---|
0 | CLAMP_ADDRESSMODE | |
1 | WRAP_ADDRESSMODE | |
2 | MIRROR_ADDRESSMODE |
Value | Type | Description |
---|---|---|
0 | CLAMP_ADDRESSMODE | |
1 | WRAP_ADDRESSMODE | |
2 | MIRROR_ADDRESSMODE |
Default anisotropic filtering level for the application. It is set to 4 as a good tradeoff between perf and quality.
Clones the raw cube texture.
a new cube texture
Delays loading of the cube texture
defines the extension to use
Dispose the texture and release its associated resources.
Get the base size of the texture. It can be different from the size if the texture has been resized for POT for instance
the base size
Get the current class name of the texture useful for serialization or dynamic coding.
"CubeTexture"
Get the underlying lower level texture from Babylon.
the insternal texture
Returns the reflection texture matrix
the reflection texture matrix
Get the size of the texture.
the texture size.
Get the texture transform matrix used to offset tile the texture for istance.
the transformation matrix
Get if the texture is ready to be used (downloaded, converted, mip mapped...).
true if fully ready
Get if the texture is ready to be consumed (either it is ready or it is not blocking)
true if ready or not blocking
Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer. This will returns an RGBA array buffer containing either in values (0-255) or float values (0-1) depending of the underlying buffer type.
defines the face of the texture to read (in case of cube texture)
defines the LOD level of the texture to read (in case of Mip Maps)
defines a user defined buffer to fill with data (can be null)
The Array buffer containing the pixels data.
Release and destroy the underlying lower level texture aka internalTexture.
Scales the texture if is canRescale()
the resize factor we want to use to rescale
Serialize the texture into a JSON representation that can be parsed later on.
the JSON representation of the texture
Sets the reflection texture matrix
Reflection texture matrix
Return a string representation of the texture.
the texture as a string
Updates the raw cube texture.
defines the data to store
defines the data format
defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
defines if data must be stored with Y axis inverted
defines the compression used (null by default)
Updates a raw cube texture with RGBD encoded data.
defines the array of data [mipmap][face] to use to create each face
defines the spherical polynomial for irradiance
defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
a promsie that resolves when the operation is complete
Update the sampling mode of the texture. Default is Trilinear mode.
Value | Type | Description |
---|---|---|
1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear |
2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |
3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |
4 | NEAREST_NEAREST_MIPNEAREST | |
5 | NEAREST_LINEAR_MIPNEAREST | |
6 | NEAREST_LINEAR_MIPLINEAR | |
7 | NEAREST_LINEAR | |
8 | NEAREST_NEAREST | |
9 | LINEAR_NEAREST_MIPNEAREST | |
10 | LINEAR_NEAREST_MIPLINEAR | |
11 | LINEAR_LINEAR | |
12 | LINEAR_NEAREST |
mag: magnification filter (close to the viewer) min: minification filter (far from the viewer) mip: filter used between mip map levels
Define the new sampling mode of the texture
Update the url (and optional buffer) of this texture if url was null during construction.
the url of the texture
defines the extension to use
callback called when the texture is loaded (defaults to null)
Creates a cube texture from an array of image urls
defines an array of image urls
defines the hosting scene
specifies if mip maps are not used
a cube texture
Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.
defines the url of the prefiltered texture
defines the scene the texture is attached to
defines the extension of the file if different from the url
defines whether or not to create polynomial harmonics from the texture data if necessary
the prefiltered texture
Parses text to create a cube texture
define the serialized text to read from
defines the hosting scene
defines the root url of the cube texture
a cube texture
Helper function to be called back once a list of texture contains only ready textures.
Define the list of textures to wait for
Define the callback triggered once the entire list will be ready
Generated using TypeDoc
Raw cube texture where the raw buffers are passed in