CML is a material description language based on the GLSL shader language:
GLSL Language Reference Pages
To create incoming or outgoing properties, you can simply prefix the variable with "in" or "out".
Properties can be global variables or attributes of the main function (main or mainImage).
Additional options for each property can be specified in round brackets:
in vec3 FragCoord(value = 1, knot = ioFragCoord, expression = R=V*D(K.x), min = -10.0, max = 10.0, AllowCurve = false, AllowTexture = false)
If, depending on some settings, you need to generate different source code of the material, you can set these parameters as defines.
#enum creates a dropdown menu in settings
In this case, DEFINE_NAME will contain the number of the selected element, the name of the selected element will also be defined, it will be connected to the list name with the _ symbol, and can be checked by the preprocessor: #ifdef DEFINE_NAME_OPTION3
#enum DEFINE_NAME OPTION1 OPTION2 OPTION3 OPTION4 ...
#int allows you to set an integer, for this, the define options are set with a space: name of the define, default value, minimum value and maximum value.
#int DEFINE_NAME 5 0 10
#bool is just a checkbox, you can check whether it is enabled or not using the preprocessor directive #ifdef DEFINE_NAME
#bool DEFINE_NAME
if you need to have direct access to the bitmap texture and Sampler2D you can use the directive:
#sampler DEFINE_NAME
This will allow users to load textures and you can use DEFINE_NAME as Sampler2D