API

Class ComputeEffect

Effect wrapping a compute shader and let execute (dispatch) the shader

Index
defines: string = ""

String container all the define statements that should be set on the shader.

name: string | IComputeShaderPath

Name of the effect.

onBindObservable: Observable<ComputeEffect> = ...

Observable that will be called when effect is bound.

onCompiled: Nullable<(effect: ComputeEffect) => void> = null

Callback that will be called when the shader is compiled.

onCompileObservable: Observable<ComputeEffect> = ...

Observable that will be called when the shader is compiled. It is recommended to use executeWhenCompile() or to make sure that scene.isReady() is called to get this observable raised.

onError: Nullable<(effect: ComputeEffect, errors: string) => void> = null

Callback that will be called if an error occurs during shader compilation.

onErrorObservable: Observable<ComputeEffect> = ...

Observable that will be called if an error occurs during shader compilation.

uniqueId: number = 0

Unique ID of the effect.

LogShaderCodeOnCompilationError: boolean = true

Enable logging of the shader code when a compilation error occurs

  • This function will add a new compute shader to the shader store

    Parameters

    • name: string

      the name of the shader

    • computeShader: string

      compute shader content

    Returns void