Better build beam visuals

This commit is contained in:
Anuken
2020-12-25 21:49:10 -05:00
parent 834e4f175b
commit 9f8fce72d3
13 changed files with 147 additions and 36 deletions

View File

@@ -30,6 +30,7 @@ public class Renderer implements ApplicationListener{
public @Nullable Bloom bloom;
public FrameBuffer effectBuffer = new FrameBuffer();
public float laserOpacity = 1f;
public boolean animateShields;
/** minZoom = zooming out, maxZoom = zooming in */
public float minZoom = 1.5f, maxZoom = 6f;
@@ -69,7 +70,8 @@ public class Renderer implements ApplicationListener{
float dest = Mathf.round(targetscale, 0.5f);
camerascale = Mathf.lerpDelta(camerascale, dest, 0.1f);
if(Mathf.equal(camerascale, dest, 0.001f)) camerascale = dest;
laserOpacity = Core.settings.getInt("lasersopacity") / 100f;
laserOpacity = settings.getInt("lasersopacity") / 100f;
animateShields = settings.getBool("animatedshields");
if(landTime > 0){
landTime -= Time.delta;
@@ -204,7 +206,7 @@ public class Renderer implements ApplicationListener{
graphics.clear(clearColor);
Draw.reset();
if(Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")){
if(Core.settings.getBool("animatedwater") || animateShields){
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
}
@@ -248,11 +250,16 @@ public class Renderer implements ApplicationListener{
Draw.draw(Layer.plans, overlays::drawBottom);
if(settings.getBool("animatedshields") && Shaders.shield != null){
if(animateShields && Shaders.shield != null){
Draw.drawRange(Layer.shields, 1f, () -> effectBuffer.begin(Color.clear), () -> {
effectBuffer.end();
effectBuffer.blit(Shaders.shield);
});
Draw.drawRange(Layer.buildBeam, 1f, () -> effectBuffer.begin(Color.clear), () -> {
effectBuffer.end();
effectBuffer.blit(Shaders.buildBeam);
});
}
Draw.draw(Layer.overlayUI, overlays::drawTop);