Introducing the JitLygia Package
Included in the huge list of Max 9.1 features is mention of shader #include support. You can read about this in the jit.gl.shader reference page, but one super exciting thing this functionality enables is support for the fantastic Lygia shader library, a huge collection of well written, organized and modular shader code. To that end I'm excited to announce the JitLygia package, which bundles the Lygia library into Max package form, and includes a handful of JXS examples ported over from the Lygia example set.
Simply install from the package manger and you're off. Individual lygia modules can be included in your shader by prefixing the path with Package:/JitLygia, e.g.:
#include Package:/JitLygia/lygia/animation/easing.glsl"Give it a look and happy shading!

This is very exiting Rob! Can't wait to try it.
Hello,
I’m encountering a persistent issue with the GLSL #include system in Max 9.1 on macOS. Shader include paths using the Package:/ prefix fail to resolve, even though the package is correctly installed and visible in Max’s File Preferences.
Context
macOS: Sonoma (M1)
Max: 9.1 (confirmed also on 9.0.x)
Package: JitLygia, installed in
/Users/sabina/Documents/Max 9/Packages/JitLygia/Shader:
.jxsfile loaded viajit.gl.slab @file fbm_motion_sabina.jxs
The shader contains:
#include "Package:/JitLygia/lygia/generative/fbm.glsl"
#include "Package:/JitLygia/lygia/color/hsv2rgb.glsl"
The package appears correctly in File Preferences and in the Package Manager.
All .glsl files are present and readable on disk.
The problem
When loading the .jxs file, Max reports:
jit.gl.slab • failed to process shader includes:
Error: Could not read include file "/Volumes/Macintosh HD/Users/sabina/Documents/Max 9/Packages/JitLygia/lygia/color/hsv2rgb.glsl"
Invalid Directive: include
jit.gl.shader: GLSL program failed to compile.
This happens even though the same includes work in the official JitLygia examples (which are inside the package).
It seems that the shader preprocessor concatenates absolute disk paths (e.g. /Volumes/Macintosh HD/...) instead of resolving the Package:/ alias.
What I’ve verified
The package path is registered in File Preferences.
The same include syntax works when the package is located in
/Users/Shared/Max 9/Packages/.Moving the shader file inside the package does not help.
Using angle brackets instead of quotes produces the same error.
Relative paths such as
../lygia/...work, butPackage:/...does not.
Likely cause
The GLSL include resolver in jit.gl.shader and jit.gl.slab appears to only scan /Users/Shared/Max 9/Packages/ for packages, ignoring any packages located in the Documents folder even if they are listed in File Preferences.
This makes the Package:/ alias unreliable for user-installed packages.
Questions
Is this a known limitation or regression in Max 9?
Does
Package:/resolve only when the package resides in/Users/Shared/Max 9/Packages/?Could Cycling ’74 consider fixing this so that
Package:/respects the File Preferences paths (includingDocuments/Max 9/Packages)?
Steps to reproduce
Install JitLygia into
Documents/Max 9/Packages/.Create a shader file with:
#include "Package:/JitLygia/lygia/color/hsv2rgb.glsl" out vec4 outcolor; void main() { outcolor = vec4(hsv2rgb(vec3(0.5,1.0,1.0)),1.0); }Load it in Max using
jit.gl.slab @file test_include.jxs.Observe that the include fails with an invalid directive error.
Thank you to anyone from Cycling ’74 who can confirm whether this is a bug or an intentional limitation, and whether it can be addressed in a future update.
Best regards,
Sabina Covarrubias
Hi Sabina, thanks much for jumping in here! I started typing up a reply, but as I tested I realized you simply have the wrong include path specified:
#include "Package:/JitLygia/lygia/color/hsv2rgb.glsl"should be (you were missing the /space folder) :
#include "Package:/JitLygia/lygia/color/space/hsv2rgb.glsl"I do see that the error messages are confusing when it can't find the file, so maybe there's some cleanup we can to there to make it more clear, since I'm sure this will be a common error.
Hopefully that's enough to get you unstuck, but please let me know if not.
just to clarify a bit more:
First , JitLygia is only supported in Max 9.1, so no need to test in 9.0.x.
Second, you should have installed JitLygia from the Package Manager, and that should have installed in ~/Documents/Max 9/Packages . There should be no need to add anything to the File preferences. I'm actually not entirely sure in what circumstances /Users/Shared/Max 9/Packages are used, but on my machine that folder is empty. So your first step "Install JitLygia into Documents/Max 9/Packages/." should instead be "Install JitLygia from the Package Manager".
You said the package shows up in File Preferences, but there should be no need to add properly installed packages to File Preferences.