Shadow tweaks
This commit is contained in:
@@ -3,7 +3,7 @@ precision mediump float;
|
|||||||
precision mediump int;
|
precision mediump int;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SPACE 1.0
|
#define SPACE 2.0
|
||||||
|
|
||||||
uniform sampler2D u_texture;
|
uniform sampler2D u_texture;
|
||||||
|
|
||||||
@@ -20,8 +20,23 @@ void main() {
|
|||||||
|
|
||||||
gl_FragColor = mix(c * v_color, u_color,
|
gl_FragColor = mix(c * v_color, u_color,
|
||||||
(1.0-step(0.1, texture2D(u_texture, v_texCoord.xy).a)) *
|
(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(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));
|
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(){
|
public void drawShadows(){
|
||||||
Draw.color(0, 0, 0, 0.15f);
|
Draw.color(0, 0, 0, 0.25f);
|
||||||
Draw.rect(shadowWrite.texture(),
|
Draw.rect(shadowWrite.texture(),
|
||||||
Core.camera.position.x - Core.camera.position.x % tilesize,
|
Core.camera.position.x - Core.camera.position.x % tilesize,
|
||||||
Core.camera.position.y - Core.camera.position.y % tilesize,
|
Core.camera.position.y - Core.camera.position.y % tilesize,
|
||||||
@@ -117,7 +117,8 @@ public class BlockRenderer{
|
|||||||
Team team = tile.getTeam();
|
Team team = tile.getTeam();
|
||||||
|
|
||||||
if(!expanded && block != Blocks.air && world.isAccessible(x, y)){
|
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);
|
//tile.block().drawShadow(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user