Game Maker Language リファレンス > 組み込み関数 用途別 > シェーダー > シェーダーについて
This section explains the functions and constants used to create shaders in GameMaker:Studio.
Shaders are an incredibly powerful tool for manipulating what and how things are rendered to the screen by the graphics card. Since these tiny programs are actually run on the card itself, this means that they are extremely fast to process, freeing up valuable CPU cycles for more game logic.
To create a shader you will need to have written both a Vertex Shader and a Fragment Shader (also know as a Pixel Shader) using the Shader Editor, and even if (for example) you only wish to change the vertex positions for an instance being drawn, or if you only want to change the color values for the pixels, you will still need both programs for a complete shader to work.
Shaders do not permit you to change the value of any variables that you pass into them, and so these will be called shader constants in all the documentation that refers to them.
シェーダ自体をプログラムするために使用できるGLSL ESの関数と変数の完全な概要については、OpenGL ESのシェーディング言語(GLSL ES)リファレンス·ページを参照してください。
シェーダーリソース(ここでは"myShader")を用意し、描画イベントで以下のように記述します。
shader_set(myShader); draw_self(); shader_reset();
shader_setでシェーダーを設定することで、シェーダーが適用されます。そして描画が完了したらshader_resetで描画ターゲットをリセットします。1つのスプライトや背景だけでなく、すべての描画に適用したい場合には、現在のviewが持つsurfaceに適用する必要があります