Basic code reference
Overview of EEL2 syntax: variables, expressions, statements, and how JSFX code is compiled and executed.
Kind: concept
The core of JSFX is custom code written in a simple language (called EEL2), which has many similarities to C. Code is written in one or more of the numerous code sections. Some basic features of this language are:
- Variables do not need to be declared, are by default global to the effect, and are all double-precision floating point.
- Variable names are NOT case sensitive, so a and A refer to the same variable.
- Variable names may begin with a _, a-z, or A-Z, and can contain numbers after one of those characters.
- The maximum variable name length is 127 characters.
- Variable names can also contain . characters, though this is used for namespaced pseudo-objects.
- There are a few predefined constant variables: $pi, $phi, and $e.
- Basic operations including addition (+), subtraction (-), multiplication (*), division (/), and exponential (^)
- Bitwise operations including OR (|), AND (&), XOR (~), shift-left (<<), and shift-right-sign-extend (>>). These all convert to integer for calculation.