This project now includes a proper implementation for loading and displaying ISF shaders based on the msfeldstein/interactive-shader-format-js library.
- Proper WebGL2/WebGL context handling
- Centralized animation loop for all ISF renderers
- Automatic TIME and RENDERSIZE uniform management
- Metadata parsing for ISF shader parameters
- Dynamic UI control generation
rainbow.fs- Simple animated rainbow generatortapestryfract.fs- Complex fractal generator with parametersbadtv.fs- TV static/glitch effect (requires input image)
- Dropdown selection for built-in and file-based shaders
- Automatic generation of parameter controls based on ISF metadata
- Real-time parameter adjustment with sliders, checkboxes, and color pickers
- Click on a layer's "Load ISF" button
- Select from available options:
- Built-in test shaders (simple demos)
- File-based shaders (from
shaders/directory) - "Load from file..." to browse for ISF files
When you load an ISF shader that includes parameter definitions in its JSON metadata, controls will automatically appear:
- Float parameters: Range sliders with value display
- Boolean parameters: Checkboxes
- Color parameters: Color pickers
✅ Working:
- TIME uniform (for animations)
- RENDERSIZE uniform (canvas dimensions)
- Custom float/bool/color parameters
- Multiple shader instances
- Real-time parameter adjustment
- Image inputs (basic support, needs improvement)
- Multi-pass rendering (depends on shader complexity)
❌ Not Yet Implemented:
- Audio inputs
- Buffer/feedback effects
- Custom vertex shaders
The ISFManager class centralizes ISF rendering:
// Initialize the manager
const isfManager = new ISFManager();
isfManager.startAnimationLoop();
// Create a renderer for a layer
const renderer = isfManager.createISFRenderer(layer, source, canvas);- Proper Library Usage: Uses
ISFRendererconstructor correctly - WebGL2 Context: Better texture and uniform support
- Centralized Rendering: Single animation loop handles all instances
- Metadata Parsing: Automatic UI generation from ISF JSON
- Error Handling: Better error reporting and fallbacks
LESSGO/
├── index.html # Updated with proper ISF library
├── isf-improved.js # New ISF Manager implementation
├── app.js # Updated ISF integration
├── style.css # Added ISF control styling
└── shaders/
├── rainbow.fs # Simple generator example
├── tapestryfract.fs # Complex fractal example
└── badtv.fs # Image effect example
ISF shaders are GLSL fragment shaders with JSON metadata. Example structure:
/*{
"CREDIT": "Your Name",
"DESCRIPTION": "What your shader does",
"CATEGORIES": ["Generator"],
"INPUTS": [
{
"NAME": "speed",
"TYPE": "float",
"DEFAULT": 1.0,
"MIN": 0.0,
"MAX": 5.0
}
]
}*/
void main() {
vec2 uv = gl_FragCoord.xy / RENDERSIZE.xy;
float time = TIME * speed;
vec3 color = 0.5 + 0.5 * cos(time + uv.xyx + vec3(0, 2, 4));
gl_FragColor = vec4(color, 1.0);
}ISF shaders not loading:
- Check browser console for errors
- Ensure ISF library loaded:
typeof ISFRenderer !== 'undefined' - Verify WebGL support: WebGL or WebGL2 context creation
No controls appearing:
- Check shader has proper JSON metadata
- Verify INPUTS array in metadata
- Look for parsing errors in console
Shaders not animating:
- Ensure ISF Manager animation loop is running
- Check that TIME uniform is being used in shader
- Verify no WebGL errors are preventing rendering