no message

This commit is contained in:
BADIM-PC\Vadim 2018-02-20 15:23:22 +03:00
parent e98573ac1c
commit 4a2f2514ec
3 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,23 @@
#define distortion 0.08
in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D tex;
vec2 radialDistortion(vec2 coord) {
vec2 cc = coord - vec2(0.5);
float dist = dot(cc, cc) * distortion;
return coord + cc * (1.0 - dist) * dist;
}
void main(void) {
vec4 rgba = texture2D(tex, radialDistortion(texCoord));
vec4 intensity = fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5
? vec4(0)
: smoothstep(0.2, 0.8, rgba) + normalize(rgba);
fragColor = intensity * -0.25 + rgba * 1.1;
}

View File

@ -1,4 +1,3 @@
in vec4 color;
in vec2 texCoord; in vec2 texCoord;
out vec4 fragColor; out vec4 fragColor;

View File

@ -1114,7 +1114,7 @@ static s32 start(s32 argc, char **argv, const char* folder)
GPU_Image* texture = GPU_CreateImage(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, GPU_FORMAT_BGRA); GPU_Image* texture = GPU_CreateImage(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, GPU_FORMAT_BGRA);
u32 crt_shader = 0; u32 crt_shader = 0;
GPU_ShaderBlock crt_block = load_shader_program(&crt_shader, "data/shaders/common.vert", "data/shaders/crt-simple.frag"); GPU_ShaderBlock crt_block = load_shader_program(&crt_shader, "data/shaders/common.vert", "data/shaders/crt-geom.frag");
GPU_ActivateShaderProgram(crt_shader, &crt_block); GPU_ActivateShaderProgram(crt_shader, &crt_block);
{ {