Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to generate noise procedural textures

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new NoiseProceduralTexture

    Parameters

    • name: string

      defines the name fo the texture

    • Optional size: number

      defines the size of the texture (default is 256)

    • Optional scene: Nullable<Scene>

      defines the hosting scene

    • Optional fallbackTexture: Texture

      defines the texture to use if the NoiseProceduralTexture can't be created

    • Optional generateMipMaps: boolean

      defines if mipmaps must be generated (true by default)

    Returns NoiseProceduralTexture

Properties

_buffer: Nullable<string | ArrayBufferView | Blob | ArrayBuffer | HTMLImageElement | ImageBitmap>
internal
_forceSerialize: boolean
internal
_generateMipMaps: boolean
internal
_invertY: boolean
internal
_parentContainer: Nullable<AbstractScene>
internal
_prefiltered: boolean
internal
internal
_textures: {}
internal

Type declaration

animationSpeedFactor: number

Gets or sets animation speed factor (default is 1)

animations: Animation[]

Define the list of animation attached to the texture.

anisotropicFilteringLevel: 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. This defaults to 4 as it seems to be the best tradeoff.

autoClear: boolean

Define if the texture must be cleared before rendering (default is true)

brightness: number

Gets or sets a value between 0 and 1 indicating the overall brightness of the texture (default is 0.2)

delayLoadState: number

Define the current state of the loading sequence when in delayed load mode.

homogeneousRotationInUVTransform: boolean

Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling

inspectableCustomProperties: Nullable<IInspectable[]>

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/how_to/debug_layer#extensibility

invertZ: boolean

Is Z inverted in the texture (useful in a cube texture).

isEnabled: boolean

Define if the texture is enabled or not (disabled texture will not render)

isRenderTarget: boolean

Define if the texture is a render target.

level: number

Intensity or strength of the texture. It is commonly used by materials to fine tune the intensity of the texture

lodLevelInAlpha: boolean
internal
metadata: any

Gets or sets an object used to store user defined information.

name: string

Define the name of the texture.

nodeMaterialSource: Nullable<NodeMaterial>

Gets or sets the node material used to create this texture (null if the texture was manually created)

octaves: number

Defines the number of octaves to process

onBeforeGenerationObservable: Observable<ProceduralTexture>

Event raised before the texture is generated

onDisposeObservable: Observable<BaseTexture>

An event triggered when the texture is disposed.

onGenerated: (() => void)

Type declaration

    • (): void
    • Callback called when the texture is generated

      Returns void

onGeneratedObservable: Observable<ProceduralTexture>

Event raised when the texture is generated

onLoadObservable: Observable<Texture>

Observable triggered once the texture has been loaded.

optimizeUVAllocation: boolean

Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation. (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)

persistence: number

Defines the level of persistence (0.8 by default)

reservedDataStore: any

For internal use only. Please do not use.

sphericalPolynomial: Nullable<SphericalPolynomial>

Get the polynomial representation of the texture data. This is mainly use as a fast way to recover IBL Diffuse irradiance data.

see

https://learnopengl.com/PBR/IBL/Diffuse-irradiance

time: number

Gets or sets the start time (default is 0)

uAng: number

Define an offset on the texture to rotate around the u coordinates of the UVs The angle is defined in radians.

see

https://doc.babylonjs.com/how_to/more_materials

uOffset: number

Define an offset on the texture to offset the u coordinates of the UVs

see

https://doc.babylonjs.com/how_to/more_materials#offsetting

uRotationCenter: number

Defines the center of rotation (U)

uScale: number

Define an offset on the texture to scale the u coordinates of the UVs

see

https://doc.babylonjs.com/how_to/more_materials#tiling

uniqueId: number

Gets or sets the unique id of the texture

url: Nullable<string>

Define the url of the texture.

vAng: number

Define an offset on the texture to rotate around the v coordinates of the UVs The angle is defined in radians.

see

https://doc.babylonjs.com/how_to/more_materials

vOffset: number

Define an offset on the texture to offset the v coordinates of the UVs

see

https://doc.babylonjs.com/how_to/more_materials#offsetting

vRotationCenter: number

Defines the center of rotation (V)

vScale: number

Define an offset on the texture to scale the v coordinates of the UVs

see

https://doc.babylonjs.com/how_to/more_materials#tiling

wAng: number

Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture) The angle is defined in radians.

see

https://doc.babylonjs.com/how_to/more_materials

wRotationCenter: number

Defines the center of rotation (W)

wrapR: number
ValueTypeDescription
0CLAMP_ADDRESSMODE
1WRAP_ADDRESSMODE
2MIRROR_ADDRESSMODE
BILINEAR_SAMPLINGMODE: 2 = 2

Bilinear is mag = linear and min = linear and mip = nearest

CLAMP_ADDRESSMODE: 0 = 0

Texture is not repeating outside of 0..1 UVs

CUBIC_MODE: 3 = 3

Cubic coordinates mode

DEFAULT_ANISOTROPIC_FILTERING_LEVEL: number

Default anisotropic filtering level for the application. It is set to 4 as a good tradeoff between perf and quality.

EQUIRECTANGULAR_MODE: 7 = 7

Equirectangular coordinates mode

EXPLICIT_MODE: 0 = 0

Explicit coordinates mode

FIXED_EQUIRECTANGULAR_MIRRORED_MODE: 9 = 9

Equirectangular Fixed Mirrored coordinates mode

FIXED_EQUIRECTANGULAR_MODE: 8 = 8

Equirectangular Fixed coordinates mode

ForceSerializeBuffers: boolean

Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process. If no buffer exists, one will be created as base64 string from the internal webgl data.

INVCUBIC_MODE: 6 = 6

Inverse Cubic coordinates mode

LINEAR_LINEAR: 2 = 2

mag = linear and min = linear and mip = none

LINEAR_LINEAR_MIPLINEAR: 3 = 3

Trilinear is mag = linear and min = linear and mip = linear

LINEAR_LINEAR_MIPNEAREST: 11 = 11

Bilinear is mag = linear and min = linear and mip = nearest

LINEAR_NEAREST: 12 = 12

mag = linear and min = nearest and mip = none

LINEAR_NEAREST_MIPLINEAR: 10 = 10

mag = linear and min = nearest and mip = linear

LINEAR_NEAREST_MIPNEAREST: 9 = 9

mag = linear and min = nearest and mip = nearest

MIRROR_ADDRESSMODE: 2 = 2

Texture is repeating and mirrored

NEAREST_LINEAR: 7 = 7

mag = nearest and min = linear and mip = none

NEAREST_LINEAR_MIPLINEAR: 6 = 6

mag = nearest and min = linear and mip = linear

NEAREST_LINEAR_MIPNEAREST: 5 = 5

mag = nearest and min = linear and mip = nearest

NEAREST_NEAREST: 1 = 1

mag = nearest and min = nearest and mip = none

NEAREST_NEAREST_MIPLINEAR: 8 = 8

nearest is mag = nearest and min = nearest and mip = linear

NEAREST_NEAREST_MIPNEAREST: 4 = 4

mag = nearest and min = nearest and mip = nearest

NEAREST_SAMPLINGMODE: 1 = 1

nearest is mag = nearest and min = nearest and mip = linear

OnTextureLoadErrorObservable: Observable<BaseTexture>

This observable will notify when any texture had a loading error

PLANAR_MODE: 2 = 2

Planar coordinates mode

PROJECTION_MODE: 4 = 4

Projection coordinates mode

SKYBOX_MODE: 5 = 5

Inverse Cubic coordinates mode

SPHERICAL_MODE: 1 = 1

Spherical coordinates mode

SerializeBuffers: boolean

Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process

TRILINEAR_SAMPLINGMODE: 3 = 3

Trilinear is mag = linear and min = linear and mip = linear

UseSerializedUrlIfAny: boolean

Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file

WRAP_ADDRESSMODE: 1 = 1

Texture is repeating outside of 0..1 UVs

_CreateMirror: ((name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean) => MirrorTexture)

Type declaration

    • (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean): MirrorTexture
    • internal

      Parameters

      • name: string
      • renderTargetSize: number
      • scene: Scene
      • generateMipMaps: boolean

      Returns MirrorTexture

_CreateRenderTargetTexture: ((name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean, creationFlags?: number) => RenderTargetTexture)

Type declaration

    • (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean, creationFlags?: number): RenderTargetTexture
    • internal

      Parameters

      • name: string
      • renderTargetSize: number
      • scene: Scene
      • generateMipMaps: boolean
      • Optional creationFlags: number

      Returns RenderTargetTexture

_CubeTextureParser: ((jsonTexture: any, scene: Scene, rootUrl: string) => CubeTexture)

Type declaration

Accessors

  • internal

    Returns Nullable<BaseTexture>

  • internal

    Returns Nullable<BaseTexture>

  • internal

    Returns Nullable<BaseTexture>

  • get canRescale(): boolean
  • Get if the texture can rescale.

    Returns boolean

  • get coordinatesIndex(): number
  • set coordinatesIndex(value: number): void
  • Define the UV channel to use starting from 0 and defaulting to 0. This is part of the texture as textures usually maps to one uv set.

    Returns number

  • Define the UV channel to use starting from 0 and defaulting to 0. This is part of the texture as textures usually maps to one uv set.

    Parameters

    • value: number

    Returns void

  • get coordinatesMode(): number
  • set coordinatesMode(value: number): void
  • How a texture is mapped.

    ValueTypeDescription
    0EXPLICIT_MODE
    1SPHERICAL_MODE
    2PLANAR_MODE
    3CUBIC_MODE
    4PROJECTION_MODE
    5SKYBOX_MODE
    6INVCUBIC_MODE
    7EQUIRECTANGULAR_MODE
    8FIXED_EQUIRECTANGULAR_MODE
    9FIXED_EQUIRECTANGULAR_MIRRORED_MODE

    Returns number

  • How a texture is mapped.

    ValueTypeDescription
    0EXPLICIT_MODE
    1SPHERICAL_MODE
    2PLANAR_MODE
    3CUBIC_MODE
    4PROJECTION_MODE
    5SKYBOX_MODE
    6INVCUBIC_MODE
    7EQUIRECTANGULAR_MODE
    8FIXED_EQUIRECTANGULAR_MODE
    9FIXED_EQUIRECTANGULAR_MIRRORED_MODE

    Parameters

    • value: number

    Returns void

  • get errorObject(): undefined | { exception?: any; message?: string }
  • If a loading error occurred this object will be populated with information about the error.

    Returns undefined | { exception?: any; message?: string }

  • get gammaSpace(): boolean
  • set gammaSpace(gamma: boolean): void
  • 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 void

  • get getAlphaFromRGB(): boolean
  • set getAlphaFromRGB(value: boolean): void
  • 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.

    Returns boolean

  • 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.

    Parameters

    • value: boolean

    Returns void

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

  • get invertY(): boolean
  • Gets a boolean indicating if the texture needs to be inverted on the y axis during loading

    Returns boolean

  • 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

    Returns void

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

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

  • get isBlocking(): boolean
  • set isBlocking(value: boolean): void
  • Is the texture preventing material to render while loading. If false, a default texture will be used instead of the loading one during the preparation step.

    Returns boolean

  • Is the texture preventing material to render while loading. If false, a default texture will be used instead of the loading one during the preparation step.

    Parameters

    • value: boolean

    Returns void

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

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

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

  • get loadingError(): boolean
  • Was there any loading error?

    Returns boolean

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

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

  • get mimeType(): undefined | string
  • Returns the texture mime type if it was defined by a loader (undefined else)

    Returns undefined | string

  • get noMipmap(): boolean
  • Are mip maps generated for this texture or not.

    Returns boolean

  • set onDispose(callback: (() => void)): void
  • Callback triggered when the texture has been disposed. Kept for back compatibility, you can use the onDisposeObservable instead.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • get refreshRate(): number
  • set refreshRate(value: number): void
  • Define the refresh rate of the texture or the rendering frequency. Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...

    Returns number

  • Define the refresh rate of the texture or the rendering frequency. Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...

    Parameters

    • value: number

    Returns void

  • get samplingMode(): number
  • Get the current sampling mode associated with the texture.

    Returns number

  • get textureFormat(): number
  • Get the texture underlying format (RGB, RGBA...)

    Returns number

  • get textureType(): number
  • Get the texture underlying type (INT, FLOAT...)

    Returns number

  • get uid(): string
  • Define the unique id of the texture in the scene.

    Returns string

  • get wrapU(): number
  • set wrapU(value: number): void
  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns number

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    • value: number

    Returns void

  • get wrapV(): number
  • set wrapV(value: number): void
  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Returns number

  • ValueTypeDescription
    0CLAMP_ADDRESSMODE
    1WRAP_ADDRESSMODE
    2MIRROR_ADDRESSMODE

    Parameters

    • value: number

    Returns void

Methods

  • _getFromCache(url: Nullable<string>, noMipmap: boolean, sampling?: number, invertY?: boolean, useSRGBBuffer?: boolean, isCube?: boolean): Nullable<InternalTexture>
  • _readPixelsSync(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean): Nullable<ArrayBufferView>
  • internal

    Parameters

    • Optional faceIndex: number
    • Optional level: number
    • Optional buffer: Nullable<ArrayBufferView>
    • Optional flushRenderer: boolean
    • Optional noDataConversion: boolean

    Returns Nullable<ArrayBufferView>

  • _rebuild(): void
  • _setEffect(effect: Effect): void
  • _shouldRender(): boolean
  • Checks if the texture has the same transform matrix than another texture

    Parameters

    Returns boolean

    true if the transforms are the same, else false

  • delayLoad(): void
  • Finish the loading sequence of a texture flagged as delayed load.

    internal

    Returns void

  • dispose(): void
  • Dispose the texture and release its associated resources.

    Returns void

  • forceSphericalPolynomialsRecompute(): void
  • Force recomputation of spherical polynomials. Can be useful if you generate a cubemap multiple times (from a probe for eg) and you need the proper polynomials each time

    Returns void

  • 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

  • getClassName(): string
  • Get the current class name of the texture useful for serialization or dynamic coding.

    Returns string

    "Texture"

  • getContent(): Nullable<Promise<ArrayBufferView>>
  • Gets texture content (Use this function wisely as reading from a texture can be slow)

    Returns Nullable<Promise<ArrayBufferView>>

    an ArrayBufferView promise (Uint8Array or Float32Array)

  • The effect that is created when initializing the post process.

    Returns Effect

    The created effect corresponding the the postprocess.

  • getReflectionTextureMatrix(): Matrix
  • Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.

    Returns Matrix

    The reflection texture transform

  • Get the size of the texture.

    Returns ISize

    the texture size.

  • getTextureMatrix(uBase?: number): Matrix
  • Get the current texture matrix which includes the requested offsetting, tiling and rotation components.

    Parameters

    • Optional uBase: number

    Returns Matrix

    the transform matrix of the texture.

  • isReady(): boolean
  • Is the texture ready to be used ? (rendered at least once)

    Returns boolean

    true if ready, otherwise, false.

  • isReadyOrNotBlocking(): boolean
  • Get if the texture is ready to be consumed (either it is ready or it is not blocking)

    Returns boolean

    true if ready, not blocking or if there was an error loading the texture

  • readPixels(faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number, width?: number, height?: number): Nullable<Promise<ArrayBufferView>>
  • 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

    • Optional noDataConversion: boolean

      false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture

    • Optional x: number

      defines the region x coordinates to start reading from (default to 0)

    • Optional y: number

      defines the region y coordinates to start reading from (default to 0)

    • Optional width: number

      defines the region width to read from (default to the texture size at level)

    • Optional height: number

      defines the region width to read from (default to the texture size at level)

    Returns Nullable<Promise<ArrayBufferView>>

    The Array buffer promise containing the pixels data.

  • releaseInternalTexture(): void
  • render(useCameraPostProcess?: boolean): void
  • Generate the current state of the procedural texture

    Parameters

    • Optional useCameraPostProcess: boolean

    Returns void

  • reset(): void
  • Resets the texture in order to recreate its associated resources. This can be called in case of context loss

    Returns void

  • resetRefreshCounter(): void
  • Resets the refresh counter of the texture and start bak from scratch. Could be useful to regenerate the texture if it is setup to render only once.

    Returns void

  • resize(size: TextureSize, generateMipMaps: boolean): void
  • Resize the texture to new value.

    Parameters

    • size: TextureSize

      Define the new size the texture should have

    • generateMipMaps: boolean

      Define whether the new texture should create mip maps

    Returns void

  • scale(ratio: number): void
  • Scales the texture if is canRescale()

    Parameters

    • ratio: number

      the resize factor we want to use to rescale

    Returns void

  • serialize(): any
  • Serializes this noise procedural texture

    Returns any

    a serialized noise procedural texture object

  • Set a vec3 in the shader from a Color3.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: Color3

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a vec4 in the shader from a Color4.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: Color4

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a float in the shader.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: number

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set an array of floats in the shader.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: number[]

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • setFragment(fragment: any): void
  • Set the fragment shader to use in order to render the texture.

    Parameters

    • fragment: any

      This can be set to a path (into the shader store) or to a json object containing a fragmentElement property.

    Returns void

  • Set a int in the shader.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: number

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a mat4 in the shader from a MAtrix.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: Matrix

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a texture in the shader program used to render.

    Parameters

    • name: string

      Define the name of the uniform samplers as defined in the shader

    • texture: Texture

      Define the texture to bind to this sampler

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a vec2 in the shader from a Vector2.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: Vector2

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • Set a vec3 in the shader from a Vector3.

    Parameters

    • name: string

      Define the name of the uniform as defined in the shader

    • value: Vector3

      Define the value to give to the uniform

    Returns ProceduralTexture

    the texture itself allowing "fluent" like uniform updates

  • toString(): string
  • Return a string representation of the texture.

    Returns string

    the texture as a string

  • updateSamplingMode(samplingMode: number): void
  • Update the sampling mode of the texture. Default is Trilinear mode.

    ValueTypeDescription
    1NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEARNearest is: mag = nearest, min = nearest, mip = linear
    2BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEARESTBilinear is: mag = linear, min = linear, mip = nearest
    3TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEARTrilinear is: mag = linear, min = linear, mip = linear
    4NEAREST_NEAREST_MIPNEAREST
    5NEAREST_LINEAR_MIPNEAREST
    6NEAREST_LINEAR_MIPLINEAR
    7NEAREST_LINEAR
    8NEAREST_NEAREST
    9LINEAR_NEAREST_MIPNEAREST
    10LINEAR_NEAREST_MIPLINEAR
    11LINEAR_LINEAR
    12LINEAR_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

  • updateURL(url: string, buffer?: Nullable<string | ArrayBufferView | Blob | ArrayBuffer | HTMLImageElement>, onLoad?: (() => void), forcedExtension?: string): void
  • Update the url (and optional buffer) of this texture if url was null during construction.

    Parameters

    • url: string

      the url of the texture

    • Optional buffer: Nullable<string | ArrayBufferView | Blob | ArrayBuffer | HTMLImageElement>

      the buffer of the texture (defaults to null)

    • Optional onLoad: (() => void)

      callback called when the texture is loaded (defaults to null)

        • (): void
        • Returns void

    • Optional forcedExtension: string

      defines the extension to use to pick the right loader

    Returns void

  • CreateFromBase64String(data: string, name: string, scene: Scene, noMipmapOrOptions?: boolean | ITextureCreationOptions, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<(() => void)>, onError?: Nullable<(() => void)>, format?: number, creationFlags?: number): Texture
  • Creates a texture from its base 64 representation.

    Parameters

    • data: string

      Define the base64 payload without the data: prefix

    • name: string

      Define the name of the texture in the scene useful fo caching purpose for instance

    • scene: Scene

      Define the scene the texture should belong to

    • Optional noMipmapOrOptions: boolean | ITextureCreationOptions

      defines if the texture will require mip maps or not or set of all options to create the texture

    • Optional invertY: boolean

      define if the texture needs to be inverted on the y axis during loading

    • Optional samplingMode: number

      define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)

    • Optional onLoad: Nullable<(() => void)>

      define a callback triggered when the texture has been loaded

    • Optional onError: Nullable<(() => void)>

      define a callback triggered when an error occurred during the loading session

    • Optional format: number

      define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)

    • Optional creationFlags: number

      specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)

    Returns Texture

    the created texture

  • LoadFromDataString(name: string, buffer: any, scene: Scene, deleteBuffer?: boolean, noMipmapOrOptions?: boolean | ITextureCreationOptions, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<(() => void)>, onError?: Nullable<((message?: string, exception?: any) => void)>, format?: number, creationFlags?: number): Texture
  • Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)

    Parameters

    • name: string

      Define the name of the texture in the scene useful fo caching purpose for instance

    • buffer: any

      define the buffer to load the texture from in case the texture is loaded from a buffer representation

    • scene: Scene

      Define the scene the texture should belong to

    • Optional deleteBuffer: boolean

      define if the buffer we are loading the texture from should be deleted after load

    • Optional noMipmapOrOptions: boolean | ITextureCreationOptions

      defines if the texture will require mip maps or not or set of all options to create the texture

    • Optional invertY: boolean

      define if the texture needs to be inverted on the y axis during loading

    • Optional samplingMode: number

      define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)

    • Optional onLoad: Nullable<(() => void)>

      define a callback triggered when the texture has been loaded

    • Optional onError: Nullable<((message?: string, exception?: any) => void)>

      define a callback triggered when an error occurred during the loading session

    • Optional format: number

      define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)

    • Optional creationFlags: number

      specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)

    Returns Texture

    the created texture

  • Creates a NoiseProceduralTexture from parsed noise procedural texture data

    Parameters

    • parsedTexture: any

      defines parsed texture data

    • scene: Scene

      defines the current scene

    Returns NoiseProceduralTexture

    a parsed NoiseProceduralTexture

  • WhenAllReady(textures: BaseTexture[], callback: (() => void)): void
  • 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

        • (): void
        • Returns void

    Returns void

Legend

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

Settings

Theme