Merge branch 'feature/sky-fixes' — sky/weather rendering retail-faithful pass
Six commits on the branch, three retail-decomp investigations (in-house + two external code-review agents) converging on the same root causes:97fc1b5fix(sky): translucency-as-opacity + sky fog floor + additive fog-skip05a8a72fix(sky): retail-faithful sun-vector magnitude for SunColor / AmbientColor034a684fix(sky): partition sky pass on Properties bit 0x01, not bit 0x04375065bfix(meshing): Translucent flag overrides Additive blend per retail SetSurface646cccafeat(sky): load Setup-backed (0x020xxx) sky objects via SetupMesh.Flatten0c82d2cdocs(issues): #28 root-caused (PES particles), #29 filed Net effect: * Sun + ambient colors now use retail's |sunVec| magnitude formula from PrimD3DRender::UpdateLightsInternal at decomp 424118 — fixes blue-white sky tint at most keyframes. * Surface.Translucency is used DIRECTLY as opacity (not 1-x) per D3DPolyRender::SetSurface at decomp 425255 — fixes 3× too-bright cloud + correct rain alpha. * Sky fog re-enabled with SKY_FOG_FLOOR=0.2 mitigation — horizon haze visible without flat-fogging the dome at storm keyframes. * Additive surfaces skip fog per SetFFFogAlphaDisabled at decomp 425295 — sun stays bright at horizon dusk/dawn. * Pre/post-scene partition is bit 0x01 (post-scene placement) instead of bit 0x04 (weather gate), per GameSky::CreateDeletePhysicsObjects at decomp 269036. Fixes double-rendered foreground rain. * Translucent flag forces alpha-blend over Additive when ClipMap is set, matching retail's blend resolution at decomp 425246-425260. Cloud surface 0x08000023 now classified correctly. * Setup-backed sky objects (0x020xxxxx) now load via SetupMesh.Flatten instead of being silently dropped by EnsureMeshUploaded. Tests: 1227 pass. User-visible improvements: foreground rain matches retail's volumetric look, sky tint shifted from blue-white toward retail's warm-gray, additive sun stays bright through horizon haze. Outstanding: * Issue #28 — PES particle rendering ("aurora light play"). Now root-caused with implementation outline; defer to its own Phase. * Issue #29 — residual cloud-density gap; likely rolls into #28. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> # Conflicts: # src/AcDream.App/Rendering/GameWindow.cs
This commit is contained in:
commit
f7c9e88b6a
18 changed files with 1439 additions and 290 deletions
121
docs/ISSUES.md
121
docs/ISSUES.md
|
|
@ -177,26 +177,6 @@ missing is the plugin-API surface.
|
|||
|
||||
---
|
||||
|
||||
## #1 — Rain falls only to horizon, not to the player's feet
|
||||
|
||||
**Status:** OPEN
|
||||
**Severity:** MEDIUM
|
||||
**Filed:** 2026-04-25
|
||||
**Component:** weather / particles
|
||||
|
||||
**Description:** During Rainy DayGroups, rain particles are visible in the upper sky band but fade out before reaching the camera / ground level. Retail's rain falls all the way past the camera to the terrain.
|
||||
|
||||
**Root cause / status:** Unknown. Likely one of: (a) particle emitter volume too short in Z, (b) particle lifetime shorter than the time it takes to traverse emitter-top → ground, (c) emitter anchored in world-space so particles escape the player's reference frame as they fall, (d) camera-relative spawn origin is offset too high above the player.
|
||||
|
||||
**Files:**
|
||||
- `src/AcDream.App/Rendering/GameWindow.cs` — `UpdateWeatherParticles` (~line 4591)
|
||||
- `src/AcDream.Core/Vfx/ParticleSystem.cs` — emitter spawn config + lifetime integration
|
||||
|
||||
**Research:** `docs/research/deepdives/r12-weather-daynight.md` (rain mechanism — but does not pin volume / lifetime values).
|
||||
|
||||
**Acceptance:** Standing at 9,115 in Holtburg during a Rainy DayGroup, rain drops visibly fall all the way from the sky band past the camera to the ground level.
|
||||
|
||||
---
|
||||
|
||||
## #2 — Lightning visual not wired (dat-baked PES triggers)
|
||||
|
||||
|
|
@ -292,10 +272,111 @@ missing is the plugin-API surface.
|
|||
|
||||
---
|
||||
|
||||
## #28 — Aurora ("northern lights") effect not rendered
|
||||
|
||||
**Status:** OPEN
|
||||
**Severity:** LOW (aesthetic feature-parity)
|
||||
**Filed:** 2026-04-26
|
||||
**Component:** sky / vfx
|
||||
|
||||
**Description:** Retail renders a dynamic colored "light play" effect in the sky during certain Rainy/Cloudy DayGroup time windows. The user describes it as aurora-borealis-style. acdream renders no comparable effect.
|
||||
|
||||
**Root cause:** PES (Particle Effect Schedule) particles attached to SkyObjects via the `CelestialPosition.pes_id` field. Retail header at `acclient.h` line 35451 (verbatim):
|
||||
|
||||
```c
|
||||
struct CelestialPosition {
|
||||
IDClass<...> gfx_id;
|
||||
IDClass<...> pes_id; // ← particle scheduler ID
|
||||
float heading; float rotation;
|
||||
Vector3 tex_velocity;
|
||||
float transparent; float luminosity; float max_bright;
|
||||
unsigned int properties;
|
||||
};
|
||||
```
|
||||
|
||||
`StarsProbe` confirmed Dereth Rainy DayGroup 3 carries multiple PES-bearing entries (verified 2026-04-27). Sample for the user's observed Warmtide-Rainy state:
|
||||
|
||||
| OI | Gfx | **PES** | Active window | Notes |
|
||||
|----|-----|---------|----|----|
|
||||
| 5 | 0x02000714 | 0x330007DB | always | low-rate background |
|
||||
| 7 | 0x02000BA6 | 0x33000453 | 0.03–0.19 | early morning |
|
||||
| 17 | 0x02000589 | **0x3300042C** | **0.27–0.91** | **active during user's screenshot** |
|
||||
|
||||
acdream's geometry half is now wired (commit landing 2026-04-27 — `EnsureSetupUploaded` walks `Setup.Parts` for `0x020xxx` IDs). The dynamic visual half — emitting and animating the PES particles — is unimplemented and provides the actual aurora look. Phase E.3 already has data-only PES support per memory crib `project_session_2026_04_18.md`; this issue requires the runtime + visual half.
|
||||
|
||||
**Implementation outline:**
|
||||
1. PES dat decode (already partially in `AcDream.Core.World.PesData` per Phase E.3).
|
||||
2. PES emitter runtime — schedule, spawn, advect, color-cycle, expire each particle.
|
||||
3. `SkyRenderer` integration — when `MakeObject` sees `pes_id != 0`, spawn the PES at the SkyObject's celestial position.
|
||||
4. PES vertex-sprite renderer — billboarded textured quads with additive blending and color cycling. Probably reuses the future general-purpose particle renderer (issue #L? — TBD).
|
||||
|
||||
**Decomp pointers:**
|
||||
- `CPhysicsObj::InitPartArrayObject` decomp ~280484 — dispatches type 7 to Setup loader.
|
||||
- `CPartArray::CreateSetup` decomp ~287490 — Setup → Parts → optional PES wiring.
|
||||
|
||||
**Files:**
|
||||
- `src/AcDream.Core/World/SkyDescLoader.cs` — `SkyObjectData` needs to carry `PesObjectId` (currently dropped on the floor).
|
||||
- `src/AcDream.App/Rendering/Sky/SkyRenderer.cs` — needs a particle-emission step alongside the per-SkyObject mesh draw.
|
||||
|
||||
**Acceptance:** When retail shows aurora-style light play at a specific in-game time / weather, acdream shows a visually-comparable effect at the same time.
|
||||
|
||||
---
|
||||
|
||||
## #29 — Cloud surface 0x08000023 still appears thinner than retail despite blend-mode + Setup fixes
|
||||
|
||||
**Status:** OPEN
|
||||
**Severity:** LOW (aesthetic feature-parity)
|
||||
**Filed:** 2026-04-27
|
||||
**Component:** sky / clouds
|
||||
|
||||
**Description:** User screenshot comparison showed acdream's clouds let too much sun through; retail's are denser and have a purpleish tint. Two follow-up fixes landed without visible improvement:
|
||||
|
||||
1. `TranslucencyKindExtensions.FromSurfaceType` now applies retail's Translucent-override at `D3DPolyRender::SetSurface` (decomp 425246-425260) — surface `0x08000023` (Type=`0x10114` = `B1ClipMap | Translucent | Alpha | Additive`) is now correctly classified as `AlphaBlend` instead of `Additive`.
|
||||
2. `SkyRenderer.EnsureSetupUploaded` now loads `0x020xxxxx` Setup IDs (e.g. `0x02000588`, `0x02000589`, `0x02000714`, `0x02000BA6`) which were silently dropped. Setup parts are flattened via `SetupMesh.Flatten` and uploaded with their per-part transform baked into vertex positions.
|
||||
|
||||
Despite both being decomp-correct fixes, the user reports no observable visual change in dual-client comparison. Two follow-up hypotheses:
|
||||
|
||||
- The Setup objects are tiny placeholder meshes (one `0x010001EC` part each) that exist mainly to anchor a PES emitter — the cloud "density" / "purple sheen" the user perceives is entirely the PES particle layer, not the static mesh.
|
||||
- The cloud surface might still be rendering correctly per its dat data, and what looks "thicker" in retail is the additional aurora-like PES sheen overlaid on top.
|
||||
|
||||
If hypothesis (a) is correct, this issue effectively rolls into **#28** — the PES rendering work would resolve both.
|
||||
|
||||
**Files:**
|
||||
- `src/AcDream.Core/Meshing/TranslucencyKind.cs` — Translucent override
|
||||
- `src/AcDream.App/Rendering/Sky/SkyRenderer.cs` — `EnsureSetupUploaded`
|
||||
|
||||
**Acceptance:** Cloud sheets look as dense/purple as retail in dual-client side-by-side. May require #28 (PES) to land first.
|
||||
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
# Recently closed
|
||||
|
||||
## #27 — [DONE 2026-04-26] Cloud meshes appeared missing or faint vs retail
|
||||
|
||||
**Closed:** 2026-04-26
|
||||
**Commit:** `4678b3e fix(sky): apply per-Surface Translucency + Luminosity for retail-faithful weather`
|
||||
**Resolution:** Resolved as a side-effect of the Bug A fix. The original observation came from a session where every sky mesh got `effEmissive = 1.0` (saturated `vTint` to white), which made stars/clouds look full-bright instead of time-of-day-tinted. Fix 2 corrected the emissive default to `sub.SurfLuminosity` so cloud surfaces (Lum=0.0) now run through the ambient+diffuse vertex-lit path and pick up keyframe tint. Fix 1 separately plumbed `surface.Translucency` to the shader, picking up the 0.25 translucency on cloud surface `0x08000023` (75% opacity). Visual verification under Phase 0 of the followup plan: clouds and colors now match retail at LCG-picked DayGroups across the day cycle.
|
||||
|
||||
---
|
||||
|
||||
## #1 — [DONE 2026-04-26] Rain falls only to horizon, not to the player's feet
|
||||
|
||||
**Closed:** 2026-04-26
|
||||
**Commits:** `3e0da49` (sky pass split + retail -120m Z offset), `4678b3e` (Surface.Translucency + Luminosity correctness), `d95a8d2` (legacy emitter delete)
|
||||
**Resolution:** Two-part fix. First, rain rendering was completely re-architected to match retail's `LScape::draw` pattern at `0x00506330` — sky pass before the landblock loop (`RenderSky`), weather pass after (`RenderWeather`). Weather meshes now overlay terrain instead of being painted over. Camera anchored inside the rain cylinder via the retail-correct -120m Z offset (constant `0xc2f00000` in `GameSky::UpdatePosition` at `0x00506dd0`). Second, the per-Surface `Translucency` float (rain = 0.5) and `Luminosity` float (rain = 0.1484) were both being ignored by the renderer; plumbed end-to-end so streaks contribute at retail-correct intensity instead of 6.7× too bright. Legacy camera-attached particle emitter (`UpdateWeatherParticles` + `BuildRainDesc` + `BuildSnowDesc`) deleted; world-space mesh is the only path now. Snow rides the same fix automatically. Filed alongside two follow-up issues from the visual-verify session: `#27` (cloud rendering parity), `#28` (aurora/northern lights).
|
||||
|
||||
---
|
||||
|
||||
## #26 — [DONE 2026-04-26] Stars rendered as a square in one corner of the sky
|
||||
|
||||
**Closed:** 2026-04-26
|
||||
**Commit:** `7b88fde fix(sky): drive wrap mode from mesh UV range — fixes Bug B (stars-as-square)`
|
||||
**Resolution:** SkyRenderer's wrap-mode heuristic was `GL_CLAMP_TO_EDGE unless TexVelocity != 0`, which mis-classified the inner sky/star layer `0x010015EF` (UVs in `[0.398, 4.602]`, TexVel=0). Most of the dome sampled the texture's edge texels; only the small region where UVs fell in `[0,1]` showed actual texture content. Fixed by computing `NeedsUvRepeat` per submesh from the actual UV range during `GfxObjMesh.Build()` and driving the wrap-mode choice from that flag plus the existing scrolling check. Outer dome `0x010015EE/F0/F1/F2` (UVs strictly in `[0,1]`) keeps `CLAMP_TO_EDGE` so no seam regression. Probe `tools/StarsProbe/` (commit `991fb9a`) committed alongside as the diagnostic that found this.
|
||||
|
||||
---
|
||||
|
||||
## #25 — [DONE 2026-04-26] Phase K.3 — Settings panel + click-to-rebind UI
|
||||
|
||||
**Closed:** 2026-04-26
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue