Merged 4x graphics
This commit is contained in:
@@ -29,10 +29,6 @@ bool cont(vec2 T, vec2 v){
|
||||
id(T + vec2(step, 0) * v, base) || id(T + vec2(-step, 0) * v, base));
|
||||
}
|
||||
|
||||
float rand(vec2 co){
|
||||
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
vec2 t = v_texCoord.xy;
|
||||
@@ -51,11 +47,11 @@ void main() {
|
||||
chance = 1.0-(u_progress-0.8)*5.0;
|
||||
}
|
||||
|
||||
if((mod(u_time / 1.5 + value, 20.0) < 5.0 && cont(t, v)) && rand(coords) < chance){
|
||||
if((mod(u_time / 1.5 + value, 20.0) < 5.0 && cont(t, v))){
|
||||
gl_FragColor = u_color;
|
||||
}else if(dst > (1.0-u_progress) * (center.x)){
|
||||
gl_FragColor = color;
|
||||
}else if((dst + 1.0 > (1.0-u_progress) * (center.x)) && color.a > 0.1 && rand(coords) < chance){
|
||||
}else if((dst + 1.0 > (1.0-u_progress) * (center.x)) && color.a > 0.1){
|
||||
gl_FragColor = u_color;
|
||||
}else{
|
||||
gl_FragColor = vec4(0.0);
|
||||
|
||||
@@ -29,18 +29,11 @@ void main() {
|
||||
|
||||
vec4 c = texture2D(u_texture, v_texCoord.xy);
|
||||
|
||||
vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y);
|
||||
float step = 1.0;
|
||||
|
||||
bool outline = texture2D(u_texture, t).a < 0.1 &&
|
||||
(id(texture2D(u_texture, t + vec2(0, step) * v)) || id(texture2D(u_texture, t + vec2(0, -step) * v)) ||
|
||||
id(texture2D(u_texture, t + vec2(step, 0) * v)) || id(texture2D(u_texture, t + vec2(-step, 0) * v)));
|
||||
|
||||
if(1.0-abs(coords.x - 0.5)*2.0 < 1.0-u_progress){
|
||||
c = vec4(0.0);
|
||||
}
|
||||
|
||||
if(c.a > 0.01 || outline){
|
||||
if(c.a > 0.01){
|
||||
float f = abs(sin(coords.x*2.0 + u_time));
|
||||
if(f > 0.9 )
|
||||
f = 1.0;
|
||||
|
||||
@@ -7,6 +7,7 @@ precision mediump int;
|
||||
#define p2 vec3(234.0,182.0,120.0)/255.0
|
||||
#define p3 vec3(212.0,129.0,107.0)/255.0
|
||||
#define p4 vec3(142.0,77.0,72.0)/255.0
|
||||
#define roundm 0.2
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
uniform vec2 u_resolution;
|
||||
@@ -21,12 +22,11 @@ varying vec2 v_texCoord;
|
||||
void main() {
|
||||
ivec2 coords = ivec2((gl_FragCoord.xy - u_resolution/2.0)/u_scl);
|
||||
|
||||
int roundx = 8;
|
||||
int roundy = roundx;
|
||||
float roundm = 0.2;
|
||||
//int roundx = 8;
|
||||
//int roundy = roundx;
|
||||
|
||||
coords.x = (coords.x / roundx) * roundx;
|
||||
coords.y = (coords.y / roundy) * roundy;
|
||||
//coords.x = (coords.x / roundx) * roundx;
|
||||
//coords.y = (coords.y / roundy) * roundy;
|
||||
|
||||
float d = (abs(float(coords.x)) - abs(float(coords.y)));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
#define SPACE 1.0
|
||||
#define SPACE 2.0
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
@@ -20,8 +20,23 @@ void main() {
|
||||
|
||||
gl_FragColor = mix(c * v_color, u_color,
|
||||
(1.0-step(0.1, texture2D(u_texture, v_texCoord.xy).a)) *
|
||||
step(0.1, texture2D(u_texture, v_texCoord.xy + vec2(0, SPACE) * v).a +
|
||||
step(0.1,
|
||||
//cardinals
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(0, SPACE) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(0, -SPACE) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(SPACE, 0) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, 0) * v).a));
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, 0) * v).a +
|
||||
|
||||
//cardinal edges
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(SPACE, SPACE) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(SPACE, -SPACE) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, SPACE) * v).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, -SPACE) * v).a +
|
||||
|
||||
//cardinals * 2
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(0, SPACE) * v*2.0).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(0, -SPACE) * v*2.0).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(SPACE, 0) * v*2.0).a +
|
||||
texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, 0) * v*2.0).a
|
||||
));
|
||||
}
|
||||
|
||||
+2643
-2734
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 327 KiB |
Reference in New Issue
Block a user