Shader Programs

Plenty of literature is available to learn writing shaders, so we won’t go into language details here.

You will need to write your shaders in either Lua or directly for the platform you are coding for (GLSL, HLSL or MTL). We recommend you use Lua as that will allow you to code once and have Gideros convert the code for you. However, if you decide to write directly for the platforms then start with the HLSL version which is in many ways more restrictive than the GLSL. It is far easier to port HLSL code to GLSL than the opposite way.

GLSL comes in two flavours: the regular language developed for desktop platforms, and the GLSL for an embedded system, aka OpenGL ES 3.0. The latter is often more strict and needs additional precision modifiers. Gideros helps you to deal with those differences by removing precision modifiers if run on a desktop platform and setting the appropriate language version. That way you only need to write an OpenGL ES 3.0 compliant shader.

If you are a beginner, it is better to start with a working shader, from an example or from this documentation, and then modify it to suit your needs.

You can avoid common compatibility pitfalls by reading this: https://www.opengl.org/wiki/GLSL_:_common_mistakes