Refine NPC fabric UVs and remove baked AO blotches
Full build / Import + headless tests (push) Successful in 37s
Full build / Full desktop build + optional release (push) Skipped

This commit is contained in:
zwitschi committed 2026-11-02 20:28:25 +01:00
1 parent 31574b8d82
commit d7220c1a0a
12 files changed
+64 -13

No files matched your search

+6
View File
@@ -13,6 +13,10 @@ extends RefCounted
## asphalt replaced the flat first-generation tiles. Normal maps carry the mortar,
## paver joints and aggregate that Compatibility cannot get from screen space.
const PICK_DIR := "res://assets/textures/ai/game_ready/v2/picks/"
## The 256² fabric maps are authored for a fine weave; repeating them 4×
## across the body keeps the pattern readable instead of magnifying one cell
## into a large blotch.
const NPC_FABRIC_UV_SCALE := Vector3(4.0, 4.0, 1.0)
const T_BRICK := preload(PICK_DIR + "brick_facade.png")
const T_CONCRETE := preload(PICK_DIR + "sidewalk_pavers.png")
const T_ASPHALT := preload(PICK_DIR + "asphalt.png")
@@ -49,6 +53,8 @@ static func npc_slot(source: Material, tint: Color) -> StandardMaterial3D:
if material == null:
material = StandardMaterial3D.new()
material.albedo_color = tint
if material.resource_name in ["cloth", "pants"]:
material.uv1_scale = NPC_FABRIC_UV_SCALE
return material
## Wire a baked AO map (red channel) into every surface of an imported mesh.
+4 -1
View File
@@ -483,7 +483,10 @@ func _apply_outfit_materials(npc_type: int, outfit: Dictionary, cloth: Color,
if not tints.has(slot):
continue
var material := Materials.npc_slot(source, tints[slot])
if ao != null:
# The per-character baked AO is applied to skin, hair and fixed gear.
# On the 256² fabric maps it magnified into large patches at portrait
# distance, so cloth/pants keep their ORM weave and rely on lighting.
if ao != null and slot not in ["cloth", "pants"]:
material.ao_enabled = true
material.ao_texture = ao
material.ao_texture_channel = BaseMaterial3D.TEXTURE_CHANNEL_RED