space
|
After Width: | Height: | Size: 120 B |
@@ -313,3 +313,4 @@
|
||||
63423=memory-bank|block-memory-bank-medium
|
||||
63422=foreshadow|block-foreshadow-medium
|
||||
63421=tsunami|block-tsunami-medium
|
||||
63420=space|block-space-medium
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 819 B After Width: | Height: | Size: 825 B |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 326 KiB After Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 429 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 314 KiB After Width: | Height: | Size: 331 KiB |
|
Before Width: | Height: | Size: 426 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
@@ -35,7 +35,7 @@ public class Blocks implements ContentList{
|
||||
public static Block
|
||||
|
||||
//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,
|
||||
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,
|
||||
@@ -216,6 +216,13 @@ public class Blocks implements ContentList{
|
||||
lightColor = Color.orange.cpy().a(0.38f);
|
||||
}};
|
||||
|
||||
space = new Floor("space"){{
|
||||
cacheLayer = CacheLayer.space;
|
||||
placeableOn = false;
|
||||
solid = true;
|
||||
variants = 0;
|
||||
}};
|
||||
|
||||
stone = new Floor("stone");
|
||||
|
||||
craters = new Floor("craters"){{
|
||||
|
||||
@@ -51,6 +51,17 @@ public enum CacheLayer{
|
||||
endShader(Shaders.slag);
|
||||
}
|
||||
},
|
||||
space{
|
||||
@Override
|
||||
public void begin(){
|
||||
beginShader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end(){
|
||||
endShader(Shaders.space);
|
||||
}
|
||||
},
|
||||
normal(5),
|
||||
walls(3);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Shaders{
|
||||
public static UnitBuild build;
|
||||
public static DarknessShader darkness;
|
||||
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 PlanetGridShader planetGrid;
|
||||
public static AtmosphereShader atmosphere;
|
||||
@@ -44,6 +44,7 @@ public class Shaders{
|
||||
mud = new SurfaceShader("mud");
|
||||
tar = new SurfaceShader("tar");
|
||||
slag = new SurfaceShader("slag");
|
||||
space = new SpaceShader("space");
|
||||
planet = new PlanetShader();
|
||||
planetGrid = new PlanetGridShader();
|
||||
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 SurfaceShader(String frag){
|
||||
|
||||
@@ -346,7 +346,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
}
|
||||
|
||||
public boolean solid(){
|
||||
return block.solid || (build != null && build.checkSolid());
|
||||
return block.solid || floor.solid || (build != null && build.checkSolid());
|
||||
}
|
||||
|
||||
public boolean breakable(){
|
||||
|
||||