troytt
|
b51d839d8c
|
feat(lighting): implement authentic Diablo II v1.13c Glide dynamic lighting system
- P0 Data Contract Fixes:
* Fix missile additive blending to use authentic 1.13c Missiles.txt trans === 1
* Strip developmental || 255 fallback from color channels to preserve authentic 0 values
* Add full 136-level lighting metadata from Levels.txt in levels-meta.ts
* Wire MonStats2 and Overlay lighting in data-registry.ts
- P1 Reverse Engineering & Math Specification:
* Reverse engineer D2Client.dll (dLightMap.c) and D2Common.dll (D2Environment.cpp)
* Implement Alpha-Max-Plus-Beta-Min fast Euclidean distance approximation
* Implement 16.16 fixed-point linear falloff and obstacle attenuation
* Implement intensity-weighted color blending with reciprocal lookup table
- P1 Core Modules:
* LightGrid: 48x48 cell dynamic lightmap with sub-tile bilinear interpolation and RGBA8 export
* Environment: 25Hz day/night clock, outdoor solar sine curve, Act IV targets, indoor static levels
- P1 Shader & Renderer Integration:
* Maintain strict 10-float vertex stride (FLOATS_PER_VERTEX = 10)
* Transform screen coordinates to sub-tiles in vertex shader for v_lightUv
* Glide diffuse modulation in fragment shader with additive blend bypass
* Lazy 48x48 lightmap texture allocation ensuring zero overhead for unlit contexts
* Single-pass draw call batching maintained (drawCalls === 1)
- P1 Scene Integration & Verification:
* Wire LightGrid and Environment into act-scene.ts
* Add player torch with subtle flicker, missile lights, explosion flashes, and additive objects
* Unshaded minimap overlay by resetting lighting prior to minimap.draw
* Add comprehensive test suites: data-contract-lighting, light-grid, scene-lighting
|
2026-09-24 08:02:29 +00:00 |