wtc-gl
    Preparing search index...

    Function heredoc

    • Reads GLSL source from a <script> element in the page. Useful when you want to keep shaders inline in HTML rather than in separate .frag files.

      Parameters

      • selector: string

        CSS selector for the script element containing the GLSL source.

      Returns string

      If no element is found for the given selector.

      // HTML: <script type="x-shader/x-fragment" id="myFrag">...</script>
      const frag = heredoc('#myFrag')