[程式] Unreal的nanite分析与简化(Part 4)

楼主: oopFoo (3d)   2024-05-24 17:05:17
Nanite就是Progressive Mesh chunk/clustered化,然后利用mesh/compute shader来做View Dependent的运算。
但直觉化hierachy clustered 的 Progressive Mesh是行不通的。因为要避免边界有t-junction/crack,边界的vertices都会锁住,无法简化。
会像这样,边界一堆面数,无法简化下来。
https://i.imgur.com/bqNAXS8.png
quick-vdr用方法才可以真正简化。差异92%
https://i.imgur.com/IdxL4iw.png
https://gamma.cs.unc.edu/QVDR/
Nanite就是用quick-vdr的方法
https://i.imgur.com/gtcixEA.png
https://i.imgur.com/2fUrRTO.png
quick-vdr的方法不是很直觉。traversal也要多花判断。运算建立hierarchy也蛮麻烦。
其实要避开边界的问题很简单。
https://i.imgur.com/mBsScBK.png
原来的chunk不要沿着原来的边界切开,基本上是对角切,所以128tri的chunk,对角切成64tri,4个不同chunk的64tri合并起来,再simplify成128tri的另一层chunk。
这样的好处是hierarchy是tree而不是DAG,边界自动避开。这样就把Nanite的算法改良好。QED
但现在的chunk还是需要mesh/compute shader来运算。但其实仔细想想,是不需要的。Tree Hierarchy是很容易用sliding window的index buffer来render。
想到了方法后,也才发现原来2004年就有人提出类似的方法。sliding window VIPM。
https://www.graphicon.ru/html/2004/Proceedings/Technical/2[4].pdf
Sliding window的概念。
https://i.imgur.com/qzPMkTu.png
然后再延伸一下,其实我们不需要chunk,重点在tree的层次。第0层10000tri,第一层5000tri,第二层2500tri,简单的PM运算法就行了,还不需要graph partition这种麻烦。Continuous LOD is so easy。
这种Sliding Window的好处是完全不需要gpu update,任何古早gpu都可用。缺点是index buffer会好几倍大。
Nanite是vdpm所以效能应该会比较好,但复杂,支援的gpu也少。
很想踢自己一脚,当初看到Tom Forsyth的Sliding Window时,完全没有看到解决方案就在眼前了。
作者: cass (cass)   2024-07-18 05:30:00
不明觉厉

Links booklink

Contact Us: admin [ a t ] ucptt.com