Update 73

The last level is progressing slowly because I have changed the story little bit at one point and there are a lot of art to redo, new dialogs, and even new shaders.

Most of my shaders are a modified version of some shaders found on shadertoy. This time I have combined two shaders to make one.
This one applies a glitchy effect on the image and also radial blur at the position of the uniform mouse.

varying vec4 color;
varying vec2 texCoord;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform float globalTime;
uniform vec2 resolution;
uniform float Strength;
uniform vec2 mouse;
#define AMPLITUDE 0.2 //0.2
#define SPEED 5 //0.05
float rand(float n){return fract(sin(n) * 43758.5453123);}
vec4 rgbShift( in vec2 p, in vec4 shift, in float Samples) {
shift *= 2.0*shift.w - 1.0;
vec2 rs = vec2(shift.x,-shift.y);
vec2 gs = vec2(shift.y,-shift.z);
vec2 bs = vec2(shift.z,-shift.x);
//vec2 pos = vec2(960.0*(resolution.x/1920.0), 540.0*(resolution.y/1080.0));
vec2 pos = vec2(mouse.x, mouse.y);
vec2 dir = (gl_FragCoord.xy-pos.xy)/resolution.xy*vec2(-1.0,1.0);
float r = 0;
float g = 0;
float b = 0;
float a = 0;
for (int i = 0; i < Samples; i += 2) {
r += texture2D(tex0,p+rs+float(i)/float(Samples)*dir*Strength).x;
g += texture2D(tex0,p+gs+float(i)/float(Samples)*dir*Strength).y;
b += texture2D(tex0,p+bs+float(i)/float(Samples)*dir*Strength).z;
a += texture2D(tex0,p+float(i)/float(Samples)*dir*Strength).w;
r += texture2D(tex0,p+rs+float(i+1)/float(Samples)*dir*Strength).x;
g += texture2D(tex0,p+gs+float(i+1)/float(Samples)*dir*Strength).y;
b += texture2D(tex0,p+bs+float(i+1)/float(Samples)*dir*Strength).z;
a += texture2D(tex0,p+float(i+1)/float(Samples)*dir*Strength).w;
}
return vec4(r,g,b,a);
}
vec4 noise( in vec2 p ) {
return texture2D(tex1, p, 0.0);
}
vec4 vec4pow( in vec4 v, in float p ) {
// Don't touch alpha (w), we use it to choose the direction of the shift
// and we don't want it to go in one direction more often than the other
return vec4(pow(v.x,p),pow(v.y,p),pow(v.z,p),v.w); 
}
void main() {
vec2 p = texCoord;	
vec4 c = vec4(0.0,0.0,0.0,1.0);
vec4 shift = vec4pow(noise(vec2(SPEED*rand(globalTime), 2.0*SPEED*rand(globalTime)/25.0)),11.0)*vec4(AMPLITUDE,AMPLITUDE,AMPLITUDE,1.0);
const int Samples = 64;
c += rgbShift(p, shift, Samples);
gl_FragColor = c/float(Samples);
}

I think most of the shaders of the game are done by now. There is a total of 4 fragment shaders. After that, I have more art to do, maybe some animations and then the ending video of the game (I not sure what to include in the video).

Leave a Reply

Your email address will not be published. Required fields are marked *