feat(client): per-pixel relief terrain shading + cliff Z-rounding #249
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!249
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/relief-texture"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Terrain relief legibility, reworked end-to-end. The previous cliff shading (#247's per-vertex ambient
occlusion) produced hard serrated bands along the iso diamond, deep compounding grooves, a stripe per
road step, and — on a real 30-Z volcano — blocky "right-angle" cliff facets. Diagnosed each artefact to
a root cause (verified against the real map data: a 30-Z
mountain_rockwall beside thevolcanicplain, with a
road_dirtcut through) and fixed each with an established technique, tuned live to theowner's sign-off:
TerrainReliefField, Client.Core,pure/unit-tested): a soft mid-scale gradient (hillshade), a two-scale cavity, and a true-cliff contact
shadow that a walkable ≤
MaxWalkStepZstep never triggers (so roads stop banding). Sampled LINEAR inground_blend.fx→ smooth, off the mesh grid. Replaces the per-vertexHillshade()×TerrainOcclusion(both removed); also drops ~8M
GroundZAt/frame.flat over-bright / flat-dark posterisation; additive with the cavity/cliff terms, floored once at
MinimumShadeso shading never multiplies toward black.(same offset cell for both, so palette/weights stay consistent) so a high-contrast biome border
wobbles organically instead of stair-stepping on the diamond grid. Recovers the old dual-grid's
curved-mask edge, per-pixel, without authored corner art.
TerrainDisplayHeight, Client.Core, pure/unit-tested) — the remaining"right-angle" teeth were the geometry (a 30-Z step is a band of steep mesh triangles). The mesh now
draws vertices at a smoothed Z, gated to real cliffs (relief > the walk step) so walkable terraces
stay bit-exact crisp. Gameplay Z is untouched — the server still validates walkability on integer
GroundZAt; this only moves where a vertex is drawn.WorldRules.MaxWalkStepZ2 → 5 — a natural slope now climbs without a wall while a real cliffstill gates (and rounds); walkable ≤5 stays crisp, consistent with the cliff gate. Server-authoritative
rule, single source (the editor grader and the relief/display gates all read the const).
Client-only rendering + one world-model constant. No wire/protocol change; no
World, save, or text.Screenshots / recording
Piloted via the debug harness (
docs/debug-harness.md) on a fresh DB, adminlogin testthen/tpto the volcano(7509,4972)and the road(7453,4876),screenshoteach.Volcano — before (#247 AO): hard serrated groove down the middle, stepped bands.
Volcano — mid (relief + multidirectional + boundary warp): grooves/banding gone, biome edges
organic, but the sheer 30-Z wall still shows triangular mesh facets ("right-angle" teeth).
Volcano — after (+ display-Z cliff rounding): the teeth are gone; the cliff reads as a continuous
rocky slope.
Road on grass — after: organic dirt/grass border (boundary warp), gentle multidirectional shade;
the walkable road stays crisp (no over-smoothing).
How it was tested
TerrainReliefField(5) — flat → neutralgradient / no cavity / no cliff; a ΔZ ≤
MaxWalkStepZstep → cliff channel 0 (no road banding); a realcliff → a cliff signal that grows with the drop; a uniform ramp → a steady gradient (no per-step
spikes); a valley → cavity at its floor.
TerrainDisplayHeight(4) — flat unchanged; a walkable stepstays crisp (bit-exact 2-Z edge, not a ramp); a 30-Z cliff rounds into a monotone ramp (no sheer
adjacent jump); ground far from any cliff untouched.
dotnet testgreen (761); CSharpier clean.asterraat the problem zones (volcano, staircased road,road cut, coast, flat plain), before/after, tuned live to owner approval.
Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greentex2D, RGBA8 texture; pure CPU math in Client.Core — no OS-specific dependency)