Give the foliage two green tones and fix the textured_solid import bug
Full build / Import + headless tests (push) Successful in 42s
Full build / Full desktop build + optional release (push) Skipped

This commit is contained in:
zwitschi committed 2026-11-04 10:40:27 +01:00
1 parent abe5c3f933
commit 0a9c78cb30
9 files changed
+25 -9

No files matched your search

+14 -6
View File
@@ -198,6 +198,7 @@ PALETTE = {
"foliage": ((54, 104, 46), 0.85, 0.0, 0.0),
"foliage_dark": ((36, 78, 36), 0.85, 0.0, 0.0),
"palm_leaf": ((70, 112, 50), 0.8, 0.0, 0.0),
"palm_leaf_dark": ((52, 88, 40), 0.8, 0.0, 0.0),
"bark": ((92, 70, 52), 0.95, 0.0, 0.0),
"palm_bark": ((128, 104, 78), 0.95, 0.0, 0.0),
"glass": ((90, 120, 140), 0.08, 0.2, 0.0),
@@ -1223,14 +1224,17 @@ def build_gear(name):
# ---------------------------------------------------------------------------
def _shrub(name, center, radii, mat, lumps=7, seed=1, lump=0.42):
"""Dense foliage cluster: many small flat-shaded clumps, not one smooth blob.
"""Dense foliage cluster: many small flat-shaded clumps in two greens.
Reads as leaves at game distance because the silhouette is broken up and the
facets catch the light, which is what the realism-pass foliage note asks for.
Alternating light/dark clumps break the single-colour read that made the
old shrub look like a rock; the facets still catch the light at game
distance (the realism-pass foliage note).
"""
parts = []
import random
rng = random.Random(seed)
mat_light = material("foliage")
mat_dark = material("foliage_dark")
parts.append(sphere(name, 1.0, center, mat, seg=10, rings=7, scale=radii,
smooth=False))
for i in range(lumps * 2): # inner clumps fill the volume
@@ -1240,7 +1244,8 @@ def _shrub(name, center, radii, mat, lumps=7, seed=1, lump=0.42):
off = (center[0] + math.cos(a) * radii[0] * ring,
center[1] + math.sin(a) * radii[1] * ring,
center[2] + rng.uniform(-0.2, 0.55) * radii[2])
parts.append(sphere(name, 1.0, off, mat, seg=8, rings=6,
parts.append(sphere(name, 1.0, off, mat_light if i % 2 == 0 else mat_dark,
seg=8, rings=6,
scale=(radii[0] * r, radii[1] * r, radii[2] * r * 0.9),
smooth=False))
for i in range(max(3, lumps // 2)): # outer clumps break the silhouette
@@ -1249,7 +1254,8 @@ def _shrub(name, center, radii, mat, lumps=7, seed=1, lump=0.42):
off = (center[0] + math.cos(a) * radii[0] * rng.uniform(0.85, 1.0),
center[1] + math.sin(a) * radii[1] * rng.uniform(0.85, 1.0),
center[2] + rng.uniform(-0.05, 0.4) * radii[2])
parts.append(sphere(name, 1.0, off, mat, seg=8, rings=6,
parts.append(sphere(name, 1.0, off, mat_dark if i % 2 == 0 else mat_light,
seg=8, rings=6,
scale=(radii[0] * r, radii[1] * r, radii[2] * r * 0.8),
rot=(rng.uniform(0, 1), rng.uniform(0, 1), rng.uniform(0, 3)),
smooth=False))
@@ -1392,7 +1398,9 @@ def build_prop(name):
bm.faces.new((a1, a2, b2, b1))
bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=1e-4)
frond = _link("Frond", bm)
_finish(frond, M("palm_leaf"), smooth=True, sharp_angle=80)
# Alternate two greens so the crown is not one flat colour.
_finish(frond, M("palm_leaf" if i % 2 == 0 else "palm_leaf_dark"),
smooth=True, sharp_angle=80)
p.append(frond)
elif name == "round_planter": # mockup pot with topiary, ~1.0 m
p.append(lathe("Pot", [(0.0, 0.0), (0.22, 0.0), (0.26, 0.05), (0.33, 0.50),