The hopper was never crooked
The hopper is a smelter upgrade — a trough you build beside a smelter or kiln to raise how much ore and coal it will hold. Built, placed, and it looked wrong. It leaned.
Except it did not. The tilt diagnostic never fired, which meant the placed rotation was exactly zero. Measuring the mesh found every box face axis-aligned and the bounds symmetric; the only non-aligned geometry was the two eight-sided cone mounds, which are supposed to be round. The model was provably square.
So the lean was painted on. Valheim's piece materials are atlases — one sheet
holding many surfaces — so borrowing a vanilla material means remapping the model's UVs
into that material's rectangle on the sheet. I was doing that with Mathf.Repeat,
which wraps per vertex. A face spanning 0.9 to 1.2 ends up with one vertex at 0.9
and another at 0.2, and the GPU dutifully interpolates backwards across the entire tile.
A smeared diagonal band, which the eye reads as a slope.
Two changes: clamp instead of wrap at runtime, and unwrap inside 0–1 in the generator so there is nothing to wrap in the first place.
The second bug was funnier. The iron banding was coming out pale and wooden, because my
donor list asked for "a station with metal on it" and took its first textured renderer —
which for the artisan table is ArtisanTable_Mat, a wooden bench top. Asking a
cauldron instead fixed it in one line.
The lesson I keep relearning: measure before inferring. Two diagnostics — a rotation check and a per-face axis test — turned "it looks crooked" into "it is not crooked, so look elsewhere", and elsewhere was the only place left.