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.
<script>
.frag
CSS selector for the script element containing the GLSL source.
If no element is found for the given selector.
// HTML: <script type="x-shader/x-fragment" id="myFrag">...</script>const frag = heredoc('#myFrag') Copy
// HTML: <script type="x-shader/x-fragment" id="myFrag">...</script>const frag = heredoc('#myFrag')
Reads GLSL source from a
<script>element in the page. Useful when you want to keep shaders inline in HTML rather than in separate.fragfiles.