If I write my own GLSL shader, and try to add variables, the shader code fails to compile, and gives me an error.
I’m not sure what causes these kinds of errors below, but I need help on how to solve them when they crop up.
For example, this kind of error:
ERROR: (gpu.shader): custom FragShader:
number:
/* Texture format tokens -- Type explicitness required by other Graphics APIs. /
Error: '{': syntax error: syntax error
Which I don’t really know how to solve exactly.
Or when trying to use the #if function to check and execute part of a shader code, this happens:
line number:
Error: '': syntax error: incorrect preprocessor directive
Error: '': syntax error: unexpected tokens following #if preprocessor directive - expected a newline
When trying to check a variable I made with #if like “#if doSomething = true”, I get:
line number: #define depth2DArray sampler2DArray
Error: '{': syntax error: syntax error
How to solve these shader errors? 2D filter scripts give no traceback or line definition like Python does, so it is a bit cryptic to me. Can anyone please teach me how to solve these errors in GLSL?
Also, UPBGE is switching to Metal for macOS devices in the newest releases soon. Do the same rules apply?