Studio › Manual › Shaders

The shader editor

Double-click a shader in the asset list to open it. The left side is the code, the right a live preview.

  • Fragment / Vertex switches between the .fsh and .vsh file (⌥⇧V).
  • GLSL is coloured: keywords, types, GameMaker's built-ins (gm_Matrices, gm_BaseTexture, in_Position ...), your uniforms and varyings, numbers and comments.
  • Completion: typing a name (two letters or more) lists matches: your own uniforms, varyings, functions and variables first when they fit, then GLSL ES keywords, types and functions (smoothstep, texture2D ...) and GameMaker's built-ins. Return or Tab takes one; View > Go > Show Completions (⌃Space) or Esc asks for the list.
  • The preview redraws a moment after you stop typing; Live (⌥⇧P) turns that off. Scene picks what it is drawn on. If the shader doesn't compile, the preview dims and shows the error.
  • Save (⌘S) writes both files.

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