在 v1.0.2(用户自定义人像模型)之上,修复强光 / 直射下 VSM 阴影在曲面(尤其人像剪影)上的漏光(light bleeding)。
Fixes VSM shadow light-bleeding on curved geometry (esp. figure silhouettes) introduced by the new GLB figures.
改了什么 / What changed
- 每盏灯新增「法线偏移」滑杆(灯光面板,0–0.05):沿表面法线偏移阴影采样以消除曲面漏光,代价是几乎看不出的阴影角度偏移。 / Per-light normal bias slider — trades the bleed for an imperceptible shadow-angle shift.
- 新增「柔和阴影(PCF)」开关(白棚面板 → 渲染):极端布光下的兜底,彻底消除漏光,代价是半影不再丝滑、表面略平。默认仍用 VSM + 法线偏移。 / Soft shadows (PCF) toggle — an extreme-case fallback that fully removes bleeding at the cost of penumbra smoothness; VSM + normal bias stays the default.
- 集成收口:运行时切换阴影算法时强制重编接收阴影的材质(three.js 把
SHADOWMAP_TYPE_*烘在编译期),并修掉原 PR 在tsc -b/eslint下的两处报错。 / Integration fix: force shadow-receiving materials to recompile on a runtime shadow-mode switch; clears the PR's lint + tsc errors.
特别感谢 / Thanks to @zczam (PR #2).
完整记录见 CHANGELOG.md 的 [1.0.3] 段。