@lightningjs/renderer
    Preparing search index...

    Type Alias WebGlShaderType<T>

    WebGlShaderType: CoreShaderType<T> & {
        canBatch?: (node: CoreNode, currentRenderOp: WebGlRenderOp) => boolean;
        fragment: ShaderSource<T>;
        onSdfBind?: (this: GlContextWrapper, props: T) => void;
        supportsIndexedTextures?: boolean;
        update?: (this: WebGlShaderNode<T>, node: CoreNode) => void;
        vertex?: ShaderSource<T>;
        webgl1Extensions?: string[];
        webgl2Extensions?: string[];
    }

    This is the WebGL specific ShaderType

    Type Parameters

    • T extends object = Record<string, unknown>

    Type Declaration

    • OptionalcanBatch?: (node: CoreNode, currentRenderOp: WebGlRenderOp) => boolean

      This function is used to check if the shader can be reused based on quad info

    • fragment: ShaderSource<T>

      fragment shader source for WebGl or WebGl2

    • OptionalonSdfBind?: (this: GlContextWrapper, props: T) => void

      only used for SDF shader, will be removed in the future.

      don't use this in your shader type

    • OptionalsupportsIndexedTextures?: boolean
    • Optionalupdate?: (this: WebGlShaderNode<T>, node: CoreNode) => void

      This function is called when one of the props is changed, here you can update the uniforms you use in the fragment / vertex shader.

    • Optionalvertex?: ShaderSource<T>

      vertex shader source for WebGl or WebGl2

    • Optionalwebgl1Extensions?: string[]

      extensions required for specific shader?

    • Optionalwebgl2Extensions?: string[]

    CoreShaderType