Lua Shaders

The API allows the creation of Shader objects from within Lua. The 'Shader.lua()' constructor takes five arguments:

With Lua Shaders, it's assumed that the code is within the vertex and fragment parameter functions.

Lua Shader Functions:

(Please note that these functions may or may not be available, the Lua shader is still under development)


Don't rely on anything external, basically no globals except for attributes, uniforms and varying.

  • No Do..While
  • No Repeat..Until
  • No tables. The only allowed form of table lookup is for vector component swizzling and access to uniform arrays
  • No strings, userdata, etc. Basically only numbers are supported.
  • Mind your types! Although lua is not a typed language, shaders need types.
  • Always check on all platforms: Gideros will translate your lua code to GLSL,HLSL or MSL code, but some platforms are more strict than others about what you can write, or how many arguments a common function is supposed to take.