diff --git a/assets/textures/dirt.png b/assets/textures/dirt.png new file mode 100644 index 0000000..f1e866a Binary files /dev/null and b/assets/textures/dirt.png differ diff --git a/assets/textures/grass.png b/assets/textures/grass.png new file mode 100644 index 0000000..c86311b Binary files /dev/null and b/assets/textures/grass.png differ diff --git a/assets/textures/moss.png b/assets/textures/moss.png new file mode 100644 index 0000000..1bf3dc2 Binary files /dev/null and b/assets/textures/moss.png differ diff --git a/assets/textures/paving_2.png b/assets/textures/paving_2.png new file mode 100644 index 0000000..5a23681 Binary files /dev/null and b/assets/textures/paving_2.png differ diff --git a/assets/textures/rocky_grass.png b/assets/textures/rocky_grass.png new file mode 100644 index 0000000..c87c82d Binary files /dev/null and b/assets/textures/rocky_grass.png differ diff --git a/assets/textures/rocky_grass_2.png b/assets/textures/rocky_grass_2.png new file mode 100644 index 0000000..10f748d Binary files /dev/null and b/assets/textures/rocky_grass_2.png differ diff --git a/core/src/main/java/wtf/beatrice/retrorender/GameScreen.java b/core/src/main/java/wtf/beatrice/retrorender/GameScreen.java index 9da8cd8..2b89069 100644 --- a/core/src/main/java/wtf/beatrice/retrorender/GameScreen.java +++ b/core/src/main/java/wtf/beatrice/retrorender/GameScreen.java @@ -82,11 +82,6 @@ public class GameScreen implements Screen { 60f, 60f, // viewport size 1f, 100f // near/far for the light camera ); - // initial values; DayNightCycle will start animating these - shadowLight.set( - 1.0f, 0.85f, 0.9f, // light color - -0.7f, -1.0f, -0.3f // direction - ); environment.add(shadowLight); environment.shadowMap = shadowLight; @@ -96,9 +91,9 @@ public class GameScreen implements Screen { // create the cycle controller dayNightCycle = new DayNightCycle(shadowLight, ambientLight); // optional: start at morning/noon/etc - dayNightCycle.setTimeOfDay(0.4f); // good sun + dayNightCycle.setTimeOfDay(0.2f); // good sun dayNightCycle.setAxialTilt(30f); - dayNightCycle.setDayLength(60f * 5f); // 20 minutes + dayNightCycle.setDayLength(10f); // 5 minutes } private void initWorld() { diff --git a/core/src/main/java/wtf/beatrice/retrorender/engine/DayNightCycle.java b/core/src/main/java/wtf/beatrice/retrorender/engine/DayNightCycle.java index 6885f82..f798ccc 100644 --- a/core/src/main/java/wtf/beatrice/retrorender/engine/DayNightCycle.java +++ b/core/src/main/java/wtf/beatrice/retrorender/engine/DayNightCycle.java @@ -12,14 +12,14 @@ public class DayNightCycle { private final ColorAttribute ambientLight; // base colors - private final Color dayAmbient = new Color(0.5f, 0.5f, 0.5f, 1f); - private final Color nightAmbient = new Color(0.05f, 0.05f, 0.1f, 1f); + private final Color dayAmbient = new Color(0.6f, 0.7f, 0.7f, 1f); + private final Color nightAmbient = new Color(0.2f, 0.15f, 0.2f, 1f); - private final Color daySunColor = new Color(1.0f, 0.85f, 0.9f, 1f); + private final Color daySunColor = new Color(1.0f, 0.9f, 1f, 1f); private final Color nightSunColor = new Color(0.4f, 0.4f, 0.6f, 1f); - private final Color daySkyColor = new Color(0.5f, 0.6f, 1.0f, 1f); - private final Color nightSkyColor = new Color(0.02f, 0.02f, 0.06f, 1f); + private final Color daySkyColor = new Color(0.8f, 0.9f, 1.0f, 1f); + private final Color nightSkyColor = new Color(0.1f, 0.01f, 0.2f, 1f); private final Color currentSkyColor = new Color(); private final Color tmpSunColor = new Color(); diff --git a/core/src/main/java/wtf/beatrice/retrorender/engine/FpsCameraController.java b/core/src/main/java/wtf/beatrice/retrorender/engine/FpsCameraController.java index 38fbaee..fa9eff6 100644 --- a/core/src/main/java/wtf/beatrice/retrorender/engine/FpsCameraController.java +++ b/core/src/main/java/wtf/beatrice/retrorender/engine/FpsCameraController.java @@ -46,7 +46,7 @@ public class FpsCameraController { private int centerX; private int centerY; private int captureWarmupFrames = 0; - private static final int WARMUP_FRAMES = 6; // frames to ignore after capture + private static final int WARMUP_FRAMES = 10; // frames to ignore after capture private Cursor invisibleCursor; diff --git a/core/src/main/java/wtf/beatrice/retrorender/engine/ModelLibrary.java b/core/src/main/java/wtf/beatrice/retrorender/engine/ModelLibrary.java index 44749b6..d68c56b 100644 --- a/core/src/main/java/wtf/beatrice/retrorender/engine/ModelLibrary.java +++ b/core/src/main/java/wtf/beatrice/retrorender/engine/ModelLibrary.java @@ -15,16 +15,19 @@ public class ModelLibrary { private final ModelBuilder builder = new ModelBuilder(); public final Texture groundTexture; + public final Texture pathTexture; + public final Texture houseTexture; // <-- new + public final Model groundModel; public final Model unitCubeModel; - // new: town-related primitives + // town-related primitives public final Model houseBlockModel; public final Model pathTileModel; public ModelLibrary() { - // --- ground texture + model (unchanged) --- - groundTexture = new Texture(Gdx.files.internal("textures/paving.png")); + // --- ground texture + model --- + groundTexture = new Texture(Gdx.files.internal("textures/rocky_grass_2.png")); groundTexture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest); groundTexture.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat); @@ -55,33 +58,54 @@ public class ModelLibrary { ); groundModel = builder.end(); - // generic 2x2x2 cube + // generic cube (still untextured) unitCubeModel = builder.createBox( 1f, 1f, 1f, new Material(ColorAttribute.createDiffuse(1f, 1f, 1f, 1f)), VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal ); - // simple “blocky house” primitive: 4x3x4 + // --- house texture + model --- + // assumes textures/texture_09.png exists + houseTexture = new Texture(Gdx.files.internal("textures/texture_03.png")); + houseTexture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest); + houseTexture.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat); + houseBlockModel = builder.createBox( 4f, 3f, 4f, - new Material(ColorAttribute.createDiffuse(0.9f, 0.8f, 0.7f, 1f)), - VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal + new Material( + TextureAttribute.createDiffuse(houseTexture) + // optionally tint: + // ColorAttribute.createDiffuse(0.9f, 0.8f, 0.7f, 1f) + ), + VertexAttributes.Usage.Position + | VertexAttributes.Usage.Normal + | VertexAttributes.Usage.TextureCoordinates // <-- important ); - // flat path tile (2D quad slightly above ground) + // --- path tile texture + model --- + pathTexture = new Texture(Gdx.files.internal("textures/paving_2.png")); + pathTexture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest); + pathTexture.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat); + builder.begin(); Material pathMat = new Material( - ColorAttribute.createDiffuse(0.6f, 0.6f, 0.6f, 1f) + TextureAttribute.createDiffuse(pathTexture) ); + MeshPartBuilder pathMpb = builder.part( "pathTile", GL20.GL_TRIANGLES, - VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal, + VertexAttributes.Usage.Position + | VertexAttributes.Usage.Normal + | VertexAttributes.Usage.TextureCoordinates, pathMat ); - float tHalf = 1f; // tile size 4x4 - float y = 0.01f; // just above ground to avoid z-fighting + + float tHalf = 1f; // 2x2 tile + float y = 0.01f; + + pathMpb.setUVRange(0f, 0f, 0.5f, 0.5f); pathMpb.rect( -tHalf, y, tHalf, tHalf, y, tHalf, @@ -97,6 +121,9 @@ public class ModelLibrary { unitCubeModel.dispose(); houseBlockModel.dispose(); pathTileModel.dispose(); + groundTexture.dispose(); + pathTexture.dispose(); + houseTexture.dispose(); // <-- new } }