Studio › Manual › Shaders

Adding a shader to your project

Add to Project (⌘↩) in the Shader Library writes the shader into the open project exactly as GameMaker writes a shader asset (shaders/shd_<name>/ with its .yy, .vsh and .fsh), in a Shader Library folder of the asset list. With Helper script on, it also adds scr_shd_<name> with one function, shd_<name>_set(...), which calls shader_set and sets every uniform; each argument is optional and defaults to the library's value.

// Draw event
shd_outline_outer_set(c_yellow, 1, 2);
draw_self();
shader_reset();

Copy Usage (⌥⇧⌘C) copies the snippet shown for the shader. Adding a shader that is already there brings its files up to date. Edit > Undo takes the shader out again. Projects in the older 2.3 format need upgrading first (open them in Studio, which upgrades a copy).

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