1.0.0 • Published 6 months ago

glsl2-loader v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

glsl2-loader

Simple and faster glsl loader, support webpack4 and webpack5.

Quick Start

1.Installation package:

npm install glsl2-loader -D
# or
pnpm i glsl2-loader -D

2.Configure webpack.config.js:

module: {
  rules: [
    // ...
    {
      test: /\.(glsl|vert|frag)$/,
      use: ['glsl2-loader']
    }
  ]
}

3.You can introduce the glsl file like this:

#include "/node_modules/lygia/math/saturate.glsl"
#include "../common/aces.glsl"

void main() {
  vec3 color = vec3(1.0, 0.0, 0.0);
  color = saturate(color);
  color = acesFilmicToneMapping(color);
  gl_FragColor = vec4(color, 1.0);
}

License

MIT

1.0.0

6 months ago