Build-in macros


SYNTHCLIPSE_ONLY macro definition is always automatically added to all shaders before build (on the top of the shader). It is just an empty definition:


(This shader addition can be verified in Code Preview View).

It can be used to turn on/off some code only when run shaders in Synthclipse. It also might be used to remap some names of uniform variables or functions, for example:

#define kore main
#define MyProjectionMatrix synth_ProjectionMatrix

uniform mat4 MyProjectionMatrix;

 * kore() function is the main entry point of a shder used in the Kha framework
void kore() {


SYNTHCLIPE macro is a macro defined only in a project settings. It is NOT passed to a shader. It might be used only to fool Eclipse C++ editor.

Synthclipse is using C++ editor for editing GLSL code to get great, fully featured tool for free, but the flaw of this is that some valid GLSL constructions, like for example Uniform Blocks, are not recognized as correct syntax. To get rid of red error highlights in Eclipse editor one might use a workaround:

// A valid GLSL Uniform Block. Not correct in Eclipse C++ editor:

in {
    vec3 N;
    vec3 L;
    vec3 V;
} fs_in;

// A valid GLSL Uniform Block. Workaround, correct in Eclipse C++ editor:

// this won't be included in the final shader
#define VS_IN struct

in VS_IN {
    vec3 N;
    vec3 L;
    vec3 V;
} fs_in;

IMPORTANT: Errors in the editor don't necessery mean that you cannot run the shader. You don't need to do such workarounds if you are OK with red highlights of the code.