Skip to content

A transform stream for glslify that adds an `import` directive to your shaders.

License

Notifications You must be signed in to change notification settings

glslify/glslify-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glslify-import

A transform stream for glslify that adds an import directive to your shaders.

Usage

Given a basic shader:

// main.frag
#pragma glslify: import('./common.glsl')

void main() {
  gl_FragColor = vec4(color, 1.0);
}

You can import ./common.glsl:

// common.glsl
varying vec3 color;

And have the contents inlined into your shader:

varying vec3 color;

void main() {
  gl_FragColor = vec4(color, 1.0);
}

You can also use glslify pragmas and the like from your imported files as well. Useful for the cases when you want to include a common "base" set of definitions in your shaders without losing the niceties of glslify.

About

A transform stream for glslify that adds an `import` directive to your shaders.

Resources

License

Stars

Watchers

Forks

Packages

No packages published