code: function transformShader(shaderContent, variableDict, config) {
    let match = null;
    let unrolledContents = null;
    let shaderString = shaderContent;
  
    // First do all the variable replacements
    Object.keys(variableDict).forEach((vname) => {
      const value = variableDict[vname];
      const r = new RegExp(`\\$\\{${vname}\\}`, 'g');
      shaderString = shaderString.replace(r, value);
    });
  
    // Now check if any loops need to be inlined
    if (config.inlineLoops) {
      const loopRegex = /\/\/@INLINE_LOOP([\s\S]+?)(?=\/\/@INLINE_LOOP)\/\/@INLINE_LOOP/;
  
      match = shaderString.match(loopRegex);
      while (match) {
        const capture = match[1];
        /* eslint-disable no-useless-escape */
        const infoRegex = /^\s*\(([^\),]+)\s*,\s*([^\),]+)\s*,\s*([^\)]+)\)/;
        const infoRegexMatch = capture.match(infoRegex);
        const loopVariableName = infoRegexMatch[1];
        const loopMin = infoRegexMatch[2];
        const loopCount = infoRegexMatch[3];
        const forLoop = capture.replace(infoRegex, '');
        const loopContentsRegex = /^\s*[^\{]+\{([\s\S]+?)\s*\}\s*$/;
        /* eslint-enable no-useless-escape */
        const forLoopMatch = forLoop.match(loopContentsRegex);
        const loopBody = forLoopMatch[1];
        const loopBodyReplacer = new RegExp(loopVariableName, 'g');
  
        unrolledContents = '';
        for (let i = loopMin; i < loopCount; ++i) {
          unrolledContents += loopBody.replace(loopBodyReplacer, i);
          unrolledContents += '\n';
        }
  
        shaderString = shaderString.replace(loopRegex, unrolledContents);
        match = shaderString.match(loopRegex);
      }
    }
  
    if (config.debug) {
      console.log('Transformed shader string:');
      console.log(shaderString);
    }
  
    return shaderString;
  }
docs: ----------------------------------------------------------------------------