Atmosphere tweaks

This commit is contained in:
Anuken
2020-03-29 18:34:00 -04:00
parent f22e1bdeb3
commit 7ba7e14282
8 changed files with 44 additions and 30 deletions

View File

@@ -18,6 +18,7 @@ public class Planets implements ContentList{
//lightColor = Color.valueOf("f4ee8e");
meshLoader = () -> new SunMesh(this, 3){{
setColors(
1.1f,
Color.valueOf("ff7a38"),
Color.valueOf("ff9638"),
Color.valueOf("ffc64c"),

View File

@@ -68,6 +68,8 @@ public class Shaders{
setUniformf("u_rcampos", Tmp.v31.set(camera.position).sub(planet.position));
setUniformf("u_light", planet.getLightNormal());
setUniformf("u_color", planet.atmosphereColor.r, planet.atmosphereColor.g, planet.atmosphereColor.b);
setUniformf("u_innerRadius", planet.radius + 0.02f);
setUniformf("u_outerRadius", planet.radius * 1.3f);
setUniformMatrix4("u_model", planet.getTransform(mat).val);
setUniformMatrix4("u_projection", camera.combined.val);

View File

@@ -16,13 +16,17 @@ public class SunMesh extends ShaderSphereMesh{
}
public void setColors(Color... colors){
setColors(1f, colors);
}
public void setColors(float scl, Color... colors){
colorValues = new float[colors.length*4];
for(int i = 0; i < colors.length; i ++){
colorValues[i*4] = colors[i].r;
colorValues[i*4 + 1] = colors[i].g;
colorValues[i*4 + 2] = colors[i].b;
colorValues[i*4 + 3] = colors[i].a;
colorValues[i*4] = colors[i].r * scl;
colorValues[i*4 + 1] = colors[i].g * scl;
colorValues[i*4 + 2] = colors[i].b * scl;
colorValues[i*4 + 3] = colors[i].a * scl;
}
}

View File

@@ -246,8 +246,12 @@ public class Mods implements Loadable{
LoadedMod mod = loadMod(file);
mods.add(mod);
}catch(Throwable e){
Log.err("Failed to load mod file {0}. Skipping.", file);
Log.err(e);
if(e instanceof ClassNotFoundException && e.getMessage().contains("mindustry.plugin.Plugin")){
Log.info("Plugin {0} is outdated and needs to be ported to 6.0! Update its main class to inherit from 'mindustry.mod.Plugin'.");
}else{
Log.err("Failed to load mod file {0}. Skipping.", file);
Log.err(e);
}
}
}

View File

@@ -1,7 +1,6 @@
package mindustry.ui.dialogs;
import arc.*;
import arc.fx.util.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.graphics.g3d.*;
@@ -46,6 +45,7 @@ public class PlanetDialog extends FloatingDialog{
private final Bloom bloom = new Bloom(Core.graphics.getWidth()/4, Core.graphics.getHeight()/4, true, false, true){{
setClearColor(0, 0, 0, 0);
setThreshold(0.8f);
blurPasses = 6;
}};
@@ -53,7 +53,6 @@ public class PlanetDialog extends FloatingDialog{
private float lastX, lastY;
private @Nullable Sector selected, hovered;
private Table stable;
private ScreenQuad quad = new ScreenQuad();
private Mesh atmosphere = MeshBuilder.buildHex(new HexMesher(){
@Override
public float getHeight(Vec3 position){
@@ -149,11 +148,11 @@ public class PlanetDialog extends FloatingDialog{
projector.proj(cam.combined());
batch.proj(cam.combined());
//bloom.capture();
bloom.capture();
renderPlanet(solarSystem);
//bloom.render();
bloom.render();
Gl.enable(Gl.blend);