glow shader works better, changed way of loading assets, default song set up
This commit is contained in:
@@ -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);
|
||||
}
|
Reference in New Issue
Block a user