Re-added shadows

This commit is contained in:
Anuken
2018-11-11 16:53:03 -05:00
parent 5d80031a40
commit 3b62526267
5 changed files with 10 additions and 8 deletions

View File

@@ -187,7 +187,8 @@ public class Renderer extends RendererModule{
drawAndInterpolate(groundEffectGroup, e -> !(e instanceof BelowLiquidTrait));
blocks.processBlocks();
//blocks.drawShadows();
blocks.drawShadows();
for(Team team : Team.all){
if(blocks.isTeamShown(team)){
boolean outline = team != players[0].getTeam() && team != Team.none;
@@ -218,7 +219,7 @@ public class Renderer extends RendererModule{
blocks.skipLayer(Layer.turret);
blocks.drawBlocks(Layer.laser);
//drawFlyerShadows();
drawFlyerShadows();
drawAllTeams(true);
@@ -261,6 +262,7 @@ public class Renderer extends RendererModule{
private void drawFlyerShadows(){
Graphics.surface(effectSurface, true, false);
float trnsX = -12, trnsY = -13;
for(EntityGroup<? extends BaseUnit> group : unitGroups){

View File

@@ -376,10 +376,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
drawBuilding(this);
if(mech.flying || boostHeat > 0.001f){
float wobblyness = 0.6f;
float wobblyness = 0f;
if(!state.isPaused()) trail.update(x + Angles.trnsx(rotation + 180f, 5f) + Mathf.range(wobblyness),
y + Angles.trnsy(rotation + 180f, 5f) + Mathf.range(wobblyness));
trail.draw(Hue.mix(mech.trailColor, mech.trailColorTo, mech.flying ? 0f : boostHeat, Tmp.c1), 5f * (isFlying() ? 1f : boostHeat));
trail.draw(Hue.mix(mech.trailColor, mech.trailColorTo, mech.flying ? 0f : boostHeat, Tmp.c1), 5f * (isFlying() ? 1f : boostHeat) * Mathf.clamp(velocity.len(), 0f, 2f) / 2f);
}else{
trail.clear();
}

View File

@@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.world;
public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
protected static Translator vec = new Translator();
protected static float wobblyness = 0.6f;
protected static float wobblyness = 0f;
protected Trail trail = new Trail(8);
protected CarriableTrait carrying;
@@ -171,7 +171,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
@Override
public void drawOver(){
trail.draw(type.trailColor, 5f);
trail.draw(type.trailColor, 5f * Mathf.clamp(velocity.len(), 0f, 2f) / 2f);
}
@Override

View File

@@ -352,7 +352,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
@Override
public void drawOver(){
trail.draw(Palette.lightTrail, 3f);
trail.draw(Palette.lightTrail, 3f * Mathf.clamp(velocity.len(), 0, 1f) / 1f);
TargetTrait entity = target;

View File

@@ -58,7 +58,7 @@ public class Trail{
}
if(points.size >= 2){
Fill.circle(points.get(points.size - 2), points.get(points.size - 1), stroke / 2f);
Fill.circle(points.get(points.size - 2), points.get(points.size - 1), stroke / 2f * (points.size - 3f) / points.size);
}
Draw.reset();