glow shader works better, changed way of loading assets, default song set up

This commit is contained in:
2017-10-08 19:07:34 -05:00
parent 4c329e8d8f
commit 6d135e3b2b
21 changed files with 255 additions and 82 deletions

View File

@@ -14,20 +14,20 @@ uniform sampler2D u_texture;
uniform float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
void main() {
vec2 tex_offset = 1.0 /textureSize(u_texture, 0);
vec3 result = texture(u_texture, vTexCoord).rgb * weight[0];
if (horizontal == 1) {
for (int i = 1; i < 5; ++i) {
result += texture(u_texture, vTexCoord + vec2(tex_offset.x *i, 0.0)).rgb * weight[i];
result += texture(u_texture, vTexCoord - vec2(tex_offset.x *i, 0.0)).rgb * weight[i];
}
} else {
for (int i = 1; i < 5; ++i) {
result += texture(u_texture, vTexCoord + vec2(0.0, tex_offset.y * i)).rgb * weight[i];
result += texture(u_texture, vTexCoord - vec2(0.0, tex_offset.y * i)).rgb * weight[i];
}
}
gl_FragColor = vec4(result, 1.0);
}
vec2 tex_offset = 1.0 / textureSize(u_texture, 0);
vec3 result = texture(u_texture, vTexCoord).rgb * weight[0];
if (horizontal == 1) {
for (int i = 1; i < 5; ++i) {
result += texture(u_texture, vTexCoord + vec2(tex_offset.x * i, 0.0)).rgb * weight[i];
result += texture(u_texture, vTexCoord - vec2(tex_offset.x * i, 0.0)).rgb * weight[i];
}
} else {
for (int i = 1; i < 5; ++i) {
result += texture(u_texture, vTexCoord + vec2(0.0, tex_offset.y * i)).rgb * weight[i];
result += texture(u_texture, vTexCoord - vec2(0.0, tex_offset.y * i)).rgb * weight[i];
}
}
gl_FragColor = vec4(result, 1.0);
}