Although the GLSL shading language is anti-modular in the sense that it has one large namespace, the
r2 package attempts to relieve some of the pain of shader management by delegating to the
sombrero package. The
sombrero package provides a preprocessor for shader code, allowing shader code to make use of
#include directives. It also provides a system for publishing and importing modules full of shaders based internally on the standard Java
ServiceLoader API. This allows users that want to write their own shaders to import much of the re-usable shader code from the
r2 package into their own shaders without needing to do anything more than have the correct shader jar on the Java classpath .