Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to source the shader code from a separate file? #3

Open
nonrice opened this issue Oct 27, 2022 · 1 comment
Open

How to source the shader code from a separate file? #3

nonrice opened this issue Oct 27, 2022 · 1 comment

Comments

@nonrice
Copy link

nonrice commented Oct 27, 2022

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.

@morisil
Copy link
Member

morisil commented Oct 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants