Studio › Manual › Shaders

The portability checker

Every shader asset is checked as you type, and Check (⌥⇧K) runs it at once. Problems are underlined in the code (point at the line for the message) and listed under it; click one to go there.

It finds what stops a shader on one of GameMaker's runtimes:

  • Reserved words. GMRT turns GameMaker's GLSL ES into desktop GLSL 3.30, where words such as shared, sample, input, output, filter, common, active, partition, half, fixed, uint and texture can't be names.
  • GLSL ES 1.00 rules (GMS2, phones and HTML5): no int where a float is wanted (1.0, not 1), no % or bit operators, no round() or texture(), loops with a constant count, no #version line.
  • How the two files fit: varyings and uniforms that don't match between the vertex and fragment shader.
  • Device differences (warnings): derivatives and texture2DLod in fragment shaders need extensions on phones; big constants lose precision at mediump; HLSL keywords trip GameMaker's Windows export.

Every shader in the library passes it, and each was compiled by GameMaker's own tools for GMS2 (Mac), GLSL ES and GMRT.

Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.