-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8178a1b
commit d31e68d
Showing
9 changed files
with
189 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#version 130 | ||
|
||
in vec2 v_position; | ||
in vec2 v_texCoord; | ||
|
||
out vec2 p_texCoord; | ||
|
||
void main() | ||
{ | ||
gl_Position = vec4(v_position, 0, 1); | ||
p_texCoord = v_texCoord; | ||
} |
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,10 @@ | ||
#version 130 | ||
|
||
in vec4 p_color; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() | ||
{ | ||
fragColor = p_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#version 130 | ||
|
||
uniform sampler2D diffuseTexture; | ||
|
||
uniform vec2 pixelSize; | ||
|
||
in vec2 p_texCoord; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() | ||
{ | ||
vec2 uv = p_texCoord; | ||
|
||
vec4 c = texture(diffuseTexture, uv) * 3; | ||
|
||
uv.x = p_texCoord.x + pixelSize.x * 1.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv) * 2; | ||
|
||
uv.x = p_texCoord.x - pixelSize.x * 1.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv) * 2; | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y + pixelSize.y * 1.5; | ||
c += texture(diffuseTexture, uv) * 2; | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y - pixelSize.y * 1.5; | ||
c += texture(diffuseTexture, uv) * 2; | ||
|
||
|
||
uv.x = p_texCoord.x + pixelSize.x * 3.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x - pixelSize.x * 3.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y + pixelSize.y * 3.5; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y - pixelSize.y * 3.5; | ||
c += texture(diffuseTexture, uv); | ||
|
||
|
||
uv.x = p_texCoord.x + pixelSize.x * 5.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x - pixelSize.x * 5.5; | ||
uv.y = p_texCoord.y; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y + pixelSize.y * 5.5; | ||
c += texture(diffuseTexture, uv); | ||
|
||
uv.x = p_texCoord.x; | ||
uv.y = p_texCoord.y - pixelSize.y * 5.5; | ||
c += texture(diffuseTexture, uv); | ||
|
||
c /= 19; | ||
|
||
fragColor = c; | ||
} |
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,14 @@ | ||
#version 130 | ||
|
||
uniform sampler2D diffuseTexture; | ||
|
||
in vec4 p_color; | ||
in vec2 p_texcoord; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() | ||
{ | ||
vec4 c = p_color * texture(diffuseTexture, p_texcoord); | ||
fragColor = c; | ||
} |
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,21 @@ | ||
#version 130 | ||
|
||
uniform mat4 projectionMatrix; | ||
uniform mat4 modelviewMatrix; | ||
|
||
in vec3 v_position; | ||
in vec2 v_texcoord; | ||
in vec4 v_color; | ||
in vec2 v_expand; | ||
|
||
out vec4 p_color; | ||
out vec2 p_texcoord; | ||
|
||
void main() | ||
{ | ||
vec4 p = modelviewMatrix * vec4(v_position, 1.0); | ||
p += vec4(v_expand, 0.0, 0.0); | ||
gl_Position = projectionMatrix * p; | ||
p_color = v_color; | ||
p_texcoord = v_texcoord; | ||
} |
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,15 @@ | ||
#version 130 | ||
|
||
uniform mat4 projectionMatrix; | ||
uniform mat4 modelviewMatrix; | ||
|
||
in vec3 v_position; | ||
in vec4 v_color; | ||
|
||
out vec4 p_color; | ||
|
||
void main() | ||
{ | ||
gl_Position = projectionMatrix * modelviewMatrix * vec4(v_position, 1.0); | ||
p_color = v_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 130 | ||
|
||
uniform sampler2D diffuseTexture; | ||
|
||
in vec4 p_color; | ||
in vec2 p_texcoord; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() | ||
{ | ||
vec4 c = p_color * texture(diffuseTexture, p_texcoord); | ||
fragColor = c; | ||
} |
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,15 @@ | ||
#version 130 | ||
|
||
uniform sampler2D diffuseTexture; | ||
uniform float intensity = 1; | ||
|
||
in vec4 p_color; | ||
in vec2 p_texcoord; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() | ||
{ | ||
vec4 c = p_color * texture(diffuseTexture, p_texcoord) * vec4(vec3(intensity), 1); | ||
fragColor = c; | ||
} |
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 @@ | ||
#version 130 | ||
|
||
uniform mat4 projectionMatrix; | ||
uniform mat4 modelviewMatrix; | ||
|
||
in vec3 v_position; | ||
in vec2 v_texcoord; | ||
in vec4 v_color; | ||
|
||
out vec4 p_color; | ||
out vec2 p_texcoord; | ||
|
||
void main() | ||
{ | ||
gl_Position = projectionMatrix * modelviewMatrix * vec4(v_position, 1.0); | ||
p_color = v_color; | ||
p_texcoord = v_texcoord; | ||
} |