forked from Siv3D/OpenSiv3D
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gaussian_blur_5, gaussian_blur_13 を追加 (Siv3D#1148)
- Loading branch information
1 parent
11d4d8f
commit beb0444
Showing
35 changed files
with
816 additions
and
136 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
Linux/App/resources/engine/shader/essl/gaussian_blur_13.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# version 300 es | ||
|
||
// Copyright (c) 2008-2023 Ryo Suzuki. | ||
// Copyright (c) 2016-2023 OpenSiv3D Project. | ||
// Licensed under the MIT License. | ||
|
||
precision mediump float; | ||
|
||
// | ||
// Textures | ||
// | ||
uniform sampler2D Texture0; | ||
|
||
// | ||
// PSInput | ||
// | ||
in vec4 Color; | ||
in vec2 UV; | ||
|
||
// | ||
// PSOutput | ||
// | ||
layout(location = 0) out vec4 FragColor; | ||
|
||
// | ||
// Constant Buffer | ||
// | ||
layout(std140) uniform PSConstants2D | ||
{ | ||
vec4 g_colorAdd; | ||
vec4 g_sdfParam; | ||
vec4 g_sdfOutlineColor; | ||
vec4 g_sdfShadowColor; | ||
vec2 g_pixelSize; | ||
vec2 g_direction; | ||
}; | ||
|
||
// | ||
// Functions | ||
// | ||
void main() | ||
{ | ||
vec2 offset1 = (1.41176470588235 * g_direction); | ||
vec2 offset2 = (3.29411764705882 * g_direction); | ||
vec2 offset3 = (5.17647058823529 * g_direction); | ||
|
||
vec4 color = (texture(Texture0, UV) * 0.196482550151140); | ||
color += (texture(Texture0, UV + (offset1 * g_pixelSize)) * 0.296906964672834); | ||
color += (texture(Texture0, UV - (offset1 * g_pixelSize)) * 0.296906964672834); | ||
color += (texture(Texture0, UV + (offset2 * g_pixelSize)) * 0.0944703978504473); | ||
color += (texture(Texture0, UV - (offset2 * g_pixelSize)) * 0.0944703978504473); | ||
color += (texture(Texture0, UV + (offset3 * g_pixelSize)) * 0.0103813624011481); | ||
color += (texture(Texture0, UV - (offset3 * g_pixelSize)) * 0.0103813624011481); | ||
|
||
FragColor = color; | ||
} |
50 changes: 50 additions & 0 deletions
50
Linux/App/resources/engine/shader/essl/gaussian_blur_5.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# version 300 es | ||
|
||
// Copyright (c) 2008-2023 Ryo Suzuki. | ||
// Copyright (c) 2016-2023 OpenSiv3D Project. | ||
// Licensed under the MIT License. | ||
|
||
precision mediump float; | ||
|
||
// | ||
// Textures | ||
// | ||
uniform sampler2D Texture0; | ||
|
||
// | ||
// PSInput | ||
// | ||
in vec4 Color; | ||
in vec2 UV; | ||
|
||
// | ||
// PSOutput | ||
// | ||
layout(location = 0) out vec4 FragColor; | ||
|
||
// | ||
// Constant Buffer | ||
// | ||
layout(std140) uniform PSConstants2D | ||
{ | ||
vec4 g_colorAdd; | ||
vec4 g_sdfParam; | ||
vec4 g_sdfOutlineColor; | ||
vec4 g_sdfShadowColor; | ||
vec2 g_pixelSize; | ||
vec2 g_direction; | ||
}; | ||
|
||
// | ||
// Functions | ||
// | ||
void main() | ||
{ | ||
vec2 offset1 = (1.33333333333333 * g_direction); | ||
|
||
vec4 color = (texture(Texture0, UV) * 0.294117647058824); | ||
color += (texture(Texture0, UV + (offset1 * g_pixelSize)) * 0.352941176470588); | ||
color += (texture(Texture0, UV - (offset1 * g_pixelSize)) * 0.352941176470588); | ||
|
||
FragColor = color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Linux/App/resources/engine/shader/glsl/gaussian_blur_13.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (c) 2008-2023 Ryo Suzuki. | ||
// Copyright (c) 2016-2023 OpenSiv3D Project. | ||
// Licensed under the MIT License. | ||
|
||
# version 410 | ||
|
||
// | ||
// Textures | ||
// | ||
uniform sampler2D Texture0; | ||
|
||
// | ||
// PSInput | ||
// | ||
layout(location = 0) in vec4 Color; | ||
layout(location = 1) in vec2 UV; | ||
|
||
// | ||
// PSOutput | ||
// | ||
layout(location = 0) out vec4 FragColor; | ||
|
||
// | ||
// Constant Buffer | ||
// | ||
layout(std140) uniform PSConstants2D | ||
{ | ||
vec4 g_colorAdd; | ||
vec4 g_sdfParam; | ||
vec4 g_sdfOutlineColor; | ||
vec4 g_sdfShadowColor; | ||
vec2 g_pixelSize; | ||
vec2 g_direction; | ||
}; | ||
|
||
// | ||
// Functions | ||
// | ||
void main() | ||
{ | ||
vec2 offset1 = (1.41176470588235 * g_direction); | ||
vec2 offset2 = (3.29411764705882 * g_direction); | ||
vec2 offset3 = (5.17647058823529 * g_direction); | ||
|
||
vec4 color = (texture(Texture0, UV) * 0.196482550151140); | ||
color += (texture(Texture0, UV + (offset1 * g_pixelSize)) * 0.296906964672834); | ||
color += (texture(Texture0, UV - (offset1 * g_pixelSize)) * 0.296906964672834); | ||
color += (texture(Texture0, UV + (offset2 * g_pixelSize)) * 0.0944703978504473); | ||
color += (texture(Texture0, UV - (offset2 * g_pixelSize)) * 0.0944703978504473); | ||
color += (texture(Texture0, UV + (offset3 * g_pixelSize)) * 0.0103813624011481); | ||
color += (texture(Texture0, UV - (offset3 * g_pixelSize)) * 0.0103813624011481); | ||
|
||
FragColor = color; | ||
} |
48 changes: 48 additions & 0 deletions
48
Linux/App/resources/engine/shader/glsl/gaussian_blur_5.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) 2008-2023 Ryo Suzuki. | ||
// Copyright (c) 2016-2023 OpenSiv3D Project. | ||
// Licensed under the MIT License. | ||
|
||
# version 410 | ||
|
||
// | ||
// Textures | ||
// | ||
uniform sampler2D Texture0; | ||
|
||
// | ||
// PSInput | ||
// | ||
layout(location = 0) in vec4 Color; | ||
layout(location = 1) in vec2 UV; | ||
|
||
// | ||
// PSOutput | ||
// | ||
layout(location = 0) out vec4 FragColor; | ||
|
||
// | ||
// Constant Buffer | ||
// | ||
layout(std140) uniform PSConstants2D | ||
{ | ||
vec4 g_colorAdd; | ||
vec4 g_sdfParam; | ||
vec4 g_sdfOutlineColor; | ||
vec4 g_sdfShadowColor; | ||
vec2 g_pixelSize; | ||
vec2 g_direction; | ||
}; | ||
|
||
// | ||
// Functions | ||
// | ||
void main() | ||
{ | ||
vec2 offset1 = (1.33333333333333 * g_direction); | ||
|
||
vec4 color = (texture(Texture0, UV) * 0.294117647058824); | ||
color += (texture(Texture0, UV + (offset1 * g_pixelSize)) * 0.352941176470588); | ||
color += (texture(Texture0, UV - (offset1 * g_pixelSize)) * 0.352941176470588); | ||
|
||
FragColor = color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//----------------------------------------------- | ||
// | ||
// This file is part of the Siv3D Engine. | ||
// | ||
// Copyright (c) 2008-2023 Ryo Suzuki | ||
// Copyright (c) 2016-2023 OpenSiv3D Project | ||
// | ||
// Licensed under the MIT License. | ||
// | ||
//----------------------------------------------- | ||
|
||
# pragma once | ||
|
||
namespace s3d | ||
{ | ||
enum class BoxFilterSize | ||
{ | ||
BoxFilter5x5 = 5, | ||
|
||
BoxFilter9x9 = 9, | ||
|
||
BoxFilter13x13 = 13, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.