pixi.js
    Preparing search index...

    Interface IShaderWithResourcesAdvanced

    A shader that can be used with both WebGL and WebGPU.

    interface IShaderWithResources {
        compatibleRenderers?: number;
        glProgram?: GlProgram;
        gpuProgram?: GpuProgram;
        resources?: Record<string, any>;
    }

    Hierarchy

    • ShaderWithResourcesDescriptor
    • ShaderBase
      • IShaderWithResources
    Index

    Properties

    compatibleRenderers?: number

    A number that uses two bits on whether the shader is compatible with the WebGL renderer and/or the WebGPU renderer. 0b00 - not compatible with either 0b01 - compatible with WebGL 0b10 - compatible with WebGPU This is automatically set based on if a GlProgram or GpuProgram is provided.

    glProgram?: GlProgram

    The WebGL program used by the WebGL renderer.

    gpuProgram?: GpuProgram

    The WebGPU program used by the WebGPU renderer.

    resources?: Record<string, any>

    A key value of uniform resources used by the shader. Under the hood pixi will look at the provided shaders and figure out where the resources are mapped. Its up to you to make sure the resource key matches the uniform name in the webGPU program. WebGL is a little more forgiving!