Conversation
- IBL specular: use Filament's D_GGX with (a-1)(a+1) fp accuracy optimization - IBL specular: correct PDF calculation (D * 0.25) and LOD bias K=4 - IBL specular: add HDR luminance compression (compressHDR) to prevent super-bright pixel bleeding - IBL specular: add MIN_ROUGHNESS (0.002025) to prevent division by zero - Importance sampling: use Filament's cosTheta2 formulation for better fp accuracy - SH: replace approximate solid angle with Filament's exact sphereQuadrantArea - SH: add sinc⁴ windowing deringing (Peter-Pike Sloan) with auto-cutoff binary search - SH: add SH rotation (band1/band2) for optimal deringing direction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…erences Filament is an implementation, not the origin of these algorithms. Updated comments to reference the actual papers and authors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
done |
|
rotateSHBand2() 我建议重写成和 Filament 更同构的形式,而不是继续保留现在这版“隐式矩阵约定”的实现。 当前写法里 M 实际上大概率是在按列向量语义使用,但 number[][] + mulMat3Vec3() 非常不直观,review 和后续维护都很容易把 row/column 约定搞反。 更稳的做法是直接按 Filament 构造 ROverK:project(M[0])、project(M[2])、project(n*(M[0]+M[1]))、project(n*(M[0]+M[2]))、project(n*(M[1]+M[2]))。这样可以直接对照上游实现,也更不容易引入转置错误。 建议同时补最小数值测试锁住 identity / 90° rotation / 随机正交矩阵 case。 |
done |
…tter readability Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
概述
将 IBL(基于图像的光照)和 SH(球谐光照)烘焙算法全面对齐 Google Filament 的实现,修复多个影响画面质量的核心问题。
改动内容
IBL 预过滤卷积(把环境贴图按不同粗糙度模糊成多层 mip)
(a-1)(a+1)替代a²-1,减少浮点误差(数学上等价,但浮点计算更精确)+ 0.0001防除零 hack,改用 MIN_ROUGHNESS 从源头保证 D 值不会导致除零GGX 重要性采样(决定往哪些方向采样环境贴图)
SH 球谐光照(用 9 个系数近似表示低频环境光)
atan2积分)替代之前的近似公式(4 / r³),SH 系数更准确解决的问题
价值
测试计划
🤖 Generated with Claude Code