rapid-render
    Preparing search index...

    Class CustomGlShader

    A wrapper for creating and managing custom shaders across multiple rendering regions.

    Index

    Constructors

    Properties

    fs: string

    Custom fragment shader code

    glshader: Map<string, GLShader> = ...

    Map of compiled GLShader instances per region key

    rapid: Rapid
    uniformDirty: Set<string> = ...

    Set of region keys that need uniform updates

    uniforms: Record<string, UniformValue> = {}

    Currently stored uniform values

    uniformTextures: Record<string, WebGLTexture> = {}

    Map of textures to be bound to this shader

    usedTextureUnitNum: number = 0

    Number of texture units reserved by this custom shader

    vs: string

    Custom vertex shader code

    Methods

    • Applies current uniforms and texture unit mappings to the region-specific shader.

      Parameters

      • key: string

        The region key.

      • textureUniforms: Record<string, number>

        Map of texture uniform names to assigned texture unit indices.

      Returns void

    • Retrieves or compiles a customized GLShader for a specific region.

      Parameters

      • region: Region

        The Region requesting the shader.

      • key: string

        The region key.

      • OptionalbaseVS: string

        The base vertex shader template.

      • OptionalbaseFS: string

        The base fragment shader template.

      Returns GLShader | null

      The combined and compiled GLShader.

    • Updates uniform values or textures for the custom shader.

      Parameters

      • uniforms: Record<string, UniformValue | WebGLTexture>

        Map of uniform values or WebGL textures to apply.

      Returns void