diff --git a/core/src/mindustry/graphics/EnvRenderers.java b/core/src/mindustry/graphics/EnvRenderers.java index 6bd42dfc42..a5cebeec1c 100644 --- a/core/src/mindustry/graphics/EnvRenderers.java +++ b/core/src/mindustry/graphics/EnvRenderers.java @@ -22,6 +22,10 @@ public class EnvRenderers{ ((Texture)t).setFilter(TextureFilter.linear); }; + Color particleColor = Color.valueOf("a7c1fa"); + float windSpeed = 0.03f, windAngle = 45f; + float windx = Mathf.cosDeg(windAngle) * windSpeed, windy = Mathf.sinDeg(windAngle) * windSpeed; + renderer.addEnvRenderer(Env.underwater, () -> { Draw.draw(Layer.light + 1, () -> { Draw.color(waterColor, 0.4f); @@ -67,6 +71,18 @@ public class EnvRenderers{ } } + //suspended particles + Draw.draw(Layer.weather, () -> { + Weather.drawParticles(Core.atlas.find("particle"), particleColor, + 1.4f, 4f, //minmax size + 10000f, 1f, 1f, //density + windx, windy, //wind vectors + 0.5f, 1f, //minmax alpha + 30f, 80f, //sinscl + 1f, 7f, //sinmag + false); + }); + Draw.blend(); }); diff --git a/core/src/mindustry/graphics/LightRenderer.java b/core/src/mindustry/graphics/LightRenderer.java index acf0583e02..b117b984bc 100644 --- a/core/src/mindustry/graphics/LightRenderer.java +++ b/core/src/mindustry/graphics/LightRenderer.java @@ -191,7 +191,10 @@ public class LightRenderer{ Draw.color(); buffer.begin(Color.clear); + Draw.sort(false); Gl.blendEquationSeparate(Gl.funcAdd, Gl.max); + //apparently necessary + Blending.normal.apply(); for(Runnable run : lights){ run.run(); @@ -202,6 +205,7 @@ public class LightRenderer{ Draw.rect(circleRegion, cir.x, cir.y, cir.radius * 2, cir.radius * 2); } Draw.reset(); + Draw.sort(true); buffer.end(); Gl.blendEquationSeparate(Gl.funcAdd, Gl.funcAdd); diff --git a/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java b/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java index e0613769ec..9c9012ee3e 100644 --- a/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java @@ -9,7 +9,6 @@ import mindustry.content.*; import mindustry.game.*; import mindustry.maps.generators.*; import mindustry.type.*; -import mindustry.type.Weather.*; import mindustry.world.*; import mindustry.world.meta.*; @@ -49,7 +48,7 @@ public class TantrosPlanetGenerator extends PlanetGenerator{ @Override public void addWeather(Sector sector, Rules rules){ - rules.weather.and(new WeatherEntry(Weathers.suspendParticles)).peek().always = true; + //no weather... yet } @Override diff --git a/core/src/mindustry/type/Weather.java b/core/src/mindustry/type/Weather.java index fe4c0d3aa6..4c8be19a55 100644 --- a/core/src/mindustry/type/Weather.java +++ b/core/src/mindustry/type/Weather.java @@ -147,6 +147,8 @@ public class Weather extends UnlockableContent{ Draw.rect(region, x, y, size, size, rotation); } } + + Draw.reset(); } public static void drawRain(float sizeMin, float sizeMax, float xspeed, float yspeed, float density, float intensity, float stroke, Color color){