-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an LCD shader effect for a more retro look.
- Loading branch information
Showing
8 changed files
with
136 additions
and
47 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
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,36 @@ | ||
#include "gui/gui.h" | ||
|
||
/* | ||
** TODO | ||
*/ | ||
char const *SHADER_FRAG_LCD = GLSL( | ||
layout(location = 0) out vec4 frag_color; | ||
|
||
in vec2 v_uv; | ||
|
||
uniform sampler2D u_screen_map; | ||
|
||
void main() { | ||
vec4 color = texture(u_screen_map, v_uv); | ||
|
||
vec4 lcd = vec4(0.8); | ||
|
||
int offset_x = int(mod(gl_FragCoord.x, 3.0)); | ||
int offset_y = int(mod(gl_FragCoord.y, 3.0)); | ||
|
||
if (offset_x == 0) { | ||
lcd.r = 1.0f; | ||
} else if (offset_x == 1) { | ||
lcd.g = 1.0f; | ||
} else if (offset_x == 2) { | ||
lcd.b = 1.0f; | ||
} | ||
|
||
if (offset_y == 0) { | ||
lcd = vec4(0.8); | ||
} | ||
|
||
frag_color = color * lcd; | ||
frag_color.a = 1.0f; | ||
} | ||
); |
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