This commit is contained in:
Anuken
2020-10-08 14:06:07 -04:00
parent e05ac5ae41
commit d06449f311
18 changed files with 3555 additions and 3359 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

+1
View File
@@ -313,3 +313,4 @@
63423=memory-bank|block-memory-bank-medium 63423=memory-bank|block-memory-bank-medium
63422=foreshadow|block-foreshadow-medium 63422=foreshadow|block-foreshadow-medium
63421=tsunami|block-tsunami-medium 63421=tsunami|block-tsunami-medium
63420=space|block-space-medium
+23
View File
@@ -0,0 +1,23 @@
#define HIGHP
#define NSCALE 2000.0
#define CAMSCALE (NSCALE*1.1)
uniform sampler2D u_texture;
uniform sampler2D u_stars;
uniform vec2 u_campos;
uniform vec2 u_ccampos;
uniform vec2 u_resolution;
uniform float u_time;
varying vec2 v_texCoords;
void main(){
vec2 c = v_texCoords.xy;
vec2 coords = vec2(c.x * u_resolution.x + u_campos.x, c.y * u_resolution.y + u_campos.y);
vec4 color = texture2D(u_texture, c);
color.rgb = texture2D(u_stars, coords / NSCALE + vec2(0.5, 0.3) - u_ccampos / CAMSCALE);
gl_FragColor = color;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

After

Width:  |  Height:  |  Size: 825 B

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 KiB

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

+8 -1
View File
@@ -35,7 +35,7 @@ public class Blocks implements ContentList{
public static Block public static Block
//environment //environment
air, spawn, cliff, deepwater, water, taintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, air, spawn, cliff, deepwater, water, taintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space,
dacite, stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster, dacite, stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, grass, salt, iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, grass, salt,
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, basalt, magmarock, hotrock, snowWall, boulder, snowBoulder, saltWall, metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, basalt, magmarock, hotrock, snowWall, boulder, snowBoulder, saltWall,
@@ -216,6 +216,13 @@ public class Blocks implements ContentList{
lightColor = Color.orange.cpy().a(0.38f); lightColor = Color.orange.cpy().a(0.38f);
}}; }};
space = new Floor("space"){{
cacheLayer = CacheLayer.space;
placeableOn = false;
solid = true;
variants = 0;
}};
stone = new Floor("stone"); stone = new Floor("stone");
craters = new Floor("craters"){{ craters = new Floor("craters"){{
@@ -51,6 +51,17 @@ public enum CacheLayer{
endShader(Shaders.slag); endShader(Shaders.slag);
} }
}, },
space{
@Override
public void begin(){
beginShader();
}
@Override
public void end(){
endShader(Shaders.space);
}
},
normal(5), normal(5),
walls(3); walls(3);
+29 -1
View File
@@ -19,7 +19,7 @@ public class Shaders{
public static UnitBuild build; public static UnitBuild build;
public static DarknessShader darkness; public static DarknessShader darkness;
public static LightShader light; public static LightShader light;
public static SurfaceShader water, mud, tar, slag; public static SurfaceShader water, mud, tar, slag, space;
public static PlanetShader planet; public static PlanetShader planet;
public static PlanetGridShader planetGrid; public static PlanetGridShader planetGrid;
public static AtmosphereShader atmosphere; public static AtmosphereShader atmosphere;
@@ -44,6 +44,7 @@ public class Shaders{
mud = new SurfaceShader("mud"); mud = new SurfaceShader("mud");
tar = new SurfaceShader("tar"); tar = new SurfaceShader("tar");
slag = new SurfaceShader("slag"); slag = new SurfaceShader("slag");
space = new SpaceShader("space");
planet = new PlanetShader(); planet = new PlanetShader();
planetGrid = new PlanetGridShader(); planetGrid = new PlanetGridShader();
atmosphere = new AtmosphereShader(); atmosphere = new AtmosphereShader();
@@ -196,6 +197,33 @@ public class Shaders{
} }
} }
public static class SpaceShader extends SurfaceShader{
Texture texture;
public SpaceShader(String frag){
super(frag);
Core.assets.load("cubemaps/stars/bottom.png", Texture.class).loaded = t -> {
texture = (Texture)t;
texture.setFilter(TextureFilter.linear);
texture.setWrap(TextureWrap.mirroredRepeat);
};
}
@Override
public void apply(){
setUniformf("u_campos", Core.camera.position.x - Core.camera.width / 2, Core.camera.position.y - Core.camera.height / 2);
setUniformf("u_ccampos", Core.camera.position);
setUniformf("u_resolution", Core.camera.width, Core.camera.height);
setUniformf("u_time", Time.time());
texture.bind(1);
renderer.effectBuffer.getTexture().bind(0);
setUniformi("u_stars", 1);
}
}
public static class SurfaceShader extends LoadShader{ public static class SurfaceShader extends LoadShader{
public SurfaceShader(String frag){ public SurfaceShader(String frag){
+1 -1
View File
@@ -346,7 +346,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
} }
public boolean solid(){ public boolean solid(){
return block.solid || (build != null && build.checkSolid()); return block.solid || floor.solid || (build != null && build.checkSolid());
} }
public boolean breakable(){ public boolean breakable(){