isf

Parsing, deserialization and serialization of ISF - the Interactive Shader Format.
Implementation is as described under "The ISF Specification Vsn 2.0" part of the spec site.
The parse function can parse a given GLSL string to produce an Isf instance. The Isf type represents a fully structured representation of the format, including typed Inputs.
Tests
The repo includes all shaders from the "ISF Test/Tutorial filters" collection provided by the specification site along with all shaders within the "Vidvox/ISF-Files" repository for automated testing. These tests do a full roundtrip on every shader in the following steps:
- Read the GLSL string from file.
- Parse the GLSL string for the top-level dictionary.
- Deserialize the JSON to an
Isfstruct. - Serialize the
Isfstruct back to a JSON string. - Deserialize the new JSON string to an
Isfstruct again. - Assert the first
Isfinstance is identical to the second.
Thanks to the Vidvox crew for allowing us to include these tests in the repo for easy automated testing!
Example
Parsing a GLSL string to an ISF struct looks like this:
let isf = parse.unwrap;
See the Isf struct docs to
get an idea of what you can do with it!
Here's a copy of the tests/roundtrip.rs test as described above:
let test_files_path = new.join;
assert!;
assert!;
for entry in read_dir.unwrap
About
This crate has been developed as a step towards creating an ISF live-coding environment based on nannou, the creative coding framework.