rhodonite
    Preparing search index...

    Class GlobalDataRepository

    The repository class that manages global data used throughout the rendering pipeline. This singleton class handles global properties such as camera matrices, lighting data, bone transformations for skeletal animation, and other shared rendering state.

    Index

    Methods

    • Internal

      Adds global property declarations to vertex and pixel shader code strings. This method is used during shader compilation to inject the necessary uniform declarations for all registered global properties.

      Parameters

      • vertexPropertiesStr: string

        The string to append vertex shader property declarations to

      • pixelPropertiesStr: string

        The string to append pixel shader property declarations to

      • propertySetter: getShaderPropertyFuncOfGlobalDataRepository

        The function used to generate property declaration code

      Returns string[]

      A tuple containing the updated vertex and pixel shader property strings

    • Internal

      Sets up uniform locations for properties that need uniform access in data texture mode. Only sets up uniforms for properties marked with needUniformInDataTextureMode flag.

      Parameters

      • shaderProgramUid: number

        The unique identifier of the shader program

      Returns void

    • Internal

      Sets up uniform locations for all global properties when using uniform mode. This is used internally by the WebGL resource repository for shader program setup.

      Parameters

      • shaderProgramUid: number

        The unique identifier of the shader program

      Returns void

    • Gets the memory location offset of a global property in 16-byte aligned units. This is used for data texture mode to determine where properties are stored in memory.

      Parameters

      • propertyName: string

        The name of the property to get the offset for

      Returns number

      The offset in 16-byte units, or -1 if the property is not found

    • Retrieves the value of a specific instance of a global property.

      Parameters

      • shaderSemantic: string

        The name of the shader semantic property to retrieve

      • countIndex: number

        The index of the specific instance to retrieve

      Returns any

      The value object for the specified property instance, or undefined if not found

    • Sets the value of a specific instance of a global property. Updates the underlying memory buffer with the new value.

      Parameters

      • shaderSemantic: string

        The name of the shader semantic property to update

      • countIndex: number

        The index of the specific instance to update

      • value: any

        The new value to set for this property instance

      Returns void

    • Allocates and returns a new instance of the specified global property. Initializes the property with its default value and adds it to the internal tracking.

      Parameters

      • shaderSemantic: string

        The name of the shader semantic property to allocate

      Returns any

      The newly allocated property value object, or undefined if the property doesn't exist