You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shouldn't be a problem. You just need to resolve the #include dependencies. For that you can do it locally, so before you bundle you regl app. For that depends on what you are using, there is a vite plugin, webpack and esbuild that support's it.
<!-- as a JavaScript source --><scriptsrc="https://lygia.xyz/resolve.js"></script><!-- Or as a ES6 module --><scripttype="module">importresolveLygiafrom"https://lygia.xyz/resolve.esm.js"</script>
And then in JS when loading a shader as a string call resolveLygia() functions which return a string resolved:
// 1. FIRST// Sync resolver, one include at a timevertSource=resolveLygia(vertSource);fragSource=resolveLygia(fragSource);// OR.// ASync resolver, all includes in parallel callsvertSource=resolveLygiaAsync(vertSource);fragSource=resolveLygiaAsync(fragSource);// 2. SECOND// Use the resolved source code shdr=createShader(vertSource,fragSource);
If all this fail, you can drag&drop a shader file (.glsl, .frag, .vert) with dependencies to #include "lygia/something/something.glsl" and will return it (will automatically download on your computer) with all dependencies resolved.
Has anyone made a lygia integration/example for use in a regl project?
The text was updated successfully, but these errors were encountered: