webpack-glsl-loader icon indicating copy to clipboard operation
webpack-glsl-loader copied to clipboard

Share fragments code

Open nuthinking opened this issue 7 years ago • 2 comments

Is there a way to include some code on multiple fragments so that some logic stays in one place? I believe sometimes I've seen using #include for example, perhaps to include functions. Thanks!

nuthinking avatar Feb 13 '18 11:02 nuthinking

There is a section in README https://github.com/grieve/webpack-glsl-loader#example

But it's super confusing. It gives an example:

I can have that shader include other .glsl files inline, like so:

#include "./includes/perlin-noise.glsl";

note the .glsl extension in example and than it continues saying:

N.B. all imports within .glsl files exclude the file extension and are relative to the file doing the importing. :exploding_head:

I tried both but neither works.

turboMaCk avatar Mar 06 '21 22:03 turboMaCk

I expect the reason is that https://github.com/grieve/webpack-glsl-loader/pull/6 was never released

turboMaCk avatar Mar 06 '21 22:03 turboMaCk