mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Shadow tweaks
This commit is contained in:
parent
eb62356313
commit
d52f5e6e03
@ -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
|
||||
));
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class BlockRenderer{
|
||||
}
|
||||
|
||||
public void drawShadows(){
|
||||
Draw.color(0, 0, 0, 0.15f);
|
||||
Draw.color(0, 0, 0, 0.25f);
|
||||
Draw.rect(shadowWrite.texture(),
|
||||
Core.camera.position.x - Core.camera.position.x % tilesize,
|
||||
Core.camera.position.y - Core.camera.position.y % tilesize,
|
||||
@ -117,7 +117,8 @@ public class BlockRenderer{
|
||||
Team team = tile.getTeam();
|
||||
|
||||
if(!expanded && block != Blocks.air && world.isAccessible(x, y)){
|
||||
Draw.rect(tile.block().getEditorIcon(), tile.drawx(), tile.drawy());
|
||||
tile.block().draw(tile);
|
||||
//Draw.rect(tile.block().getEditorIcon(), tile.drawx(), tile.drawy());
|
||||
//tile.block().drawShadow(tile);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user