Type Alias EffectWrapperCustomShaderCodeProcessing
type EffectWrapperCustomShaderCodeProcessing = {
bindCustomBindings?: (postProcessName: string, effect: Effect) => void;
defineCustomBindings?: (
postProcessName: string,
defines: Nullable<string>,
uniforms: string[],
samplers: string[],
) => Nullable<string>;
processCodeAfterIncludes?: (
postProcessName: string,
shaderType: string,
code: string,
) => string;
processFinalCode?: (
postProcessName: string,
shaderType: string,
code: string,
) => string;
}
bindCustomBindings?: (postProcessName: string, effect: Effect) => void;
defineCustomBindings?: (
postProcessName: string,
defines: Nullable<string>,
uniforms: string[],
samplers: string[],
) => Nullable<string>;
processCodeAfterIncludes?: (
postProcessName: string,
shaderType: string,
code: string,
) => string;
processFinalCode?: (
postProcessName: string,
shaderType: string,
code: string,
) => string;
}
Properties
Optionalbind Custom Bindings
If provided, will be called when binding inputs to the shader code to allow the user to add custom bindings
Optionaldefine Custom Bindings
defineCustomBindings?: (
postProcessName: string,
defines: Nullable<string>,
uniforms: string[],
samplers: string[],
) => Nullable<string>
postProcessName: string,
defines: Nullable<string>,
uniforms: string[],
samplers: string[],
) => Nullable<string>
If provided, will be called before creating the effect to collect additional custom bindings (defines, uniforms, samplers)
Optionalprocess Code After Includes
processCodeAfterIncludes?: (
postProcessName: string,
shaderType: string,
code: string,
) => string
postProcessName: string,
shaderType: string,
code: string,
) => string
If provided, will be called two times with the vertex and fragment code so that this code can be updated after the #include have been processed
Optionalprocess Final Code
processFinalCode?: (
postProcessName: string,
shaderType: string,
code: string,
) => string
postProcessName: string,
shaderType: string,
code: string,
) => string
If provided, will be called two times with the vertex and fragment code so that this code can be updated before it is compiled by the GPU
Allows for custom processing of the shader code used by an effect wrapper