VVISF & VVGL
|
Making and working with ISFDoc
VVISF::ISFDoc is how you interface with ISF files- you can create a VVISF::ISFDoc from a path to a file on disk, or from the frag/vertex shader strings. When the doc is created, the JSON blob in the frag shader string is prased, and the VVISF::ISFDoc instance is populated with a variety of ISFAttrRef and ISFPassTargetRef instances that describe the contents and value of the ISF file. This allows the properties of the ISF document to be examined programmatically.
As with other classes in these libs, ISFDocRef is the preferred means of interacting with ISFDoc. Because it contains attributes and passes and lots of things that have value, performing a deep copy isn't something you want to do unnecesarily. ISFDocRef allows an instance of ISFDoc to be accessed simultaneously from number of different places (ISFDoc is threadsafe).
VVISF::ISFDoc performs a variety of important functions beyond introspection: it generates source code for GL shaders with all the appropriate variable declarations for the ISF variables, and it maintains the state of the inputs and render passes and is used by ISFScene when doing rendering, etc. Much of VVISF::ISFScene's logic revolves around getting values from and sending values to the VVISF::ISFDoc it's using to store and track the state/value of all the shader inputs used to render frames.