シェーダーについて


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に適用する必要があります

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2024-03-07 2023-08-09 2023-05-21 2023-05-20 2023-05-04 2022-10-13 2022-07-21 2022-07-02 2022-04-06 2021-11-30 2021-11-26 2021-10-03 2021-09-23 2021-08-15 2021-06-02 2021-01-23 2021-01-21 2021-01-19 2021-01-18 2021-01-16 2021-01-15

人気の10件

今日の10件



これまでの訪問者: 1770
今日の訪問者: 1
昨日の訪問者: 0
閲覧者: 2