0.0.1 • Published 8 years ago

three-shaders-composer v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

#three-shaders-composer Gulp task to compose your shaders from raw glsl files into THREE.js shader chunks.

Installation

Install package with NPM and add it to your development dependencies:

npm install three-shaders-composer --save

Usage

const shaders = require('three-shaders-composer')
const source = require('vinyl-source-stream')

gulp.task('shaders', ()=>{
	return gulp.src('./client/shaders/**/*')
	.pipe(shaders.compose())
	.pipe(source('shaders.js'))
	.pipe(gulp.dest('public'))
})

You suppose to have shader files named something like landscape_frag.glsl. The you will be able to access it from your code in THREE.ShaderChunk aray - THREE.ShaderChunk.landscape_frag