Class ComputeEffect
Hierarchy
- ComputeEffect
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
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
definesSearch playground for defines
String container all the define statements that should be set on the shader.
nameSearch playground for name
Name of the effect.
on Bind ObservableSearch playground for onBindObservable
Observable that will be called when effect is bound.
on Compile ObservableSearch playground for onCompileObservable
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.
on CompiledSearch playground for onCompiled
Callback that will be called when the shader is compiled.
on ErrorSearch playground for onError
Callback that will be called if an error occurs during shader compilation.
on Error ObservableSearch playground for onErrorObservable
Observable that will be called if an error occurs during shader compilation.
unique IdSearch playground for uniqueId
Unique ID of the effect.
Static Log Shader Code On Compilation ErrorSearch playground for LogShaderCodeOnCompilationError
Enable logging of the shader code when a compilation error occurs
Accessors
compute Source Code
Gets the compute shader source code of this effect
Returns string
key
Unique key for this effect
Returns string
raw Compute Source Code
Gets the compute shader source code before it has been processed by the preprocessor
Returns string
Methods
disposeSearch playground for dispose
Release all associated resources.
Returns void
execute When CompiledSearch playground for executeWhenCompiled
Adds a callback to the onCompiled observable and call the callback immediately if already ready.
Parameters
func: ((effect: ComputeEffect) => void)
The callback to be used.
Parameters
effect: ComputeEffect
Returns void
Returns void
get Compilation ErrorSearch playground for getCompilationError
The error from the last compilation.
Returns string
the error string.
get EngineSearch playground for getEngine
The engine the effect was initialized with.
Returns Engine
the engine.
get Pipeline ContextSearch playground for getPipelineContext
The pipeline context for this effect
Returns Nullable<IComputePipelineContext>
the associated pipeline context
is ReadySearch playground for isReady
If the effect has been compiled and prepared.
Returns boolean
if the effect is compiled and prepared.
Static Register ShaderSearch playground for RegisterShader
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
Effect wrapping a compute shader and let execute (dispatch) the shader