Engine API Reference - v2.8.0
    Preparing search index...

    Class ShaderChunkMap

    A collection of shader chunks, used by ShaderChunks. This is a map of shader chunk names to their code. As this class extends Map, it can be used as a Map as well in addition to custom functionality it provides.

    Hierarchy

    • Map
      • ShaderChunkMap
    Index

    Methods

    • Adds multiple shader chunks to the Map. This method accepts an object where the keys are the names of the shader chunks and the values are the shader source code. If an element with the same name already exists, the element will be updated.

      Parameters

      • object: any

        Object containing shader chunks.

      Returns ShaderChunkMap

      The ShaderChunkMap instance.

    • Removes a shader chunk by name from the Map. If the element does not exist, no action is taken.

      Parameters

      • name: string

        The name of the shader chunk to remove.

      Returns boolean

      True if an element in the Map existed and has been removed, or false if the element does not exist.

    • Adds a new shader chunk with a specified name and shader source code to the Map. If an element with the same name already exists, the element will be updated.

      Parameters

      • name: string

        The name of the shader chunk.

      • code: string

        The shader source code.

      Returns ShaderChunkMap

      The ShaderChunkMap instance.