Skip to content

glsl loader for webpack working with chunks (inspired by ShaderLoader from cabbibo)

Notifications You must be signed in to change notification settings

andres-lowrie/shader-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Glsl loader for webpack

Glsl loader for webpack2 & webpack3. It support chunks & inspire by ShaderLoader

Getting started

Install:

npm install shader-loader --save-dev

Config webpack:

module: {
	rules: [
      {
        test: /\.(glsl|vs|fs)$/,
        loader: 'shader-loader',
        options: {
          glsl: {
            chunkPath: resolve("/glsl/chunks")
          }
        }
      }
	]
}

You can now require your glsl files:

var vertexShader = require("shader.vs");
var fragmentShader = require("shader.fs");

if you use $xxx in your shader its replace by the content of xxx.glsl, for example:

void main(void) {
	$snoise //replace by chunks/snoise.glsl
}

Learn more about loaders & webpack: http://webpack.github.io/docs/loaders.html

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

glsl loader for webpack working with chunks (inspired by ShaderLoader from cabbibo)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%