EffectWrapperCreationOptions | Babylon.js API documentation

API
Babylon.js API documentation
    Preparing search index...

    Interface EffectWrapperCreationOptions

    Options to create an EffectWrapper

    interface EffectWrapperCreationOptions {
        allowEmptySourceTexture?: boolean;
        attributeNames?: string[];
        blockCompilation?: boolean;
        defines?: Nullable<string | string[]>;
        engine?: AbstractEngine;
        extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void;
        extraInitializationsAsync?: () => Promise<void>;
        fragmentShader?: string;
        indexParameters?: any;
        name?: string;
        onCompiled?: Nullable<(effect: Effect) => void>;
        onError?: (effect: Effect, errors: string) => void;
        samplerNames?: string[];
        samplers?: Nullable<string[]>;
        shaderLanguage?: ShaderLanguage;
        uniformBuffers?: Nullable<string[]>;
        uniformNames?: string[];
        uniforms?: Nullable<string[]>;
        useAsPostProcess?: boolean;
        useShaderStore?: boolean;
        vertexShader?: string;
        vertexUrl?: string;
    }

    Hierarchy (View Summary)

    Index
    allowEmptySourceTexture?: boolean

    Sets this property to true if the fragment shader doesn't use a textureSampler texture (default: false).

    attributeNames?: string[]

    Attributes to use in the shader (default: ["position"])

    blockCompilation?: boolean

    If the shader should not be compiled immediately. (default: false)

    defines?: Nullable<string | string[]>

    Defines to use in the shader

    Engine to use to create the effect

    extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void

    Defines additional code to call to prepare the shader code

    extraInitializationsAsync?: () => Promise<void>

    Additional async code to run before preparing the effect

    fragmentShader?: string

    Fragment shader for the effect

    indexParameters?: any
    The index parameters to be used for babylons include syntax "#include[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
    name?: string

    The friendly name of the effect (default: "effectWrapper")

    onCompiled?: Nullable<(effect: Effect) => void>

    Callback when effect is compiled

    onError?: (effect: Effect, errors: string) => void

    Callback when there is an error compiling the effect

    samplerNames?: string[]

    Texture sampler names to use in the shader

    samplers?: Nullable<string[]>

    Alias for samplerNames. Note that if it is provided, it takes precedence over samplerNames.

    shaderLanguage?: ShaderLanguage

    The language the shader is written in (default: GLSL)

    uniformBuffers?: Nullable<string[]>

    The list of uniform buffers used in the shader (if any)

    uniformNames?: string[]

    Uniforms to use in the shader

    uniforms?: Nullable<string[]>

    Alias for uniformNames. Note that if it is provided, it takes precedence over uniformNames.

    useAsPostProcess?: boolean

    If the effect should be used as a post process (default: false). If true, the effect will be created with a "scale" uniform and a "textureSampler" sampler

    useShaderStore?: boolean

    Use the shader store instead of direct source code

    vertexShader?: string

    Vertex shader for the effect (default: "postprocess")

    vertexUrl?: string

    Alias for vertexShader