-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Use data_to_c_simple instead of STRINGIFY for built in 2d filt…
…ers.
- Loading branch information
1 parent
c023048
commit 9e3b5a4
Showing
25 changed files
with
208 additions
and
608 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Blur2DFilter.glsl
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,18 @@ | ||
uniform sampler2D bgl_RenderedTexture; | ||
uniform vec2 bgl_TextureCoordinateOffset[9]; | ||
|
||
void main(void) | ||
{ | ||
vec4 sample[9]; | ||
|
||
for (int i = 0; i < 9; i++) | ||
{ | ||
sample[i] = texture2D(bgl_RenderedTexture, | ||
gl_TexCoord[0].st + bgl_TextureCoordinateOffset[i]); | ||
} | ||
|
||
gl_FragColor = (sample[0] + (2.0*sample[1]) + sample[2] + | ||
(2.0*sample[3]) + sample[4] + (2.0*sample[5]) + | ||
sample[6] + (2.0*sample[7]) + sample[8]) / 13.0; | ||
} | ||
|
55 changes: 0 additions & 55 deletions
55
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Blur2DFilter.h
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Dilation2DFilter.glsl
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,18 @@ | ||
uniform sampler2D bgl_RenderedTexture; | ||
uniform vec2 bgl_TextureCoordinateOffset[9]; | ||
|
||
void main(void) | ||
{ | ||
vec4 sample[9]; | ||
vec4 maxValue = vec4(0.0); | ||
|
||
for (int i = 0; i < 9; i++) | ||
{ | ||
sample[i] = texture2D(bgl_RenderedTexture, | ||
gl_TexCoord[0].st + bgl_TextureCoordinateOffset[i]); | ||
maxValue = max(sample[i], maxValue); | ||
} | ||
|
||
gl_FragColor = maxValue; | ||
} | ||
|
55 changes: 0 additions & 55 deletions
55
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Dilation2DFilter.h
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.glsl
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,17 @@ | ||
uniform sampler2D bgl_RenderedTexture; | ||
uniform vec2 bgl_TextureCoordinateOffset[9]; | ||
|
||
void main(void) | ||
{ | ||
vec4 sample[9]; | ||
vec4 minValue = vec4(1.0); | ||
|
||
for (int i = 0; i < 9; i++) | ||
{ | ||
sample[i] = texture2D(bgl_RenderedTexture, | ||
gl_TexCoord[0].st + bgl_TextureCoordinateOffset[i]); | ||
minValue = min(sample[i], minValue); | ||
} | ||
|
||
gl_FragColor = minValue; | ||
} |
54 changes: 0 additions & 54 deletions
54
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.glsl
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,8 @@ | ||
uniform sampler2D bgl_RenderedTexture; | ||
|
||
void main(void) | ||
{ | ||
vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); | ||
float gray = dot(texcolor.rgb, vec3(0.299, 0.587, 0.114)); | ||
gl_FragColor = vec4(gray, gray, gray, texcolor.a); | ||
} |
Oops, something went wrong.