Commands have syntax derived from XML, apart from Uniform Controls - which have syntax compatible with the Fragmentarium. Most of the XML-based commands do not have closing tag (although you can put "/" before ">" if you want). Only exceptions are "<info></info>" and "<preset></preset>" Commands.
This document describes available commands, their syntax and application.
Uniform Controls (UC) are used only at the end of variable declarations. Their purpose is to make possible to change variable's values during script execution by user controlled widgets/controls/components. Each UC has corresponding widget (or set of widgets) in the Uniform Controls View. There are few types of UCs with different names and parameters. They are described in depth in separate document.
var currentShapeID = 0; //! islider[0, 5, 11] var wireframeMode = false; //! checkbox[false] var coneRadius = 0.5; //! slider[0.1, 3, 10]
Group commands are used to group UCs on separated tabs on the Uniform Controls View. Every uniform variable, declared after group command, belongs to that group.
//! <group name="GROUP_NAME"> // or with optional slash: //! <group name="GROUP_NAME"/> // IMPORTANT: never use closing tag: </group>
//! <group name="Group #1"/> var currentShapeID = 0; //! islider[0, 5, 11] var wireframeMode = false; //! checkbox[false] //! <group name="Group #2"/> var coneRadius = 0.5; //! slider[0.1, 3, 10]
Info command is intended for script description, license and author's name.
/*! * <info> * some text. * </info> */
/*! * <info> * Author: Kamil Kolaczynski * Title: Mandelbrot Set * Description: This is classical Mandelbrot Set with Orbit trap coloring. * License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License * </info> */
Preset commands are automatically generated by Synthclipse whenever you save some presets using the Save button in the Uniform Controls View:
/*! * <preset name="PRESET_NAME"> * UNIFORM_NAME_1 = VALUE_1 * UNIFORM_NAME_2 = VALUE_2 * UNIFORM_NAME_3 = VALUE_3 * ... * </preset> */ // or if preset is saved in a separate file: //! <preset file="/path/to/some.preset" />
/*! * <preset name="Default"> * coneRadius = 0.1 * currentShapeID = 10 * wireframeMode = false * </preset> */ //! <preset file="D:/Revers/Synth/my_shader.preset" />
Messages commands are used to highlight some fragments in a code. Their role is only informative. They are mostly autogenerated by Synthclipse importers.
//! INFO: message //! WARNING: message //! ERROR: message
//! INFO: text of an info message //! WARNING: text of a warning message //! ERROR: text of an error message