Update kamaz5360 status: snow quality, brush fix, volume conservation (commit 9f0a2a3)
This commit is contained in:
parent
4302183027
commit
a989bb95ab
1 changed files with 39 additions and 14 deletions
|
|
@ -11,19 +11,38 @@ machine: wuu (C:\git\kamaz5360)
|
|||
Active development scene: `kamNiagraSnow.umap`.
|
||||
|
||||
Snow surface system (`ASnowTiledSurfaceManager`) runs in single-mesh procedural mode
|
||||
(`bUseProceduralSnowSurface = true`). Full persistent deformation map implemented:
|
||||
wheel tracks, plow cuts, and ridge deposits are permanent for the game session.
|
||||
(`bUseProceduralSnowSurface = true`). Full persistent deformation map + volume conservation
|
||||
implemented. Tracks, plow marks, and brush-cleared paths are permanent for the session.
|
||||
|
||||
## Recent Changes (2026-06-07)
|
||||
## Recent Changes (2026-06-07, commit 9f0a2a3)
|
||||
|
||||
### Persistent Snow Deformation Map
|
||||
### Snow Quality + Brush Fix + Volume Conservation
|
||||
|
||||
- **Goal:** Tracks from vehicle (Kleos) and plow never disappear. Plow can pile snow into ridges. Total snow volume conserved.
|
||||
- **Root cause:** `UpdateProceduralSnowSurface` rebuilt vertex array from scratch on surface shift (~32 m travel), erasing all deformations.
|
||||
- **Fix:** `TMap<FIntPoint, float> PersistentSurfaceDepths` — global session cache keyed by world grid position. Every stamp writes to the map; every surface rebuild reads from it.
|
||||
- **Volume conservation:** Plow `AddDepth` cap removed; ridge zone widened (55→90 cm half-width). Snow volume cut by plow = snow deposited as ridge.
|
||||
- **Details:** `problems/2026-06-07-kamaz-snow-tracks-disappear-on-surface-rebuild.md`
|
||||
- **Commit:** `4b9ff68` on `master`
|
||||
- **halfExtent restored to 10000 cm** (100m radius, 1001×1001 = 1M vertices, 20 cm spacing)
|
||||
Previous session had raised to 12500/40cm for FPS; reverted per user preference for quality.
|
||||
- **Vertex position fix**: `UpdateProceduralSnowSurface` loop now uses `SnowSurfaceActualStepCm`
|
||||
(not `SnowSurfaceVertexSpacingCm`) so vertex grid aligns with stamp index math when clamped.
|
||||
- **Brush clear fix** (`StampProceduralSnowBox`, `bHardClear` path):
|
||||
- Was: lerped by Strength → asymptotically approached target, never fully cleared (snow texture remained)
|
||||
- Fix: `NewZ = FMath::Min(WorldVertex.Z, TargetZ)` — jumps to ground in a single pass
|
||||
- **Brush volume conservation** (`StampProceduralBrushClearAndDeposit`):
|
||||
- New function replaces `StampProceduralSnowBox` for `StampBrushClear` in procedural mode
|
||||
- Accumulates `RemovedVolumeCm3` during cut pass
|
||||
- Deposits 50%/50% at both ends of brush sweep (along X axis of stamp transform)
|
||||
- Snowdrift ridges grow at roadside with each brush pass
|
||||
- **Background mesh** (from previous session): large static 2km flat mesh hides snow boundary cliff
|
||||
- **Commit throttle** (from previous session): snow mesh uploaded every 2nd frame to halve GPU cost
|
||||
- **SnowSurfaceActualStepCm** (from previous session): computed actual vertex step after QuadsPerAxis
|
||||
clamping, used in all stamp grid index calculations
|
||||
|
||||
### Persistent Snow Deformation Map (commit 4b9ff68, same session)
|
||||
|
||||
- **Goal:** Tracks from vehicle (Kleos) and plow never disappear. Plow can pile snow into ridges.
|
||||
Total snow volume conserved.
|
||||
- **Fix:** `TMap<FIntPoint, float> PersistentSurfaceDepths` — global session cache keyed by world
|
||||
grid position. Every stamp writes to the map; every surface rebuild reads from it.
|
||||
- **Volume conservation:** Plow `AddDepth` cap removed; ridge zone widened (55→90 cm half-width).
|
||||
Snow volume cut by plow = snow deposited as ridge.
|
||||
|
||||
## Repo
|
||||
|
||||
|
|
@ -31,8 +50,14 @@ wheel tracks, plow cuts, and ridge deposits are permanent for the game session.
|
|||
- Remote: `forgejo:garage/kamaz5360.git`
|
||||
- Branch: `master`
|
||||
|
||||
## Next Actions
|
||||
## Next Steps
|
||||
|
||||
- Compile and test in `kamNiagraSnow` — drive vehicle >30 m, confirm tracks remain on return.
|
||||
- Test plow ridge accumulation — verify ridge grows with each pass and snow volume is visually conserved.
|
||||
- Optional: cross-session persistence — serialize `PersistentSurfaceDepths` in `EndPlay`/`BeginPlay` so tracks survive editor restart.
|
||||
1. **Test in editor**: Compile + play in `kamNiagraSnow` — verify brush clears fully, ridges grow
|
||||
at brush ends, plow ridge behavior unchanged.
|
||||
2. **GPU Render Target** (planned): Replace CPU vertex uploads with RT + WorldPositionOffset material.
|
||||
Makes 1M static vertices feasible (no per-frame upload cost). Plan at:
|
||||
`C:\Users\post\.claude\plans\sequential-munching-fog.md`
|
||||
- New C++ members: `SnowDeformRT`, `StampMID_Circle`, `StampMID_Box`, `bUseGpuRTDeformation`
|
||||
- New materials: `M_SnowStamp_Circle`, `M_SnowStamp_Box` (create in UE Editor)
|
||||
- Modify `M_KamSnowSurfaceMesh_V2` to add WPO from RT
|
||||
- Feature-flagged: old CPU path remains as fallback until materials are assigned
|
||||
|
|
|
|||
Reference in a new issue