Prototype a more realistic face on npc_casual (higher subdivision, brow ridge, both lids, fuller lip)
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:24:21 +01:00
1 parent 8d32a8cac0
commit 4e23cc3ad5
7 files changed
+50 -26

No files matched your search

+32 -23
View File
@@ -735,11 +735,13 @@ def _hood(name, mat, head_center):
def _shape_head_mesh(head):
"""Sculpt a chin plate and cheekbones into the head sphere itself.
"""Sculpt a brow ridge, cheekbones and a jaw/chin plate into the head sphere.
Separate jaw/cheek spheres leave visible intersection rings in the baked AO,
which read as a beard shadow. Moving the head's own front vertices keeps the
surface continuous while still giving the key light something to catch.
which read as a beard shadow. Only forward protrusions are sculpted; recessed
creases (nasolabial folds, temple hollows, a chin cleft) bake as dark AO
patches on this low-poly head, so they are left to shading. The face front is
-Y (Blender) / +Z (Godot); z is up in this builder.
"""
bm = bmesh.new()
bm.from_mesh(head.data)
@@ -748,42 +750,47 @@ def _shape_head_mesh(head):
if y >= 0.0:
continue
ax = abs(x)
# Chin/jaw plate: forward and slightly wider below the mouth.
# Brow ridge: a shallow forward roll above each eye socket.
brow = (max(0.0, 1.0 - abs(z - 1.695) / 0.030)
* max(0.0, 1.0 - abs(ax - 0.050) / 0.040))
v.co.y -= 0.008 * brow
# Cheekbone: a shallow, wide lift under each eye.
cheek = (max(0.0, 1.0 - abs(z - 1.612) / 0.040)
* max(0.0, 1.0 - abs(ax - 0.070) / 0.050))
v.co.y -= 0.005 * cheek
# Jaw/chin plate: forward and slightly wider below the mouth.
jaw = (max(0.0, 1.0 - abs(z - 1.565) / 0.055)
* max(0.0, 1.0 - ax / 0.075))
v.co.y -= 0.012 * jaw
v.co.x *= 1.0 + 0.06 * jaw
# Cheekbone: a shallow, wide lift under each eye.
cheek = (max(0.0, 1.0 - abs(z - 1.610) / 0.040)
* max(0.0, 1.0 - abs(ax - 0.072) / 0.050))
v.co.y -= 0.006 * cheek
bm.normal_update()
bm.to_mesh(head.data)
bm.free()
def _face(mats, spec):
"""Head with readable eyes, brow ridge, nose, lips and ears.
"""Head with realistic face planes: recessed sockets with both lids, a
sculpted brow/cheek/jaw, a bridged nose with ala and columella, and separated
upper/lower lips.
At conversation distance the eye region carries the read, so each eye gets a
white sclera, a dark iris and an upper lid, and the face gets sculpted
cheekbones and a nose bridge instead of a single cone (realism pass detail
work).
white sclera, a dark iris, an upper and a lower lid, and the face gets
sculpted brow/cheek/jaw planes instead of a bare sphere (realism pass).
"""
skin, acc, hair = mats["skin"], mats["accessory"], mats["hair"]
white = material("eye_white", textured_solid=True)
head = sphere("Head", 0.155, (0, 0, 1.635), skin, seg=18, rings=12,
head = sphere("Head", 0.155, (0, 0, 1.635), skin, seg=24, rings=16,
scale=(0.92, 1.0, 1.12))
_shape_head_mesh(head)
parts = [head]
# nose: bridge and ball (nostrils were cut to stay inside the vertex budget)
# Nose: bridge and ball; the ala widen the base into a small triangle.
parts.append(cyl("NoseBridge", 0.016, 0.022, 0.06, (0, -0.145, 1.652), skin, seg=8,
rot=(math.radians(-72), 0, 0), smooth=True))
parts.append(sphere("NoseTip", 0.022, (0, -0.162, 1.615), skin, seg=10, rings=6,
scale=(1.0, 0.85, 0.80)))
for s in (-1.0, 1.0):
# Ala widen the nose base into a small triangle rather than a ball.
parts.append(sphere("NoseWing", 0.011, (0.015 * s, -0.160, 1.606), skin,
parts.append(sphere("NoseWing", 0.012, (0.016 * s, -0.160, 1.606), skin,
seg=6, rings=4, scale=(1.0, 0.65, 0.75)))
# Ear with a lobe and a darker concha; the old disc had no depth cue.
parts.append(sphere("Ear", 0.036, (0.143 * s, 0.008, 1.63), skin, seg=8, rings=5,
@@ -792,27 +799,29 @@ def _face(mats, spec):
rings=5, scale=(0.45, 1.0, 0.9)))
parts.append(sphere("EarInner", 0.013, (0.149 * s, -0.003, 1.633), acc,
seg=6, rings=4, scale=(0.28, 0.65, 0.90)))
# Eye: recess the sclera into the socket, then wrap it with skin lids.
# Eye: recess the sclera into the socket, then wrap it with both lids.
# The old white ball sat ~1 cm proud of the head; this keeps the iris
# readable without the doll-like bulge.
ex, ey, ez = 0.052 * s, -0.134, 1.664
parts.append(sphere("EyeWhite", 0.019, (ex, ey, ez), white, seg=8, rings=5,
parts.append(sphere("EyeWhite", 0.019, (ex, ey, ez), white, seg=10, rings=6,
scale=(1.25, 0.62, 0.85)))
parts.append(sphere("Iris", 0.0105, (ex, ey - 0.007, ez), acc, seg=8, rings=5,
scale=(1.0, 0.55, 1.0)))
# One thin upper lid; no lower lid, which made the eyes read as
# half-closed slits at conversation distance.
parts.append(sphere("UpperLid", 0.020, (ex, ey - 0.006, ez + 0.014), skin,
seg=8, rings=4, scale=(1.20, 0.32, 0.24),
rot=(math.radians(-10), 0, 0)))
# A thin lower lid keeps the eye from reading as a floating white oval.
parts.append(sphere("LowerLid", 0.017, (ex, ey - 0.004, ez - 0.012), skin,
seg=8, rings=4, scale=(1.10, 0.22, 0.18),
rot=(math.radians(6), 0, 0)))
parts.append(box("Brow", (0.055, 0.014, 0.012), (0.052 * s, -0.143, 1.699), hair,
rot=(0, 0.14 * s, 0.0)))
# lips: upper and lower instead of a single bar
# One rounded mouth slot instead of two flat boxes. Two dark lip blobs read
# as a moustache at portrait distance; a single shallow oval keeps the mouth
# line without adding a second dark mass.
# Mouth: one rounded dark slot (the old clean read) plus a fuller lower lip
# in skin so the mouth line gains a subtle volume cue without a moustache read.
parts.append(sphere("Mouth", 0.028, (0, -0.158, 1.583), acc, seg=8, rings=5,
scale=(1.0, 0.28, 0.12)))
parts.append(sphere("LowerLip", 0.012, (0, -0.156, 1.578), skin, seg=8, rings=5,
scale=(1.2, 0.55, 0.30)))
if spec.get("beard"):
parts.append(sphere("Beard", 0.105, (0, -0.06, 1.55), hair, seg=12, rings=8,
scale=(1.0, 0.9, 0.75), cut_below=-0.2))