stevensona/shader-toy

Can shader-toy support relative local require for glslify?

shengsword opened this issue · 2 comments

#pragma glslify: value_noise21 = require("..\Include\value_noise21.glsl") // not working...
#pragma glslify: simplex_noise21 = require("F:\git\shadertoy\Include\value_noise21.glsl") //works... 

I think local glslify module is useful to develop daily, thus it'll be very convinent if shadertoy support it. thanks!

I don't know how glslify resolves paths and I don't think it's reasonable for us to preprocess the glslify lines. How glslify works with glsl files directly is something I don't know either right now.
For glslify packages, you can look at the demo we have, you can see that it can work without absolute paths. Simply use npm install inside your project and you can use the module name from there.

Closing this, because after closer investigation this is neither possible nor a good idea. glslify is designed as a node.js style module system, so modules are installed with npm install and paths are resolved by glslify within a project folder, that's how it should be used.