acdream/src
Erik 375065ba94 fix(meshing): Translucent flag overrides Additive blend per retail SetSurface
acdream's TranslucencyKindExtensions.FromSurfaceType picked Additive
first (priority order). Retail's D3DPolyRender::SetSurface at
0x0059c4d0 (decomp 425083+) has a different resolution: when the
Translucent flag (0x10) is set AND either Base1ClipMap (0x04) is set
OR the surface would otherwise be opaque (no Additive/Alpha/InvAlpha),
the blend is *forced* to (SrcAlpha, InvSrcAlpha) — i.e. standard
alpha-blend, not additive. Verbatim from decomp lines 425246-425260:

    if ((curr_surface_type & 0x10) != 0) {
        if (skipChk != 0 || ebx == 0 || arg3 == 1) {
            edi_2 = BLEND_SRCALPHA;       // src
            ebp   = BLEND_INVSRCALPHA;    // dst   ← alpha-blend
        }
        curr_alpha = _ftol2(translucency * 255);
    }

Where `arg3 == 1` is set after the Base1ClipMap branch and `ebx == 0`
is the opaque-base case in Branch 2.

Concrete impact: Dereth's inner cloud sheet GfxObj 0x01004C35 uses
surface 0x08000023 with Type=0x10114 (B1ClipMap|Translucent|Alpha|
Additive). Retail renders it alpha-blend; acdream was rendering it
additive. Additive on a dark cloud texture only brightens the
background — sun shines through unchanged — which doesn't match
retail's denser cloud appearance.

Rain surface 0x080000C5 (Type=0x10112 = B1Image|Translucent|Alpha|
Additive, NO ClipMap) hits Branch 1 → Additive, ClipMap branch is
skipped, the Translucent override doesn't fire (arg3 stays 0) → stays
Additive. Visual rain rendering is unchanged.

User reported no visible difference at the verification launch; the
remaining cloud-density gap likely lives in the PES particle layer
(issue #28). Keeping this fix because the classification is now
decomp-correct regardless of immediate visual impact — issue #29
documents the residual gap.

1227 tests pass.
2026-04-27 23:23:48 +02:00
..
AcDream.App fix(sky): partition sky pass on Properties bit 0x01, not bit 0x04 2026-04-27 22:43:14 +02:00
AcDream.Cli feat(vfx): Phase E.3 particle system + hook wiring + registry 2026-04-18 16:48:17 +02:00
AcDream.Core fix(meshing): Translucent flag overrides Additive blend per retail SetSurface 2026-04-27 23:23:48 +02:00
AcDream.Core.Net fix(net): VectorUpdate parser was reading guid from opcode bytes — remote jumps invisible 2026-04-26 21:51:36 +02:00
AcDream.Plugin.Abstractions feat(core): add IGameState, IEvents, WorldEvents with replay-on-subscribe 2026-04-10 20:29:29 +02:00
AcDream.Plugins.Smoke feat(app): wire IGameState+IEvents into Program and SmokePlugin 2026-04-10 20:31:50 +02:00
AcDream.UI.Abstractions fix(ui): Phase K live-test fixes pt4 — collision wires default OFF, refresh DebugPanel cheat-sheet 2026-04-26 14:53:16 +02:00
AcDream.UI.ImGui feat(ui): #25 Phase K.3 — Settings panel + click-to-rebind + Phase K shipped 2026-04-26 09:44:56 +02:00