API

Interface IProceduralTextureCreationOptions

Options to create a procedural texture

interface IProceduralTextureCreationOptions {
    colorAttachment?: InternalTexture;
    creationFlags?: number;
    delayAllocation?: boolean;
    doNotChangeAspectRatio?: boolean;
    enableClusteredLights?: boolean;
    existingObjectRenderer?: any;
    extraInitializationsAsync?: () => Promise<void>;
    fallbackTexture?: Nullable<Texture>;
    format?: number;
    gammaSpace?: boolean;
    generateDepthBuffer?: boolean;
    generateMipMaps?: boolean;
    generateStencilBuffer?: boolean;
    isCube?: boolean;
    isMulti?: boolean;
    noColorAttachment?: boolean;
    samples?: number;
    samplingMode?: number;
    shaderLanguage?: any;
    skipSceneRegistration?: boolean;
    type?: number;
    useSRGBBuffer?: boolean;
}

Hierarchy (View Summary)

Index
colorAttachment?: InternalTexture

Specifies the internal texture to use directly instead of creating one (ignores noColorAttachment flag when set) *

creationFlags?: number

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

delayAllocation?: boolean

True (default: false) if the texture allocation should be delayed

doNotChangeAspectRatio?: boolean

True (default) to not change the aspect ratio of the scene in the RTT

enableClusteredLights?: boolean

True to enable clustered lights (default: false)

existingObjectRenderer?: any

If not provided (default), a new object renderer instance will be created

extraInitializationsAsync?: () => Promise<void>

Additional async code to run before preparing the effect

fallbackTexture?: Nullable<Texture>

Defines a fallback texture in case there were issues to create the custom texture

format?: number

The internal format of the buffer in the RTT (RED, RG, RGB, RGBA (default), ALPHA...)

gammaSpace?: boolean

Defines the underlying texture texture space

generateDepthBuffer?: boolean

True (default) to generate a depth buffer

generateMipMaps?: boolean

True (default: false) if mipmaps need to be generated after render

generateStencilBuffer?: boolean

True (default: false) to generate a stencil buffer

isCube?: boolean

True (default: false) if a cube texture needs to be created

isMulti?: boolean

True (default: false) if multiple textures need to be created (Draw Buffers)

noColorAttachment?: boolean

True (default: false) to indicate that no color target should be created. (e.g., if you only want to write to the depth buffer)

samples?: number

Sample count to use when creating the RTT

samplingMode?: number

The sampling mode to be used with the render target (Trilinear (default), Linear, Nearest...)

shaderLanguage?: any

The shader language of the shader. (default: GLSL)

skipSceneRegistration?: boolean

When true the texture will not be pushed onto scene.proceduralTextures and will therefore never be rendered automatically by the scene render loop. Use this for one-shot or manually-driven textures that manage their own render lifecycle.

type?: number

The type of the buffer in the RTT (byte (default), half float, float...)

useSRGBBuffer?: boolean

True (default: false) to create a SRGB texture