feat: 双视图视锥剔除(相机/光源各自剔除)
- Frustum(Gribb-Hartmann):从 view-proj 行组合提取 6 平面, 包围球相交测试;按 Vulkan [0,1] 深度约定取 near=row2 - Mesh 构造时缓存局部空间包围球(顶点包围盒 → 中心+半径) - 实例收集重写:单趟遍历,每个 (实体, mesh 部件) 对相机视锥与 光源视锥分别做剔除——相机外实体仍可投影子进视野,Shadow 必须用 光源视锥独立剔除,不能用相机结果 - 实例矩阵数组 = [主视图段 | 阴影视图段],batch.first 全局下标; 两视图共享同一份 ObjectBuffer SSBO - 聚合改哈希(unordered_map),单趟填充替代原两趟遍历 - 面板显示 instances main/shadow 计数(剔除效果实时可见) 实测:1 背包 80 main / 80 shadow(修复前 shadow=21——near 平面 按 [-1,1] 矩阵误用 [0,1] 公式,光锥近半段被误剔)
This commit is contained in:
@@ -169,6 +169,9 @@ protected:
|
||||
// Pass 级 GPU 耗时(RG timestamp)
|
||||
ImGui::Separator();
|
||||
ImGui::Text("GPU Timings");
|
||||
ImGui::Text("instances: %u main / %u shadow",
|
||||
renderer.GetMainInstanceCount(),
|
||||
renderer.GetShadowInstanceCount());
|
||||
const auto& names = renderer.GetPassNames();
|
||||
const auto& times = renderer.GetPassGpuMs();
|
||||
for (size_t i = 0; i < names.size() && i < times.size(); ++i)
|
||||
|
||||
Reference in New Issue
Block a user