Planet rendering infrastructure stuff
This commit is contained in:
@@ -7,4 +7,7 @@ import arc.math.geom.*;
|
||||
public interface HexMesher{
|
||||
float getHeight(Vec3 position);
|
||||
Color getColor(Vec3 position);
|
||||
default boolean skip(Vec3 position){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ public class MeshBuilder{
|
||||
begin(grid.tiles.length * 12 * (3 + 3 + 1));
|
||||
|
||||
for(Ptile tile : grid.tiles){
|
||||
if(mesher.skip(tile.v)){
|
||||
continue;
|
||||
}
|
||||
|
||||
Corner[] c = tile.corners;
|
||||
|
||||
|
||||
@@ -158,22 +158,11 @@ public class PlanetRenderer implements Disposable{
|
||||
}
|
||||
|
||||
if(cam.frustum.containsSphere(planet.position, planet.clipRadius) && planet.parent != null && planet.hasAtmosphere && Core.settings.getBool("atmosphere")){
|
||||
Gl.depthMask(false);
|
||||
|
||||
Blending.additive.apply();
|
||||
|
||||
Shaders.atmosphere.camera = cam;
|
||||
Shaders.atmosphere.planet = planet;
|
||||
Shaders.atmosphere.bind();
|
||||
Shaders.atmosphere.apply();
|
||||
|
||||
atmosphere.render(Shaders.atmosphere, Gl.triangles);
|
||||
|
||||
Blending.normal.apply();
|
||||
|
||||
Gl.depthMask(true);
|
||||
planet.drawAtmosphere(atmosphere, cam);
|
||||
}
|
||||
|
||||
planet.drawClouds(cam.combined, planet.getTransform(mat));
|
||||
|
||||
for(Planet child : planet.children){
|
||||
renderTransparent(child);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user