Refactor farm building speed to builder unit action_speeds and enable infinite charges

This commit is contained in:
bart
2026-11-08 17:01:26 +01:00
parent 55e4276025
commit 17901ce25c
10 changed files with 847 additions and 121 deletions
+21
View File
@@ -11,6 +11,11 @@ uniform sampler2D texTundra; // Unit 8 (Texturelabs_Soil_135XL tundra soil)
uniform sampler2D texRedSand; // Unit 9 (Texturelabs_RedSand prairie sand)
uniform sampler2D texRedRock; // Unit 10 (Texturelabs_RedRock canyon cliff)
uniform sampler2D texForest; // Unit 11 (Texturelabs_Forest_seamless woodland floor)
uniform sampler2D texFarm; // Unit 12 (images/farm.jpeg)
uniform int isFarm;
uniform float farmTextureScale;
uniform int farmMappingMode;
uniform float time;
uniform int riverMask;
@@ -213,6 +218,22 @@ void main() {
+ tundraColor * tundraWeight
+ redSandColor * prairieWeight;
// Farm improvement texture applied when a farm is present
if (isFarm == 1) {
float scale = max(0.01, farmTextureScale);
vec2 farmUV;
if (farmMappingMode == 1) {
// Hex-centered mapping with aspect ratio correction
vec2 centered = vec2(tilePos.x - 0.5, (tilePos.y - 0.4328799) * 1.154734411);
farmUV = centered * scale + vec2(0.5, 0.5);
} else {
// World-space coordinates: perfectly seamless and continuous across adjacent hex tiles
farmUV = vWorldPos.xy * scale;
}
vec4 farmColor = texture(texFarm, farmUV);
biomeGround = farmColor;
}
// Shoreline beach: where gentle slopes meet water (sea level up to ~110m, or along rivers)
// Steep slopes (norm.z < 0.55) remain rocky cliffs; gentle slopes (norm.z > 0.80) get a sandy beach
float gentleSlope = smoothstep(0.55, 0.85, norm.z);