API

Type Alias EffectWrapperCustomShaderCodeProcessing

Allows for custom processing of the shader code used by an effect wrapper

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;
}
Index
bindCustomBindings?: (postProcessName: string, effect: Effect) => void

If provided, will be called when binding inputs to the shader code to allow the user to add custom bindings

defineCustomBindings?: (
    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)

processCodeAfterIncludes?: (
    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

processFinalCode?: (
    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