Directional force projector prototype
This commit is contained in:
@@ -476,3 +476,4 @@
|
||||
63230=titan|block-titan-ui
|
||||
63229=horde|block-horde-ui
|
||||
63228=small-deconstructor|block-small-deconstructor-ui
|
||||
63227=barrier-projector|block-barrier-projector-ui
|
||||
|
||||
Binary file not shown.
@@ -18,24 +18,32 @@ void main(){
|
||||
|
||||
T += vec2(sin(coords.y / 3.0 + u_time / 20.0), sin(coords.x / 3.0 + u_time / 20.0)) / u_texsize;
|
||||
|
||||
vec4 color = texture2D(u_texture, T);
|
||||
vec2 v = u_invsize;
|
||||
vec4 color = texture2D(u_texture, T);
|
||||
vec2 v = u_invsize;
|
||||
|
||||
vec4 maxed = max(max(max(texture2D(u_texture, T + vec2(0, step) * v), texture2D(u_texture, T + vec2(0, -step) * v)), texture2D(u_texture, T + vec2(step, 0) * v)), texture2D(u_texture, T + vec2(-step, 0) * v));
|
||||
vec4 maxed = max(max(max(max(max(max(max(
|
||||
texture2D(u_texture, T + vec2(0, step) * v),
|
||||
texture2D(u_texture, T + vec2(0, -step) * v)),
|
||||
texture2D(u_texture, T + vec2(step, 0) * v)),
|
||||
texture2D(u_texture, T + vec2(-step, 0) * v)),
|
||||
|
||||
if(texture2D(u_texture, T).a < 0.9 && maxed.a > 0.9){
|
||||
texture2D(u_texture, T + vec2(-step, -step) * v)),
|
||||
texture2D(u_texture, T + vec2(-step, step) * v)),
|
||||
texture2D(u_texture, T + vec2(step, -step) * v)),
|
||||
texture2D(u_texture, T + vec2(step, step) * v));
|
||||
|
||||
gl_FragColor = vec4(maxed.rgb, maxed.a * 100.0);
|
||||
}else{
|
||||
if(texture2D(u_texture, T).a < 0.9 && maxed.a > 0.9){
|
||||
gl_FragColor = vec4(maxed.rgb, maxed.a * 100.0);
|
||||
}else{
|
||||
|
||||
if(color.a > 0.0){
|
||||
if(mod(coords.x / u_dp + coords.y / u_dp + sin(coords.x / u_dp / 5.0) * 3.0 + sin(coords.y / u_dp / 5.0) * 3.0 + u_time / 4.0, 10.0) < 2.0){
|
||||
color *= 1.65;
|
||||
}
|
||||
|
||||
color.a = ALPHA;
|
||||
}
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
if(color.a > 0.0){
|
||||
if(mod(coords.x / u_dp + coords.y / u_dp + sin(coords.x / u_dp / 5.0) * 3.0 + sin(coords.y / u_dp / 5.0) * 3.0 + u_time / 4.0, 10.0) < 2.0){
|
||||
color *= 1.65;
|
||||
}
|
||||
|
||||
color.a = ALPHA;
|
||||
}
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user