pyvvisf
Pure Python ISF (Interactive Shader Format) renderer built on PyOpenGL.
pyvvisf parses and renders ISF shaders from Python — to images or to an interactive window — without any C++ build step. It is a modern, pure-Python alternative to VVISF-GL, with enhanced error reporting that mirrors the official ISF online editor's diagnostics. Originally written to power ai-shader-tool, it gives AI agents (and humans) a way to validate, render, and inspect generated shaders. The majority of code in this repository was built with AI.
Docs | PyPI | Issue Tracker
Features
- Pure Python — no C++ compilation required
- Robust ISF parsing with json5 (comments, trailing commas)
- Modern OpenGL via PyOpenGL + GLFW for cross-platform contexts
- Enhanced error reporting with Python-native messages and shader context
- Type-safe metadata via Pydantic models, with auto-coercion for inputs
- Multi-version GLSL support with automatic detection
- ISF 2.0 compliant — multi-pass rendering, imports,
IMG_THIS_PIXEL,IMG_PIXEL,IMG_SIZE, etc. - Context-managed resources for clean setup and teardown
Contents
Quick Start
See the docs for a comprehensive overview.
Requirements
- Python 3.10+
- A working OpenGL driver (the renderer uses GLFW + PyOpenGL)
Setup Instructions
Install from PyPI:
pip install pyvvisf
Or install from source for development:
git clone https://github.com/jimcortez/pyvvisf.git
cd pyvvisf
pip install -e ".[dev]"
Run Instructions
Render an ISF shader to a PNG:
from pyvvisf import ISFRenderer
shader = """
/*{
"DESCRIPTION": "Every pixel is the selected color.",
"ISFVSN": "2.0",
"CATEGORIES": ["Generator"],
"INPUTS": [
{"NAME": "color", "TYPE": "color", "DEFAULT": [1.0, 0.0, 0.0, 1.0]}
]
}*/
void main() {
gl_FragColor = color;
}
"""
with ISFRenderer(shader) as renderer:
renderer.render(512, 512).to_pil_image().save("output_red.png")
renderer.set_input("color", (0.0, 1.0, 0.0, 1.0))
renderer.render(512, 512).to_pil_image().save("output_green.png")
Usage Examples
examples/isf_renderer_demo.py— render shaders to images, set inputs, save outputexamples/isf_window_demo.py— interactive window display (screenshot above)examples/time_offset_demo.py— capture frames at arbitrary time offsets
Bundled shaders in examples/shaders/:
simple.fs— fills the screen with bluesimple_color_change.fs— single color inputsimple_color_animation.fs— fades between two colors over timeshapes.fs— animated moving circle, rotating rectangle, pulsating ring
To pin a specific GLSL version or query what's available:
from pyvvisf import ISFRenderer, get_supported_glsl_versions
print(get_supported_glsl_versions())
renderer = ISFRenderer(shader_content, glsl_version="330")
The default is '330'. The library compiles a probe shader at construction time to verify compatibility.
Test Instructions
pip install -e ".[dev]"
pytest
Running headless (Docker, CI, servers)
pyvvisf needs a real OpenGL context. On a headless Linux box, wrap the
process in xvfb-run:
sudo apt-get install -y xvfb
xvfb-run -a python my_render_script.py
In GitHub Actions, the
pyvista/setup-headless-display-action
step provides a display on Linux, macOS, and Windows runners — see
.github/workflows/ci.yml for an example.
License
See LICENSE — MIT.
Support
Maintainer: @jimcortez. For bugs and feature requests, please use the issue tracker.
Acknowledgments
- VVISF-GL — initial reference implementation
- interactive-shader-format-js — second reference implementation
- PyOpenGL — OpenGL bindings
- pyGLFW — GLFW bindings
Metadata
Release files for pyvvisf 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyvvisf-0.9.0.tar.gz | 620.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyvvisf-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 648.5 kB
Release files / pyvvisf-0.9.0.tar.gz
| Download URL | pyvvisf-0.9.0.tar.gz |
|---|---|
| Size | 620.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
893ef044bfe5b487ad6f77034da3603bfbdcc638fc463458ed4d1f57a508ce04
|
|
BLAKE2b-256 checksum How to use checksums |
a50ac71f151a6a408fa6140d6b3820d8786185dc5b9f6ed591ca47aa017d5453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.
Transparency logRelease files / pyvvisf-0.9.0-py3-none-any.whl
| Download URL | pyvvisf-0.9.0-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57988996328a97c4353dbf938215c0d0343efe94fac6b5a7c80a353939279e67
|
|
BLAKE2b-256 checksum How to use checksums |
a90e4860047f75fa0c4f5ce94198c17954ccd8def36152f472ef751c1747039e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.
Transparency log