Class HDRCubeTexture
Hierarchy
-
BaseTexture
- HDRCubeTexture
Implements
Index
Constructors
Properties
Accessors
Methods
- check
Transforms Are Identical - clone
- delay
Load - dispose
- get
Base Size - get
Class Name - get
Internal Texture - get
Reflection Texture Matrix - get
Scene - get
Size - get
Texture Matrix - is
Ready - is
Ready OrNot Blocking - read
Pixels - release
Internal Texture - scale
- serialize
- set
Reflection Texture Matrix - to
String - update
Sampling Mode - Parse
- When
All Ready
Constructors
constructor
-
Instantiates an HDRTexture from the following parameters.
Parameters
-
url: string
The location of the HDR raw data (Panorama stored in RGBE format)
-
sceneOrEngine: Scene | ThinEngine
The scene or engine the texture will be used in
-
size: number
The cubemap desired size (the more it increases the longer the generation will be)
-
Optional noMipmap: boolean
Forces to not generate the mipmap if true
-
Optional generateHarmonics: boolean
Specifies whether you want to extract the polynomial harmonics during the generation process
-
Optional gammaSpace: boolean
Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
-
Optional prefilterOnLoad: boolean
Prefilters HDR texture to allow use of this texture as a PBR reflection texture.
-
Optional onLoad: Nullable<() => void>
-
Optional onError: Nullable<(message?: string, exception?: any) => void>
Returns HDRCubeTexture
-
Properties
animationsSearch playground for animations
Define the list of animation attached to the texture.
anisotropic Filtering LevelSearch playground for anisotropicFilteringLevel
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.
bounding Box PositionSearch playground for boundingBoxPosition
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
coordinates IndexSearch playground for coordinatesIndex
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.
delay Load StateSearch playground for delayLoadState
Define the current state of the loading sequence when in delayed load mode.
get Alpha FromRGBSearch playground for getAlphaFromRGB
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.
invertZSearch playground for invertZ
Is Z inverted in the texture (useful in a cube texture).
is Render TargetSearch playground for isRenderTarget
Define if the texture is a render target.
levelSearch playground for level
Intensity or strength of the texture. It is commonly used by materials to fine tune the intensity of the texture
metadataSearch playground for metadata
Gets or sets an object used to store user defined information.
nameSearch playground for name
Define the name of the texture.
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the texture is disposed.
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
spherical PolynomialSearch playground for sphericalPolynomial
Get the polynomial representation of the texture data. This is mainly use as a fast way to recover IBL Diffuse irradiance data.
unique IdSearch playground for uniqueId
Gets or sets the unique id of the texture
urlSearch playground for url
The texture URL.
wrapRSearch playground for wrapR
Value | Type | Description |
---|---|---|
0 | CLAMP_ADDRESSMODE | |
1 | WRAP_ADDRESSMODE | |
2 | MIRROR_ADDRESSMODE |
Static DEFAULT_ ANISOTROPIC_ FILTERING_ LEVELSearch playground for DEFAULT_ANISOTROPIC_FILTERING_LEVEL
Default anisotropic filtering level for the application. It is set to 4 as a good tradeoff between perf and quality.
Accessors
bounding Box Size
-
Gets or sets the size of the bounding box associated with the cube texture When defined, the cubemap will switch to local mode
Returns Vector3
-
Gets or sets the size of the bounding box associated with the cube texture When defined, the cubemap will switch to local mode
Parameters
-
value: Vector3
Returns any
-
can Rescale
-
Get if the texture can rescale.
Returns boolean
coordinates Mode
-
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 Returns number
-
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 Parameters
-
value: number
Returns any
-
gamma Space
-
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
Returns boolean
-
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
Parameters
-
gamma: boolean
Returns any
-
has Alpha
-
Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
Returns boolean
-
Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
Parameters
-
value: boolean
Returns any
-
irradiance 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).
Returns Nullable<BaseTexture>
-
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).
Parameters
-
value: Nullable<BaseTexture>
Returns any
-
is2DArray
-
Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
Returns boolean
-
Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
Parameters
-
value: boolean
Returns any
-
is3D
-
Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
Returns boolean
-
Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
Parameters
-
value: boolean
Returns any
-
is Blocking
-
Gets wether or not the texture is blocking during loading.
Returns boolean
-
Sets wether or not the texture is blocking during loading.
Parameters
-
value: boolean
Returns any
-
is Cube
-
Define if the texture is a cube texture or if false a 2d texture.
Returns boolean
-
Define if the texture is a cube texture or if false a 2d texture.
Parameters
-
value: boolean
Returns any
-
isRGBD
-
Gets or sets whether or not the texture contains RGBD data.
Returns boolean
-
Gets or sets whether or not the texture contains RGBD data.
Parameters
-
value: boolean
Returns any
-
linear SpecularLOD
-
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.
Returns boolean
-
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.
Parameters
-
value: boolean
Returns any
-
lod Generation Offset
-
With prefiltered texture, defined the offset used during the prefiltering steps.
Returns number
-
With prefiltered texture, defined the offset used during the prefiltering steps.
Parameters
-
value: number
Returns any
-
lod Generation Scale
-
With prefiltered texture, defined the scale used during the prefiltering steps.
Returns number
-
With prefiltered texture, defined the scale used during the prefiltering steps.
Parameters
-
value: number
Returns any
-
no Mipmap
-
Are mip maps generated for this texture or not.
Returns boolean
on Dispose
-
Callback triggered when the texture has been disposed. Kept for back compatibility, you can use the onDisposeObservable instead.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
rotationY
-
Gets texture matrix rotation angle around Y axis radians.
Returns number
-
Sets texture matrix rotation angle around Y axis in radians.
Parameters
-
value: number
Returns any
-
texture Format
-
Get the texture underlying format (RGB, RGBA...)
Returns number
texture Type
-
Get the texture underlying type (INT, FLOAT...)
Returns number
uid
-
Define the unique id of the texture in the scene.
Returns string
wrapU
-
Value Type Description 0 CLAMP_ADDRESSMODE 1 WRAP_ADDRESSMODE 2 MIRROR_ADDRESSMODE Returns number
-
Value Type Description 0 CLAMP_ADDRESSMODE 1 WRAP_ADDRESSMODE 2 MIRROR_ADDRESSMODE Parameters
-
value: number
Returns any
-
wrapV
-
Value Type Description 0 CLAMP_ADDRESSMODE 1 WRAP_ADDRESSMODE 2 MIRROR_ADDRESSMODE Returns number
-
Value Type Description 0 CLAMP_ADDRESSMODE 1 WRAP_ADDRESSMODE 2 MIRROR_ADDRESSMODE Parameters
-
value: number
Returns any
-
Methods
check Transforms Are IdenticalSearch playground for checkTransformsAreIdentical
-
Checks if the texture has the same transform matrix than another texture
Parameters
-
texture: Nullable<BaseTexture>
texture to check against
Returns boolean
true if the transforms are the same, else false
-
cloneSearch playground for clone
-
Returns HDRCubeTexture
delay LoadSearch playground for delayLoad
-
Returns void
disposeSearch playground for dispose
-
Dispose the texture and release its associated resources.
Returns void
get Base SizeSearch playground for getBaseSize
-
Get the base size of the texture. It can be different from the size if the texture has been resized for POT for instance
Returns ISize
the base size
get Class NameSearch playground for getClassName
-
Get the current class name of the texture useful for serialization or dynamic coding.
Returns string
"HDRCubeTexture"
get Internal TextureSearch playground for getInternalTexture
-
Get the underlying lower level texture from Babylon.
Returns Nullable<InternalTexture>
the insternal texture
get Reflection Texture MatrixSearch playground for getReflectionTextureMatrix
-
Get the texture reflection matrix used to rotate/transform the reflection.
Returns Matrix
the reflection matrix
get SceneSearch playground for getScene
get SizeSearch playground for getSize
-
Get the size of the texture.
Returns ISize
the texture size.
get Texture MatrixSearch playground for getTextureMatrix
-
Get the texture transform matrix used to offset tile the texture for istance.
Returns Matrix
the transformation matrix
is ReadySearch playground for isReady
-
Get if the texture is ready to be used (downloaded, converted, mip mapped...).
Returns boolean
true if fully ready
is Ready OrNot BlockingSearch playground for isReadyOrNotBlocking
-
Get if the texture is ready to be consumed (either it is ready or it is not blocking)
Returns boolean
true if ready or not blocking
read PixelsSearch playground for readPixels
-
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.
Parameters
-
Optional faceIndex: number
defines the face of the texture to read (in case of cube texture)
-
Optional level: number
defines the LOD level of the texture to read (in case of Mip Maps)
-
Optional buffer: Nullable<ArrayBufferView>
defines a user defined buffer to fill with data (can be null)
-
Optional flushRenderer: boolean
true to flush the renderer from the pending commands before reading the pixels
Returns Nullable<Promise<ArrayBufferView>>
The Array buffer promise containing the pixels data.
-
release Internal TextureSearch playground for releaseInternalTexture
-
Release and destroy the underlying lower level texture aka internalTexture.
Returns void
scaleSearch playground for scale
-
Scales the texture if is
canRescale()
Parameters
-
ratio: number
the resize factor we want to use to rescale
Returns void
-
serializeSearch playground for serialize
-
Returns any
set Reflection Texture MatrixSearch playground for setReflectionTextureMatrix
-
Set the texture reflection matrix used to rotate/transform the reflection.
Parameters
-
value: Matrix
Define the reflection matrix to set
Returns void
-
to StringSearch playground for toString
-
Return a string representation of the texture.
Returns string
the texture as a string
update Sampling ModeSearch playground for updateSamplingMode
-
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
Parameters
-
samplingMode: number
Define the new sampling mode of the texture
Returns void
-
Static ParseSearch playground for Parse
-
Parses a JSON representation of an HDR Texture in order to create the texture
Parameters
-
parsedTexture: any
Define the JSON representation
-
scene: Scene
Define the scene the texture should be created in
-
rootUrl: string
Define the root url in case we need to load relative dependencies
Returns Nullable<HDRCubeTexture>
the newly created texture after parsing
-
Static When All ReadySearch playground for WhenAllReady
-
Helper function to be called back once a list of texture contains only ready textures.
Parameters
-
textures: BaseTexture[]
Define the list of textures to wait for
-
callback: () => void
Define the callback triggered once the entire list will be ready
-
-
Returns void
-
-
Returns void
-
This represents a texture coming from an HDR input.
The only supported format is currently panorama picture stored in RGBE format. Example of such files can be found on HDRLib: http://hdrlib.com/