# チュートリアル：表現強化コース #3 – シェーダーの使用

**URL:** https://guild.rpgmakerofficial.com/t/topic/66
**Category:** チュートリアル
**Tags:** tutorial, english
**Created:** [2025 年 6 月 6 日午前 7:39 UTC](https://guild.rpgmakerofficial.com/t/topic/66 "2025-06-06T07:39:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GGG-Administrator](https://sea2.discourse-cdn.com/flex002/user_avatar/guild.rpgmakerofficial.com/ggg-administrator/32/6_2.png) [@GGG-Administrator](https://guild.rpgmakerofficial.com/u/GGG-Administrator)
#### Post date: [2025 年 6 月 6 日午前 7:39 UTC](https://guild.rpgmakerofficial.com/t/topic/66/1 "2025-06-06T07:39:39Z")

</div>

このコースでは、 **ACTION GAME MAKER** でさまざまな視覚表現テクニックを学びます。  
第3回では、 **シェーダー** の使い方について解説します。

* * *

## コース開始前の準備

**コース#2** と同じプロジェクトを引き続き使用します。  
まだ開いていない場合は、今すぐプロジェクトを開いて準備してください。

---

<div class="post-metadata">

### Author: ![GGG-Administrator](https://sea2.discourse-cdn.com/flex002/user_avatar/guild.rpgmakerofficial.com/ggg-administrator/32/6_2.png) [@GGG-Administrator](https://guild.rpgmakerofficial.com/u/GGG-Administrator)
#### Post date: [2025 年 6 月 6 日午前 7:40 UTC](https://guild.rpgmakerofficial.com/t/topic/66/2 "2025-06-06T07:40:21Z")

</div>

## Let’s Create a Blur Shader

1. Open the **game\_scene** tab and select the `Sprite2D` node.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/1X/1b58a6a7c4cc18dddb3e8260346ffbbc69b4f265.png)
2. In the **Inspector** , go to `CanvasItem > Material > empty`, and select **New ShaderMaterial**.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/1X/7d94819be97b2b225d745025f63cac03a4592ade.png)
3. Click it again to expand the menu, then create a new **Shader**.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/1X/b121b2dcae9dff64d10abf160a23e40cfa42e68a.png)
4. Since it’s a blur shader, name it `blur.gdshader` when saving.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/1X/c4dd185771d81898b07af57645b2c425c7c02687.png)
5. Click on `blur.gdshader`. The panel will switch to a code editor for shader scripts.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/1X/b0144917a2fd2228a046181d7d986bbad5d142a0.png)
6. Copy and paste the following code to overwrite everything in the shader:

```auto
shader_type canvas_item;

uniform float blur_radius : hint_range(0.0, 10.0); // blur strength

void fragment() {
    vec2 size = vec2(textureSize(TEXTURE, 0));
    vec2 uv = UV;

    vec4 sum = vec4(0.0);
    int blur_size = int(blur_radius);

    for (int x = -blur_size; x <= blur_size; x++) {
        for (int y = -blur_size; y <= blur_size; y++) {
            vec2 offset = vec2(float(x), float(y)) / size;
            sum += texture(TEXTURE, uv + offset);
        }
    }

    float samples = pow(float(blur_size * 2 + 1), 2.0);
    COLOR = sum / samples;
}

```

1. In the **Material \> Shader Parameters** , you’ll now see a new parameter called **Blur Radius**. Adjust the value to see the background become blurry.  
![image|432x459]

* * *

## For Those Who Say “I Can’t Write Scripts!”

Godot uses its own shading language called **GDSL** , and shaders must be written in code.  
However, many creators have already made a wide variety of shaders. You might find one that suits your needs by searching online or visiting sites like:

🌐 [https://godotshaders.com/](https://godotshaders.com/)

* * *

## Working with the AnimationPlayer

The `blur_radius` shader parameter can also be animated using the **AnimationPlayer**.  
This makes it very easy to create animated effects using shaders—great for teleportation effects, battle transitions, and more.

* * *

This concludes the **Visual Effects Course**.  
If you’re interested in other tutorials:

**1. Graphics Course**  
For those who want to animate their own original characters.

> [@Tutorial: Graphics Course #1 – Backgrounds and Tiles](https://guild.rpgmakerofficial.com/t/topic/54):
>
> This tutorial course is designed for those who want to start experimenting with their own images right away! Before starting this course, we recommend completing the following introduction: …

**2. Scripting Course**  
For those who are fine using default characters but want to build various mechanics and systems.

> [@Tutorial: Script Course #1 – Let's Create a Shooting Attack](https://guild.rpgmakerofficial.com/t/topic/59):
>
> In this course, you’ll learn the basics of scripting in ACTION GAME MAKER. In Part 1, we’ll be creating a basic attack system. warning Notes on Using Visual Scripts bookmark_tabs Visual Script…
