A node.js-style module system for GLSL, enabling modular shader development and reuse via npm.
glslify is a module system for GLSL that enables developers to write modular, reusable shader code by importing and exporting GLSL modules via npm. It solves the problem of shader code duplication and fragmentation by providing a dependency management system similar to Node.js, allowing complex visual effects to be built from community-maintained packages.
WebGL developers, graphics programmers, and creative coders who write GLSL shaders and want to leverage modular, reusable components in their projects.
Developers choose glslify because it brings the productivity and ecosystem benefits of npm to GLSL development, enabling code reuse, versioning, and easy integration with existing JavaScript build tools like Browserify and Webpack.
A node.js-style module system for GLSL! :sparkles:
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Introduces a require() syntax for importing and exporting GLSL functions, structs, and constants, enabling code reuse and reducing duplication as shown in the README's example of composing shaders from noise and lighting modules.
Leverages npm for dependency management, providing access to a growing community of packages like glsl-noise and glsl-specular-cook-torrance, simplifying the installation and versioning of shader components.
Offers multiple integration points including CLI, Browserify transform, Webpack loader, and Babel plugin, allowing seamless incorporation into existing JavaScript build pipelines as detailed in the installation and usage sections.
Outputs a single shader string, making it easy to use with any WebGL framework that accepts custom shaders, such as three.js or pex, without locking users into a specific runtime environment.
Requires a Node.js/npm setup and integration with JavaScript build tools, which can be a barrier for graphics developers working in non-JavaScript environments like C++ or Python-based pipelines.
The GLSL module ecosystem on npm, while growing, is still niche compared to larger shader libraries, potentially limiting the availability of specialized or production-ready components for complex effects.
Managing source transforms and resolving dependencies, especially with tools like Babel that may mangle output, adds configuration overhead that can be daunting for beginners or teams new to modular shader development.