Skip to content

Conversation

@indevn
Copy link
Contributor

@indevn indevn commented Sep 24, 2025

Description

基于现有的TBR和Deferred管线,可以继续实现TBDR管线进行进一步优化。目前已有的工作包括:

  1. 代码清理与重构:由于TBR新版本的实现,在内部直接做掩码扫描并写帧缓冲,已经绕开了Rasterizer类;故清理相关重载。优化部分代码的写法。
  2. 添加TBDR管线,结合当前 TBR 的 SoA+分箱+按 tile 并行与 Deferred 的“先决胜深度、后统一着色”思想,尽量减少无效着色、提升缓存友好性和并行效率。具体实现细节如下
    • Vertex阶段:复用TBR SoA实现
    • Binning阶段:复用TBR中的Binning函数,实现保持不变
    • Z-prepass阶段(tile级,第一阶段处理):使用当前的掩码扫描/边函数步进(kLane=8)在 tile 的交叠 AABB 网格内测试覆盖。对covered像素,进行透视矫正插值和z的计算。该阶段不生成中间片段。
    • Shading阶段(tile级,第二阶段处理):对winner像素进行着色

Test

目前阶段的性能测试结果与TBR相仿,单帧渲染时间在100ms左右。
测试环境:i9-13900h, WSL2(Ubuntu2404)

ToDo

当前基础测试场景无法充分体现TBDR的优势。为了进一步精细化测试和调优,需要为当前渲染框架引入多光源/半透明场景,需要拓展相关代码实现。

…imize computation and eliminate redundancy. Added copy/move constructors for thread safety

Signed-off-by: ZhouFANG <indevn@outlook.com>
Signed-off-by: ZhouFANG <indevn@outlook.com>
…shaded at most once. Update the rendering mode enumeration and implement the corresponding logic in the renderer.

Signed-off-by: ZhouFANG <indevn@outlook.com>
…rections and states

Signed-off-by: ZhouFANG <indevn@outlook.com>
ZzzhHe
ZzzhHe previously approved these changes Oct 16, 2025
Copy link
Contributor

@ZzzhHe ZzzhHe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常不错!

Signed-off-by: indevn <indevn@outlook.com>
Removed duplicate definition of kSpecularLutResolution.

Signed-off-by: indevn <indevn@outlook.com>
@ZzzhHe ZzzhHe merged commit 9718b21 into Simple-XX:main Oct 21, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants