diff --git a/tools/IconForge/render.py b/tools/IconForge/render.py index 6c454b5a..2dbb8527 100644 --- a/tools/IconForge/render.py +++ b/tools/IconForge/render.py @@ -1,7 +1,7 @@ """Software rasterizer for the exported mosswart mesh. -Loads the JSON dumped by tools/MosswartArt, textures dumped by tools/IconExtract, -and renders a lit, shaded, supersampled image. Deliberately simple: z-buffer, +Loads the geometry and textures dumped by tools/MosswartArt into work/, and +renders a lit, shaded, supersampled image. Deliberately simple: z-buffer, perspective camera, Lambert key/fill/rim + Blinn specular for wet skin. """ import json, glob, os, math @@ -9,8 +9,9 @@ import numpy as np from PIL import Image HERE = os.path.dirname(os.path.abspath(__file__)) -ROOT = os.path.abspath(os.path.join(HERE, "..", "..")) -TEXDIR = os.path.join(ROOT, "tools", "IconExtract", "bin", "Release", "net10.0", "out") +# Default matches where tools/MosswartArt writes its texture dump. forge.py +# overrides this when --work points elsewhere. +TEXDIR = os.path.join(HERE, "work", "textures") # ---------------------------------------------------------------- data loading @@ -19,6 +20,10 @@ def load_textures(ids): for tid in ids: hits = glob.glob(os.path.join(TEXDIR, tid + "_*.png")) if not hits: + # Say so: a partial texture set renders some parts flat grey, which + # is easy to mistake for a lighting problem rather than a missing + # extraction step. + print(f" WARNING: no texture found for {tid} in {TEXDIR}") continue im = Image.open(hits[0]).convert("RGBA") out[tid] = np.asarray(im, dtype=np.float32) / 255.0