shader-web-background
shader-web-background copied to clipboard
How to source the shader code from a separate file?
It does not document it on the README. When I try my intuition,
<script type="x-shader/x-fragment" id="image" src="shader.frag">
The shader does not compile.
If script is of other type than text/javascript, it will not be loaded automatically by the browser. I was thinking about that, but I haven't decided on how to implement it, because I believe it would also make sense to observe changes in such a file, to recompile the shader live.
In general the principle behind this library was to be as minimal as possible, allowing to embed shaders in the single HTML file before any other resources are loaded.