Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • ComputeEffect

Index

Constructors

  • Creates a compute effect that can be used to execute a compute shader

    Parameters

    • baseName: any

      Name of the effect

    • options: IComputeEffectCreationOptions

      Set of all options to create the effect

    • engine: Engine

      The engine the effect is created for

    • Optional key: string

      Effect Key identifying uniquely compiled shader variants

    Returns ComputeEffect

Properties

defines: string

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

name: any

Name of the effect.

onBindObservable: Observable<ComputeEffect>

Observable that will be called when effect is bound.

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.

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

Callback that will be called when the shader is compiled.

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

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

Unique ID of the effect.

LogShaderCodeOnCompilationError: boolean

Enable logging of the shader code when a compilation error occurs

Accessors

  • get computeSourceCode(): string
  • Gets the compute shader source code of this effect

    Returns string

  • get key(): string
  • Unique key for this effect

    Returns string

  • get rawComputeSourceCode(): string
  • Gets the compute shader source code before it has been processed by the preprocessor

    Returns string

Methods

  • dispose(): void
  • Release all associated resources.

    Returns void

  • Adds a callback to the onCompiled observable and call the callback immediately if already ready.

    Parameters

    Returns void

  • getCompilationError(): string
  • The error from the last compilation.

    Returns string

    the error string.

  • The engine the effect was initialized with.

    Returns Engine

    the engine.

  • The pipeline context for this effect

    Returns Nullable<IComputePipelineContext>

    the associated pipeline context

  • isReady(): boolean
  • If the effect has been compiled and prepared.

    Returns boolean

    if the effect is compiled and prepared.

  • RegisterShader(name: string, computeShader: string): void
  • 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

Legend

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

Settings

Theme