{"id":4706,"date":"2025-12-25T16:31:17","date_gmt":"2025-12-25T08:31:17","guid":{"rendered":"https:\/\/www.caiqinyi.cn\/?p=4706"},"modified":"2025-12-28T09:27:13","modified_gmt":"2025-12-28T01:27:13","slug":"course_notes_let_nanite_ubiquitous_plan_hand_crafted_nanite","status":"publish","type":"post","link":"https:\/\/www.caiqinyi.cn\/index.php\/2025\/12\/25\/course_notes_let_nanite_ubiquitous_plan_hand_crafted_nanite\/","title":{"rendered":"\u300a[\u8ba9Nanite\u70c2\u5927\u8857\u8ba1\u5212]\u624b\u6413Nanite\u300b\u8bfe\u7a0b\u7b14\u8bb0"},"content":{"rendered":"<p><script type=\"text\/javascript\" async src=\"https:\/\/www.caiqinyi.cn\/wp-content\/MathJax\/MathJax.js?config=TeX-AMS_CHTML\">\n<\/script><br \/>\n<script type=\"text\/x-mathjax-config\">\n    MathJax.Hub.Config({\n        tex2jax: {inlineMath: [['$','$']]},\n        TeX: {equationNumbers: {autoNumber: [\"AMS\"], useLabelIds: true}},\n        \"HTML-CSS\": {linebreaks: {automatic: true}},\n        SVG: {linebreaks: {automatic: true}}\n    });\n<\/script><\/p>\n<p>\u524d\u6bb5\u65f6\u95f4\u5728B\u7ad9\u4e0a\u53d1\u73b0\u4e00\u4e2a\u5b9d\u85cf\u8bfe\u7a0b<a href=\"https:\/\/www.bilibili.com\/cheese\/play\/ss553343122?csource=private_space_class_null&#038;spm_id_from=333.1387.0.0\">\u300a[\u8ba9Nanite\u70c2\u5927\u8857\u8ba1\u5212]\u624b\u6413Nanite\u300b<\/a>, \u6012\u65a5138\u5de8\u8d44\u5b66\u4e60\u4e00\u6ce2. \u5b66\u7f62, \u8bda\u5982\u8bfe\u7a0b\u8001\u5e08\u5728\u8bfe\u7a0b\u5f00\u59cb\u6240\u9884\u6599\u7684, \u81ea\u5df1\u786e\u5b9e\u5bf9Nanite\u8fd9\u95e8\u76ee\u524d\u6e38\u620f\u884c\u4e1a\u7684\u9876\u5c16\u6280\u672f\u88aa\u9b45\u4e0d\u5c11. \u6709\u90e8\u5206\u539f\u56e0\u662f\u56e0\u4e3a\u8bfe\u7a0b\u4e2d\u5e76\u672a\u6df1\u5165\u7814\u7a76Nanite Mesh Build\u7b97\u6cd5, \u66f4\u591a\u5730\u662f\u504f\u5411\u4e8e\u5de5\u7a0b\u67b6\u6784\u4e0a\u7684\u5256\u89e3. \u867d\u89c9\u53ef\u60dc, \u4f46\u4e5f\u53d7\u76ca\u826f\u591a, \u7279\u4ee5\u672c\u6587\u8bb0\u5f55\u8be5\u8bfe\u7a0b\u4e2d\u63d0\u53ca\u7684\u5173\u4e8e\u539f\u88c5\u865a\u5e7bNanite\u4e0e\u8bfe\u7a0b\u7684\u5b9e\u73b0\u7ec6\u8282.<\/p>\n<p><!--more--><\/p>\n<p><strong>\u53c2\u8003\u6750\u6599<\/strong><br \/>\n1. <a href=\"https:\/\/www.bilibili.com\/cheese\/play\/ss553343122?csource=private_space_class_null&#038;spm_id_from=333.1387.0.0\">[\u8ba9Nanite\u70c2\u5927\u8857\u8ba1\u5212]\u624b\u6413Nanite<\/a><br \/>\n2. <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/6299597682\">Nanite\u6e90\u7801\u7b14\u8bb0(2)-Encode(2)-batch&#038;\u5206\u9875<\/a><br \/>\n3. <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/707010073\">\u3010Unity Graphics\u3011\u83ab\u987f\u7801\uff08Morton Code\uff09<\/a><br \/>\n4. <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/376786001\">\u6e38\u620f\u5f15\u64ce\u968f\u7b14 0x20\uff1aUE5 Nanite \u6e90\u7801\u89e3\u6790\u4e4b\u6e32\u67d3\u7bc7\uff1aBVH \u4e0e Cluster \u7684 Culling<\/a><br \/>\n5. <a href=\"https:\/\/www.reddit.com\/r\/GraphicsProgramming\/comments\/1dja3ar\/why_most_perspective_projection_matrices_out\/?tl=zh-hans\">\u4e3a\u4ec0\u4e48\u5927\u591a\u6570\u900f\u89c6\u6295\u5f71\u77e9\u9635\u53ea\u7528\u5782\u76f4\u6216\u6c34\u5e73\u89d2\u5ea6\u6765\u5904\u7406 FOV\uff08\u89c6\u573a\u89d2\uff09\uff1f<\/a><br \/>\n6. <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/586364840\">\u5f7b\u5e95\u7406\u89e3\u6295\u5f71\u77e9\u9635\uff08\u4e00\uff09<\/a><br \/>\n7. <a href=\"https:\/\/blog.csdn.net\/LeKZzz\/article\/details\/130920115\">\u6c34\u5e73FOV\u4e0e\u5782\u76f4FOV\u8f6c\u6362\u516c\u5f0f \u4ee5C++\u5b9e\u73b0\u4e3a\u4f8b<\/a><br \/>\n8. <a href=\"https:\/\/zhuanlan.zhihu.com\/p\/1987647134443524454\">CSE272\u9ad8\u7ea7\u6e32\u67d3\u8bfe\u7a0b (26) Nanite\u5b9e\u65f6\u6e32\u67d3<\/a><\/p>\n<p><strong>1. \u539f\u88c5\u865a\u5e7bNanite\u6838\u5fc3LOD\u5185\u5b58\u683c\u5f0f\u89e3\u6790<\/strong><\/p>\n<p>FPackedHierarchyNode\u4e3aNanite\u6838\u5fc3LOD\u7684\u6838\u5fc3\u6570\u636e\u7ed3\u6784\u4e4b\u4e00, \u5176\u7ed3\u6784\u5982\u4e0b\u6240\u793a,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n#define NANITE_MAX_BVH_NODE_FANOUT_BITS\t\t\t\t\t\t2\r\n#define NANITE_MAX_BVH_NODE_FANOUT\t\t\t\t\t\t(1 << NANITE_MAX_BVH_NODE_FANOUT_BITS)\r\n\r\nstruct FPackedHierarchyNode\r\n{\r\n\tFVector4f\t\tLODBounds[NANITE_MAX_BVH_NODE_FANOUT];\r\n\t\r\n\tstruct\r\n\t{\r\n\t\tFVector3f\tBoxBoundsCenter;\r\n\t\tuint32\t\tMinLODError_MaxParentLODError;\r\n\t} Misc0[NANITE_MAX_BVH_NODE_FANOUT];\r\n\r\n\tstruct\r\n\t{\r\n\t\tFVector3f\tBoxBoundsExtent;\r\n\t\tuint32\t\tChildStartReference;\r\n\t} Misc1[NANITE_MAX_BVH_NODE_FANOUT];\r\n\t\r\n\tstruct\r\n\t{\r\n\t\tuint32\t\tResourcePageIndex_NumPages_GroupPartSize;\r\n\t#if NANITE_ASSEMBLY_DATA\r\n\t\tuint32 \t\tAssemblyPartIndex;\r\n\t#endif\r\n\t} Misc2[NANITE_MAX_BVH_NODE_FANOUT];\r\n};\r\n\r\n<\/pre>\n<p>\u4e0a\u8ff0\u7ed3\u6784\u4e3a\u4e00\u4e2a\u56db\u53c9\u6811\u8282\u70b9\u7ed3\u6784, \u662fNanite\u5b9e\u73b0\u7684\u57fa\u7840, \u6bcf\u4e2a\u8282\u70b9\u5728GPU\u4e2d\u4ee5\u7279\u5b9a\u683c\u5f0fFPackedHierarchyNode\u5b58\u50a8.<\/p>\n<p><strong>1.1 \u8282\u70b9\u5b58\u50a8\u5e03\u5c40<\/strong><\/p>\n<p>\u56db\u53c9\u6811\u8282\u70b9\u5728GPU\u4e2d\u901a\u5e38\u91c7\u7528\u8fde\u7eed\u5185\u5b58\u5e03\u5c40, \u6bcf\u4e2a\u8282\u70b9\u5360\u7528\u56fa\u5b9a\u5b57\u8282\u6570(208 = 52 $\\times$ sizeof(uint)\u5b57\u8282). \u8fd9\u79cd\u5e03\u5c40\u65b9\u5f0f\u4f7f\u5f97GPU\u80fd\u591f\u9ad8\u6548\u5730\u8bbf\u95ee\u548c\u5904\u7406\u8282\u70b9\u6570\u636e. \u8282\u70b9\u7ed3\u6784\u5305\u542b\u4ee5\u4e0b\u5173\u952e\u90e8\u5206:<br \/>\n$\\\\$ $\\cdot$ LODBounds, \u7c7b\u578b\u4e3aFVector4f\u7684\u6570\u7ec4, \u5927\u5c0f\u4e3a64\u5b57\u8282, \u5176\u5b58\u50a8\u8282\u70b9\u7684\u8fb9\u754c\u4fe1\u606f, \u7528\u4e8e\u89c6\u9525\u4f53\u88c1\u526a\u548c\u906e\u6321\u5254\u9664;<br \/>\n$\\\\$ $\\cdot$ ChildStartReference, \u7c7b\u578b\u4e3auint32\u7684\u6570\u7ec4, \u957f\u5ea6\u4e3a4, \u5927\u5c0f\u4e3a16\u5b57\u8282, \u5176\u4e3a\u56db\u4e2a\u5b50\u8282\u70b9\u7684\u8d77\u59cb\u7d22\u5f15, \u6307\u5411\u5b50\u8282\u70b9\u5728Buffer\u4e2d\u7684\u4f4d\u7f6e; \u901a\u8fc7NaniteRayTrace.ush\u4e2d\u5bf9\u4e8eChildStartReference\u7684\u4f4d\u8fd0\u7b97\u53ef\u77e5, \u5176\u4f4e24\u4f4d\u4e3aPageIndex, \u9ad88\u4f4d\u4e3aClusterIndex(\u6ce8\u610f, \u4e00\u822cGPU\u4e0a\u4f7f\u7528\u5c0f\u7aef\u7f16\u7801).<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n#define NANITE_STREAMING_PAGE_GPU_SIZE_BITS\t\t\t\t17\r\n#define NANITE_CLUSTER_MIN_EXPECTED_GPU_SIZE_BITS\t\t\t9\t\/\/ Used to determine how many bits to allocate for page cluster count.\r\n\/\/ Individual clusters can be smaller.\r\n#define NANITE_STREAMING_PAGE_MAX_CLUSTERS_BITS\t\t\t\t(NANITE_STREAMING_PAGE_GPU_SIZE_BITS - NANITE_CLUSTER_MIN_EXPECTED_GPU_SIZE_BITS)\r\n\r\n#define NANITE_ROOT_PAGE_GPU_SIZE_BITS\t\t\t\t\t15\r\n#define NANITE_ROOT_PAGE_MAX_CLUSTERS_BITS\t\t\t\t(NANITE_ROOT_PAGE_GPU_SIZE_BITS - NANITE_CLUSTER_MIN_EXPECTED_GPU_SIZE_BITS)\r\n\r\n#define NANITE_MAX_CLUSTERS_PER_PAGE_BITS\t\t\t\t(NANITE_STREAMING_PAGE_MAX_CLUSTERS_BITS > NANITE_ROOT_PAGE_MAX_CLUSTERS_BITS ? NANITE_STREAMING_PAGE_MAX_CLUSTERS_BITS : NANITE_ROOT_PAGE_MAX_CLUSTERS_BITS)\r\n#define NANITE_MAX_CLUSTERS_PER_PAGE_MASK\t\t\t\t((1 << NANITE_MAX_CLUSTERS_PER_PAGE_BITS) - 1)\r\n\r\nconst uint PageIndex = HierarchyNodeSlice.ChildStartReference >> NANITE_MAX_CLUSTERS_PER_PAGE_BITS;\r\nconst uint BaseClusterIndex = HierarchyNodeSlice.ChildStartReference & NANITE_MAX_CLUSTERS_PER_PAGE_MASK;\r\n\r\n<\/pre>\n<p>$\\\\$ $\\cdot$ BoxBoundsCenter, \u7c7b\u578b\u4e3aFVector3f\u7684\u6570\u7ec4, \u957f\u5ea6\u4e3a4, \u5927\u5c0f\u4e3a12\u5b57\u8282, \u5176\u4e3aLOD Bound\u7684\u4e2d\u5fc3\u70b9\u4f4d\u7f6e;<br \/>\n$\\\\$ $\\cdot$ BoxBoundsExtent, \u7c7b\u578b\u4e3aFVector3f\u7684\u6570\u7ec4, \u957f\u5ea6\u4e3a4, \u5927\u5c0f\u4e3a12\u5b57\u8282, \u5176\u4e3aLOD Bound\u7684\u8fb9\u754c\u8303\u56f4;<br \/>\n$\\\\$ $\\cdot$ MinLODError_MaxParentLODError, \u7c7b\u578b\u4e3auint32\u7684\u6570\u7ec4, \u957f\u5ea6\u4e3a4, \u5927\u5c0f\u4e3a16\u5b57\u8282, \u5176\u5b58\u50a8\u8282\u70b9\u7684\u8bef\u5dee\u503c, \u7528\u4e8eLOD\u5224\u65ad;<br \/>\n$\\\\$ $\\cdot$ ResourcePageIndex_NumPages_GroupPartSize, \u7c7b\u578b\u4e3auint32\u7684\u6570\u7ec4, \u957f\u5ea6\u4e3a4, \u5927\u5c0f\u4e3a16\u5b57\u8282, \u901a\u8fc7NaniteEncode.cpp\u4e2d\u4f7f\u7528\u4f4d\u8fd0\u7b97\u4e3aResourcePageIndex_NumPages_GroupPartSize\u8d4b\u503c\u7684\u903b\u8f91\u53ef\u77e5, \u5176\u524d14\u4f4d\u4e3aPageIndexStart, \u4e2d\u95f49\u4f4d\u4e3aPageIndexNum, \u672b9\u4f4d\u4e3aGroupPartSize.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n#define NANITE_MAX_CLUSTERS_PER_GROUP_BITS\t\t\t\t\t9\r\n#define NANITE_MAX_GROUP_PARTS_BITS\t\t\t\t\t\t5\r\n\r\nResourcePageIndex_NumPages_GroupPartSize = (PageIndexStart << (NANITE_MAX_CLUSTERS_PER_GROUP_BITS + NANITE_MAX_GROUP_PARTS_BITS)) | (PageIndexNum << NANITE_MAX_CLUSTERS_PER_GROUP_BITS) | GroupPartSize;\r\n\r\n<\/pre>\n<p>$\\\\$ $\\cdot$ AssemblyPartIndex, \u76ee\u524d\u5b8fNANITE_ASSEMBLY_DATA\u662f\u5904\u4e8e\u5173\u95ed\u72b6\u6001\u7684, \u4e14\u865a\u5e7b\u5f15\u64ce\u5728NaniteResource.h\u4e2d\u5df2\u901a\u8fc7static_assert\u5bf9FPackedHierarchyNode\u7684\u6570\u636e\u7ed3\u6784\u5927\u5c0f\u4f5c\u51fa\u9650\u5236(\u5373\u4e0d\u5141\u8bb8\u4fee\u6539\u53d8\u91cf\u6570\u91cf), \u6545\u8be5\u53d8\u91cf\u4ea6\u672a\u88ab\u4f7f\u7528.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n#define NANITE_ASSEMBLY_DATA\t\t\t\t\t\t0\r\n\r\n#if NANITE_ASSEMBLY_DATA\r\n\t#define NANITE_HIERARCHY_NODE_SLICE_SIZE_DWORDS\t\t\t56\r\n#else\r\n\t#define NANITE_HIERARCHY_NODE_SLICE_SIZE_DWORDS\t\t\t52\r\n#endif\r\n\r\n\/\/ These are expected to match up\r\nstatic_assert(NANITE_HIERARCHY_NODE_SLICE_SIZE_DWORDS == sizeof(FPackedHierarchyNode) \/ 4);\r\n\r\n<\/pre>\n<p>\u5176\u903b\u8f91\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/logical_structure_bvh_node.png\" alt=\"\" width=\"2023\" height=\"1279\" class=\"aligncenter size-full wp-image-4821\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/logical_structure_bvh_node.png 2023w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/logical_structure_bvh_node-300x190.png 300w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/logical_structure_bvh_node-768x486.png 768w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/logical_structure_bvh_node-1536x971.png 1536w\" sizes=\"(max-width: 2023px) 100vw, 2023px\" \/><\/p>\n<p><strong>1.2 \u6570\u636e\u5206\u5757\u65b9\u5f0f<\/strong><\/p>\n<p>Nanite\u5c06\u6a21\u578b\u6570\u636e\u62c6\u5206\u4e3aClusters, \u6bcf\u4e2aCluster\u5305\u542b\u7ea6128\u4e2a\u4e09\u89d2\u5f62. \u8fd9\u79cd\u5206\u5757\u65b9\u5f0f\u4f7f\u5f97\u6570\u636e\u53ef\u4ee5\u6309\u9700\u52a0\u8f7d, \u53ea\u6e32\u67d3\u8089\u773c\u53ef\u89c1\u4e14\u6709\u610f\u4e49\u7684\u7ec6\u8282. \u5254\u9664\u65f6\u53ef\u5c06\u5c4f\u5e55\u5206\u6210\u82e5\u5e72\u4e2a$8 \\times 8$\u7684\u5c4f\u5e55\u5757\u8fdb\u884c\u5206\u5757\u5254\u9664.<\/p>\n<p><strong>1.3 \u8bbf\u95ee\u6a21\u5f0f<\/strong><\/p>\n<p>\u5728GPU\u4e2d\u8bbf\u95ee\u56db\u53c9\u6811\u8282\u70b9\u65f6, \u901a\u5e38\u91c7\u7528\u4ee5\u4e0b\u65b9\u5f0f:<br \/>\n$\\\\$ $\\cdot$ \u901a\u8fc7\u8282\u70b9\u7d22\u5f15\u5b9a\u4f4d\u5230\u5185\u5b58\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e.<br \/>\n$\\\\$ $\\cdot$ \u6839\u636e\u8282\u70b9\u5927\u5c0f(208\u5b57\u8282) \u8ba1\u7b97\u5b50\u8282\u70b9\u7684\u504f\u79fb\u91cf.<br \/>\n$\\\\$ $\\cdot$ \u89e3\u7801\u8282\u70b9\u4e2d\u7684\u5b50\u8282\u70b9\u7d22\u5f15, \u83b7\u53d6\u5b50\u8282\u70b9\u6570\u636e.<\/p>\n<p><strong>2. \u9006\u5411\u5206\u6790\u865a\u5e7b5.5.4\u7684Nanite Mesh\u6570\u636e<\/strong><\/p>\n<p><strong>2.1 Clusters\u751f\u6210\u8fc7\u7a0b<\/strong><\/p>\n<p>Nanite\u5c06\u6a21\u578b\u5206\u5272\u4e3aClusters, \u5e76\u8fdb\u4e00\u6b65\u5408\u5e76\u4e3aGroups. \u4f8b\u5982, \u4e00\u4e2a20\u53f7\u8282\u70b9\u7684\u56db\u4e2a\u5b57\u8282\u70b9\u5206\u522b\u8f93\u51fa\u4e868, 4, 2, 1\u4e2aClusters, \u603b\u5171\u670915\u4e2aClusters, \u8fd9\u4e9bClusters\u88ab\u5206\u914d\u5230\u5185\u5b58\u5206\u9875\u7684\u7b2c0\u9875\u4e0a.<br \/>\n$\\\\$ Cluster Groups\u4f1a\u8fdb\u884c\u6392\u5e8f, \u5148\u6839\u636eMipmap Level\u8fdb\u884c\u6392\u5e8f, \u518d\u6839\u636e\u83ab\u987f\u7801\u8fdb\u884c\u6392\u5e8f, \u8fd9\u6837\u4fdd\u8bc1\u540c\u4e00Mipmap Level\u4e14\u4f4d\u7f6e\u76f8\u8fd1\u7684Group\u80fd\u591f\u653e\u5230\u4e00\u8d77. \u6709\u5173\u83ab\u987f\u7801\u53ef\u4ee5\u53c2\u8003<a href=\"https:\/\/zhuanlan.zhihu.com\/p\/707010073\">\u3010Unity Graphics\u3011\u83ab\u987f\u7801\uff08Morton Code\uff09<\/a>. \u5927\u81f4\u5c31\u662f\u7a7a\u95f4\u4e2d\u76f8\u8fd1\u7684\u70b9\u7684\u83ab\u987f\u7801\u76f8\u8fd1, \u4f7f\u7528\u83ab\u987f\u7801\u6392\u5e8f\u53ef\u4ee5\u4f7f\u5f97\u7a7a\u95f4\u5750\u6807\u76f8\u5bf9\u6709\u5e8f.<\/p>\n<p><strong>2.2 \u5185\u5b58\u5206\u9875\u673a\u5236<\/strong><\/p>\n<p>Clusters\u901a\u8fc7Group Part\u5206\u914d\u5230\u5185\u5b58\u9875(\u5982Page 0), \u6bcf\u4e2aCluster\u5728\u5206\u9875\u4e2d\u6709\u81ea\u5df1\u7684\u504f\u79fb\u4f4d\u7f6e, \u4f8b\u5982:<br \/>\n$\\\\$ $\\cdot$ 0\u53f7Group Part: Page 0, Group Index 49, Cluster Page Offset 0, \u5305\u542b1\u4e2aCluster;<br \/>\n$\\\\$ $\\cdot$ 1\u53f7Group Part: Page 0, Group Index 49, Cluster Page Offset 1, \u5305\u542b2\u4e2aClusters;<br \/>\n$\\\\$ $\\cdot$ 2\u53f7Group Part: Page 0, Group Index 47, Cluster Page Offset 3, \u5305\u542b4\u4e2aClusters.<\/p>\n<p><strong>2.3 \u5206\u9875\u7b56\u7565<\/strong><\/p>\n<p>\u5f530\u53f7\u5185\u5b58\u5206\u9875\u88c5\u6ee1\u540e, \u4f1a\u5f00\u59cb\u65b0\u7684\u5206\u9875. \u4f8b\u5982, \u5f534\u53f7Cluster\u53d1\u73b00\u53f7\u5206\u9875\u5df2\u6ee1\u65f6, \u4f1a\u5f00\u59cb\u5411\u540e\u7eed\u5206\u9875\u5199\u5165\u6570\u636e, \u5982\u4e0b\u56fe\u6240\u793a(\u56fe\u6765\u6e90\u4e8e\u53c2\u8003\u6750\u65992).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/nanite_memory_paging_mechanism.jpg\" alt=\"\" width=\"595\" height=\"172\" class=\"aligncenter size-full wp-image-4730\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/nanite_memory_paging_mechanism.jpg 595w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/nanite_memory_paging_mechanism-300x87.jpg 300w\" sizes=\"(max-width: 595px) 100vw, 595px\" \/><\/p>\n<p><strong>3. \u865a\u5e7b\u4e2d\u7684Nanite\u6d41\u7a0b\u6574\u7406\u4ee5\u53caVisBuffer64<\/strong><\/p>\n<p><strong>3.1 Cluster\u9009\u62e9\u6d41\u7a0b<\/strong><\/p>\n<p>Cluster\u9009\u62e9\u662fNanite\u7ba1\u7ebf\u7684\u6838\u5fc3, \u5177\u4f53\u6d41\u7a0b\u5982\u4e0b:<br \/>\n$\\\\$ $\\cdot$ \u5c42\u7ea7\u5254\u9664:<br \/>\n$\\\\$ 1) InstanceCull, \u6267\u884c\u5b9e\u4f8b\u5316\u5254\u9664, \u6b64\u6b65\u9aa4\u4ea7\u751fBVH\u5019\u9009\u6839\u8282\u70b9\u6570\u636e.<br \/>\n$\\\\$ 2) PersistentCull, \u6267\u884cBVH Node\u548cCluster\u5254\u9664, \u8f93\u51faRasterize\u9700\u8981\u7684Cluster Buffer\u4ee5\u53caIndirect\u53c2\u6570.<br \/>\n$\\\\$ $\\cdot$ Mipmap Level\u9009\u62e9:<br \/>\n$\\\\$ 1) \u6839\u636eClusters\u7684\u8bef\u5dee\u503c\u548c\u5c4f\u5e55\u7a7a\u95f4\u6295\u5f71\u5927\u5c0f\u9009\u62e9\u5408\u9002Mipmap Level.<br \/>\n$\\\\$ 2) \u8bef\u5dee\u503c\u7531QEM\u51cf\u9762\u7b97\u6cd5\u751f\u6210, \u5f62\u6210\u964d\u5e8f\u6392\u5217\u7684DAG\u7ed3\u6784.<br \/>\n$\\\\$ $\\cdot$ \u751f\u6210Visibility Buffer:<br \/>\n$\\\\$ 1) \u4f7f\u7528R32G32_UINT\u683c\u5f0f\u7684VisBuffer64\u5b58\u50a8\u6bcf\u4e2a\u50cf\u7d20\u5bf9\u5e94\u7684Cluster\u7d22\u5f15.<br \/>\n$\\\\$ 2) \u901a\u8fc7GPU\u5149\u6805\u5316\u6807\u8bb0\u53ef\u89c1Clusters, \u800c\u975e\u76f4\u63a5\u6e32\u67d3\u51e0\u4f55\u4f53.<br \/>\n$\\\\$ Cluster\u9009\u62e9\u662fNanite\u5b9e\u73b0\u7684\u57fa\u7840, \u5b83\u51b3\u5b9a\u4e86\u6700\u7ec8\u6e32\u67d3\u7684\u51e0\u4f55\u7ec6\u8282\u91cf, \u56e0\u6b64\u9700\u8981\u9ad8\u6548\u5b9e\u73b0.<\/p>\n<p><strong>3.2 \u8bfe\u7a0b\u4e2d\u7684\u53ef\u89c6\u5316\u6e32\u67d3\u6d41\u7a0b<\/strong><\/p>\n<p>\u53ef\u89c6\u5316\u6d41\u7a0b\u9700\u8981\u521b\u5efa\u4e24\u79cdBuffer:<br \/>\n$\\\\$ $\\cdot$ VisBuffer64(R32G32_UINT):<br \/>\n$\\\\$ 1) \u5b58\u50a8\u6bcf\u4e2a\u50cf\u7d20\u5bf9\u5e94\u7684Cluster\u7d22\u5f15.<br \/>\n$\\\\$ 2) \u683c\u5f0f: 32\u4f4d\u65e0\u7b26\u53f7\u6574\u578b, \u4e24\u4e2a\u901a\u9053.<br \/>\n$\\\\$ 3) \u7528\u4e8e\u6807\u8bb0Clusters\u9009\u62e9\u7ed3\u679c, \u800c\u975e\u76f4\u63a5\u6e32\u67d3.<br \/>\n$\\\\$ $\\cdot$ Visualization Buffer(R32G32B32A32_FLOAT):<br \/>\n$\\\\$ 1) \u5b58\u50a8\u6700\u7ec8\u6e32\u67d3\u7684\u53ef\u89c6\u5316\u7ed3\u679c.<br \/>\n$\\\\$ 2) \u683c\u5f0f: 32\u4f4d\u6d6e\u70b9\u6570, \u56db\u4e2a\u901a\u9053.<br \/>\n$\\\\$ 3) \u7528\u4e8e\u8f93\u51fa\u5230Swap Chain\u663e\u793a.<\/p>\n<p><strong>4. \u8bfe\u7a0b\u4e2d\u7684\u975e\u91cf\u5316\u7248\u5185\u5b58\u5206\u9875\u7ed3\u6784\u4e0eClusters\u7d22\u5f15\u89e3\u7801\u903b\u8f91<\/strong><\/p>\n<p><strong>4.1 \u975e\u91cf\u5316\u7248\u5185\u5b58\u5206\u9875\u7ed3\u6784<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n\/\/page count\r\n\/\/page 0 offset\r\n\/\/...\r\n\/\/page n offset\r\n\r\n\/\/page 0 data\r\n\/\/cluster count\r\n\/\/cluster 0 offset\r\n\/\/...\r\n\/\/cluster n offset\r\n\/\/cluster 0 index offset\r\n\/\/cluster 0 lod bound sphere 4 float\r\n\/\/cluster 0 lodError and EdgeLength\r\n\/\/cluster 0 data position 0~n\r\n\/\/cluster 0 data indexes 0~n\r\n\/\/...\r\n\/\/cluster n index offset\r\n\/\/cluster n lod bound sphere 4 float\r\n\/\/cluster n lodError and EdgeLength\r\n\/\/cluster n data position 0~n\r\n\/\/cluster n data indexes 0~n\r\n\r\n<\/pre>\n<p><strong>4.2 Clusters\u7d22\u5f15\u89e3\u7801\u903b\u8f91<\/strong><\/p>\n<p>\u5176\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\u6240\u793a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\nvoid StoreCluster(inout uint inClusterOffset,FHierarchyNodeSlice inHierarchyNodeSlice){\r\n\tuint clusterCount=inHierarchyNodeSlice.NumChildren;\r\n\tuint pageIndex=inHierarchyNodeSlice.ChildStartReference>>8;\r\n\tuint localClusterOffset=inHierarchyNodeSlice.ChildStartReference&0xFFu;\r\n\tuint localClusterPageIndexEnd=localClusterOffset+clusterCount;\r\n\tfor(uint localClusterPageIndex=localClusterOffset;localClusterPageIndex < localClusterPageIndexEnd;localClusterPageIndex++){\r\n\t\t\/\/OutMainAndPostNodeAndClusterBatches.Store2(inClusterOffset*8u,uint2(pageIndex,localClusterPageIndex));\r\n\t\tinClusterOffset++;\r\n\t}\r\n}\r\n\r\n<\/pre>\n<p><strong>5. \u8bfe\u7a0b\u4e2d\u7684\u6295\u5f71\u77e9\u9635\u8c03\u6574<\/strong><\/p>\n<p><strong>5.1 FOV\u65b9\u5411\u8c03\u6574<\/strong><\/p>\n<p>\u865a\u5e7b\u5f15\u64ce\u9ed8\u8ba4\u4f7f\u7528\u6c34\u5e73\u65b9\u5411($X$\u65b9\u5411) \u7684FOV, \u800c\u8bfe\u7a0b\u521d\u59cb\u4ee3\u7801\u4f7f\u7528\u4e86\u5782\u76f4\u65b9\u5411($Y$\u65b9\u5411) \u7684FOV. \u8fd9\u4f1a\u5bfc\u81f4\u6e32\u67d3\u7ed3\u679c\u4e0e\u865a\u5e7b\u5f15\u64ce\u4e0d\u4e00\u81f4, \u7279\u522b\u662f\u5728\u5bbd\u5c4f\u573a\u666f\u4e2d. \u901a\u8fc7\u5c06FOV\u8c03\u6574\u4e3a\u6c34\u5e73\u65b9\u5411, \u5e76\u6b63\u786e\u6784\u5efa\u6295\u5f71\u77e9\u9635, \u53ef\u4ee5\u786e\u4fdd\u6e32\u67d3\u7ed3\u679c\u4e0e\u865a\u5e7b\u5f15\u64ce\u4e00\u81f4.<br \/>\n$\\\\$ \u6c34\u5e73FOV\u611f\u89c9\u66f4\u81ea\u7136. \u4e00\u90e8\u5206\u4eba\u4e00\u76f4\u7528\u5782\u76f4FOV, \u56e0\u4e3a4:3, 16:9\u548c\u8d85\u5bbd\u5c4f\u663e\u793a\u5668\u9700\u8981\u7684\u6c34\u5e73FOV\u5404\u4e0d\u76f8\u540c, \u4f46\u901a\u5e38\u5782\u76f4FOV\u662f\u4e00\u6837\u7684.<\/p>\n<p><strong>5.1.1 \u6c34\u5e73FOV\u4e0e\u5782\u76f4FOV\u4e4b\u95f4\u7684\u5173\u7cfb<\/strong><\/p>\n<p>\u8bbe\u8fd1\u5e73\u9762\u4e0e\u6444\u50cf\u673a\u7684\u8ddd\u79bb(\u7126\u8ddd) \u4e3a$d$, \u8fd1\u5e73\u9762\u5bbd\u5ea6\u4e3a$w$, \u8fd1\u5e73\u9762\u9ad8\u5ea6\u4e3a$h$, \u7531\u4e09\u89d2\u51fd\u6570\u53ef\u63a8\u51fa\u4ee5\u4e0b\u516c\u5f0f:$$d = \\frac{\\frac{1}{2} h}{\\tan{\\frac{1}{2}FOV_h}} = \\frac{\\frac{1}{2} w}{\\tan{\\frac{1}{2}FOV_w}},$$\u5373\u5f97$$FOV_h = 2 \\cdot \\arctan(\\frac{h \\cdot \\tan(\\frac{1}{2}FOV_w)}{w}), \\\\ FOV_w = 2 \\cdot \\arctan(\\frac{h \\cdot \\tan(\\frac{1}{2}FOV_h)}{w}).$$<br \/>\n<strong>5.1.2 \u8ba1\u7b97\u4f7f\u7528\u6c34\u5e73FOV\u7684\u5f52\u4e00\u5316\u6295\u5f71\u5750\u6807<\/strong><\/p>\n<p><strong>5.1.2.1 \u8ba1\u7b97\u6295\u5f71\u5750\u6807$x$<\/strong><\/p>\n<p>\u6839\u636e\u5c0f\u5b54\u6210\u50cf\u539f\u7406, $P$\u70b9\u6295\u5f71\u5230$P'$\u70b9, \u518d\u7531\u76f8\u4f3c\u4e09\u89d2\u5f62\u539f\u7406, \u53ef\u5f97\u5230$P'$\u70b9\u7684\u5750\u6807:$$\\frac{x'}{x} = \\frac{-d}{z}, x' = -\\frac{x}{z} \\cdot d.$$<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates.png\" alt=\"\" width=\"4401\" height=\"1733\" class=\"aligncenter size-full wp-image-4766\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates.png 4401w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates-300x118.png 300w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates-768x302.png 768w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates-1536x605.png 1536w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_projection_coordinates-2048x806.png 2048w\" sizes=\"(max-width: 4401px) 100vw, 4401px\" \/><br \/>\n<center><em>\u56fe\u53c2\u8003\u81ea\u53c2\u8003\u6750\u65996.<\/em><\/center><\/p>\n<p><strong>5.1.2.2 \u53cd\u8f6c\u6295\u5f71<\/strong><\/p>\n<p>\u5176\u5b9e\u8fd9\u4e2a$-d$\u662f\u6ca1\u6709\u5fc5\u8981\u7684, \u53cd\u800c\u589e\u52a0\u8ba1\u7b97\u7684\u590d\u6742\u5ea6, \u800c\u4e14\u6210\u50cf\u5e94\u8be5\u6b63\u8fc7\u6765, \u56e0\u4e3a\u8fd9\u662f\u8ba1\u7b97\u673a\u4e4b\u4e2d, \u4e0d\u662f\u505a\u5c0f\u5b54\u6210\u50cf\u7684\u5b9e\u9a8c. \u5b83\u4e0d\u9700\u8981\u4e25\u683c\u9075\u5b88\u7269\u7406\u89c4\u5f8b, \u4f46\u662f\u5927\u5c0f\u6bd4\u4f8b\u548c\u771f\u5b9e\u60c5\u51b5\u662f\u4e00\u6837\u7684. \u6b64\u65f6\u7684\u7269\u4f53\u5750\u6807\u70b9$P$\u548c\u6295\u5f71\u70b9$P'$\u7684\u5173\u7cfb\u5982\u4e0a\u56fe\u6240\u793a, $P'$\u70b9\u7684\u5750\u6807\u4e3a:$$x_{P'} = \\frac{x}{z} \\cdot d.$$<br \/>\n<strong>5.1.2.3 \u8ba1\u7b97\u5f52\u4e00\u5316\u6295\u5f71\u5750\u6807$x$<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x.png\" alt=\"\" width=\"4060\" height=\"2476\" class=\"aligncenter size-full wp-image-4762\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x.png 4060w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x-300x183.png 300w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x-768x468.png 768w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x-1536x937.png 1536w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/calculate_normalized_projected_coordinate_x-2048x1249.png 2048w\" sizes=\"(max-width: 4060px) 100vw, 4060px\" \/><br \/>\n<center><em>\u56fe\u53c2\u8003\u81ea\u53c2\u8003\u6750\u65996.<\/em><\/center><\/p>\n<p>\u4e3a\u4e86\u5f97\u5230\u5f52\u4e00\u5316\u7684$x$\u5750\u6807, \u8bbe\u7f6e\u865a\u62df\u5c4f\u7684\u5bbd\u5ea6\u4e3a2, \u8303\u56f4\u662f$[-1, 1]$, \u4e00\u534a\u7684\u5c3a\u5bf8\u5c31\u662f1, \u8fd9\u662fOpenGL\u7684\u4e60\u60ef, \u5982\u679c\u662fDirectX\u4e2d, \u8fd9\u4e2a\u8303\u56f4\u662f$[0, 1]$. \u9996\u5148\u7531FOV\u8ba1\u7b97\u5f97\u5230$d$, \u518d\u5f97\u5230$x$\u5750\u6807$$\\frac{1}{d} = \\tan\\frac{FOV}{2}, \\Rightarrow d = \\frac{1}{\\tan\\frac{FOV}{2}}, \\\\ \\frac{z_P}{z_{P'}} = \\frac{x_P}{x_{P'}}, z_{P'} = -d = -\\frac{1}{\\tan\\frac{FOV}{2}}, \\\\ \\Rightarrow -\\frac{z_P}{\\frac{1}{\\tan\\frac{FOV}{2}}} = \\frac{x_P}{x_{P'}}, \\\\ \\Rightarrow x_{P'} = \\frac{x_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}}}{z_P}, x_{P'} \\in [-1, 1].$$<br \/>\n<strong>5.1.2.4 \u8ba1\u7b97\u5f52\u4e00\u5316\u6295\u5f71\u5750\u6807$y$<\/strong><\/p>\n<p>\u5728\u5782\u76f4\u65b9\u5411, \u4e5f\u9075\u5faa\u540c\u6837\u7684\u6295\u5f71\u89c4\u5f8b, \u800c\u4e14\u65e0\u8bba\u8ba1\u7b97$x$, \u8fd8\u662f\u8ba1\u7b97$y$, \u90fd\u662f\u540c\u4e00\u5757\u6295\u5f71\u5c4f, \u6295\u5f71\u5c4f\u7684\u5750\u6807\u90fd\u662f\u76f8\u540c\u7684, \u90fd\u662f$d$, \u6240\u4ee5\u6839\u636e\u4e0a\u5f0f\u53ef\u4ee5\u5f97\u5230$$y_{P'} = -\\frac{y_P \\cdot d}{z_P} = -\\frac{y_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}}}{z_P}, y_{P'} \\in [-\\frac{1}{A_{aspect}}, \\frac{1}{A_{aspect}}].$$\u6ce8\u610f\u6b64\u65f6$y$\u5750\u6807\u7684\u53d6\u503c\u8303\u56f4\u4e0d\u662f\u60f3\u8981\u7684\u5f52\u4e00\u5316\u7684, \u56e0\u4e3a\u89c6\u9525\u4f53\u6c34\u5e73\u548c\u5782\u76f4\u65b9\u5411\u4e0d\u4e00\u5b9a\u662f\u76f8\u7b49\u7684, \u662f\u6709\u5bbd\u9ad8\u6bd4\u7684, \u8fd9\u4e2a\u5bbd\u9ad8\u6bd4\u5f80\u5f80\u4e5f\u662f\u5c4f\u5e55\u7684\u5bbd\u9ad8\u6bd4, \u6240\u4ee5\u5f53$w = 1$\u65f6, \u4e3a\u4e86\u753b\u9762\u4e0d\u53d8\u5f62, \u6709$$\\frac{w}{h} = A_{aspect}, h = \\frac{w}{A_{aspect}} = \\frac{1}{A_{aspect}}.$$\u4f46\u662f, \u4e3a\u4e86\u5f97\u5230\u5f52\u4e00\u5316\u7684$y$\u5750\u6807,\u9700\u8981\u8fdb\u884c\u6269\u5927\u64cd\u4f5c, \u5373\u6269\u5927$A_{aspect}$\u500d, \u7b26\u5408$[-1, 1]$\u7684\u533a\u95f4:$$y_{P'} = -\\frac{y_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}}}{z_P}, y_{P'} \\in [-\\frac{A_{aspect}}{A_{aspect}}, \\frac{A_{aspect}}{A_{aspect}}] = [-1, 1].$$<br \/>\n<strong>5.1.2.5 \u63a8\u5bfc\u77e9\u9635<\/strong><\/p>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u5f0f\u5b50\u53ef\u4ee5\u5f97\u5230\u6700\u7ec8\u7684\u6295\u5f71\u5750\u6807, \u5982\u4e0b\u5f0f\u6240\u793a. \u8fd9\u4e2a\u5750\u6807\u4e0d\u4ec5\u662f\u5f52\u4e00\u5316\u7684, \u800c\u4e14\u5df2\u7ecf\u9664\u4ee5\u4e86$\\omega = z$, \u5df2\u7ecf\u662f\u6295\u5f71\u540e\u7684\u7ed3\u679c. \u5728\u4e0b\u5f0f\u4e2d, $x$, $y$\u5750\u6807\u7684\u8ba1\u7b97\u4e2d\u53ef\u4ee5\u627e\u5230$d$\u7684\u90e8\u5206, \u4f46\u662f$z$\u5750\u6807\u4e2d\u6ca1\u6709. \\begin{equation} \\left\\{\\begin{matrix}<br \/>\nx_{P'} = \\frac{x_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}}}{z_P}, & x_{P'} \\in [-1, 1], \\\\<br \/>\ny_{P'} = -\\frac{y_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}}}{z_P}, & y_{P'} \\in [-1, 1], \\\\<br \/>\nz_{P'} = -\\frac{z_P \\cdot (-\\frac{f + n}{f - n}) - \\frac{2nf}{f - n}}{z_P} & z_{P'} \\in [-1, 1].<br \/>\n\\end{matrix}\\right. \\label{final_projected_coordinates} \\end{equation} \u63a5\u4e0b\u6765\u5c06\u5f0f$\\ref{final_projected_coordinates}$\u8fd8\u539f\u4e3a\u9f50\u6b21\u5750\u6807\u5f62\u5f0f, \u5e94\u4e3a\u5f0f$\\ref{final_projected_coordinates_homogeneous_coordinate_form1}$, \u6267\u884c\u9f50\u6b21\u9664\u6cd5, \u5c31\u662f\u5f0f$\\ref{final_projected_coordinates}$. \\begin{equation} \\begin{pmatrix}<br \/>\nxd \\\\<br \/>\nyd \\\\<br \/>\nzd \\\\<br \/>\n\\omega<br \/>\n\\end{pmatrix} = \\begin{pmatrix}<br \/>\nx_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}} \\\\<br \/>\ny_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} \\\\<br \/>\n((z_P \\cdot (-\\frac{f + n}{f - n}) - \\frac{2nf}{f - n}) \\cdot \\tan\\frac{FOV}{2}) \\cdot \\frac{1}{\\tan\\frac{FOV}{2}} \\\\<br \/>\n-z_P<br \/>\n\\end{pmatrix}, \\\\ d = \\frac{1}{\\tan\\frac{FOV}{2}}, \\omega = -z_P. \\label{final_projected_coordinates_homogeneous_coordinate_form1} \\end{equation} \u5982\u679c\u5c06\u5f0f$\\ref{final_projected_coordinates}$\u8fd8\u539f\u4e3a\u53e6\u4e00\u79cd\u9f50\u6b21\u5750\u6807\u5f62\u5f0f, \u5e94\u4e3a\u5f0f$\\ref{final_projected_coordinates_homogeneous_coordinate_form2}$, \u6267\u884c\u9f50\u6b21\u9664\u6cd5, \u5c31\u662f\u5f0f$\\ref{final_projected_coordinates}$. \\begin{equation} \\begin{pmatrix}<br \/>\nx_{clip} \\\\<br \/>\ny_{clip} \\\\<br \/>\nz_{clip} \\\\<br \/>\n\\omega<br \/>\n\\end{pmatrix} = \\begin{pmatrix}<br \/>\nx_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}} \\\\<br \/>\ny_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} \\\\<br \/>\n(z_P \\cdot (-\\frac{f + n}{f - n}) - \\frac{2nf}{f - n}) \\\\<br \/>\n-z_P<br \/>\n\\end{pmatrix}, \\\\ d = \\frac{1}{\\tan\\frac{FOV}{2}}, \\omega = -z_P. \\label{final_projected_coordinates_homogeneous_coordinate_form2} \\end{equation}<br \/>\n\u60f3\u901a\u8fc7\u77e9\u9635\u53d8\u6362\u5c06\u4e00\u4e2a\u89c2\u5bdf\u7a7a\u95f4\u7684\u5750\u6807$(x, y, z)$\u6240\u5bf9\u5e94\u7684\u9f50\u6b21\u5750\u6807$(x, $$ y, z, 1)$, \u8f6c\u6362\u5230\u5f52\u4e00\u5316\u7684\u526a\u88c1\u7a7a\u95f4, \u5e76\u4e14\u5f97\u5230\u5982\u5f0f$\\ref{final_projected_coordinates_homogeneous_coordinate_form2}$\u6240\u793a\u7684\u5f62\u5f0f, \u8fd9\u4e2a\u5f62\u5f0f\u6267\u884c\u4e00\u6b21\u9f50\u6b21\u9664\u6cd5, \u5c31\u80fd\u5f97\u5230\u5f52\u4e00\u5316\u7684\u6295\u5f71\u5750\u6807:<br \/>\n$\\\\$ \u6295\u5f71\u77e9\u9635 $\\times$ \u89c2\u5bdf\u7a7a\u95f4\u5750\u6807 = \u526a\u88c1\u7a7a\u95f4\u5750\u6807, \u5982\u4e0b\u5f0f\u6240\u793a.$$M \\begin{pmatrix}<br \/>\nx_P \\\\<br \/>\ny_P \\\\<br \/>\nz_P \\\\<br \/>\n1<br \/>\n\\end{pmatrix} = \\begin{pmatrix}<br \/>\nx_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}} \\\\<br \/>\ny_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} \\\\<br \/>\n(z_P \\cdot (-\\frac{f + n}{f - n}) - \\frac{2nf}{f - n} \\\\<br \/>\n-z_P<br \/>\n\\end{pmatrix} = \\begin{pmatrix}<br \/>\nx_{clip} \\\\<br \/>\ny_{clip} \\\\<br \/>\nz_{clip} \\\\<br \/>\n\\omega<br \/>\n\\end{pmatrix}, \\\\ \\begin{pmatrix}<br \/>\n\\frac{1}{\\tan\\frac{FOV}{2}} & 0 & 0 & 0 \\\\<br \/>\n0 & \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} & 0 & 0 \\\\<br \/>\n0 & 0 & -\\frac{f + n}{f - n} & - \\frac{2nf}{f - n} \\\\<br \/>\n0 & 0 & -1 & 0<br \/>\n\\end{pmatrix} \\begin{pmatrix}<br \/>\nx_P \\\\<br \/>\ny_P \\\\<br \/>\nz_P \\\\<br \/>\n1<br \/>\n\\end{pmatrix} = \\begin{pmatrix}<br \/>\nx_P \\cdot \\frac{1}{\\tan\\frac{FOV}{2}} \\\\<br \/>\ny_P \\cdot \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} \\\\<br \/>\n(z_P \\cdot (-\\frac{f + n}{f - n}) - \\frac{2nf}{f - n} \\\\<br \/>\n-z_P<br \/>\n\\end{pmatrix}.$$\u6700\u540e\u5f97\u5230\u7684\u6295\u5f71\/ \u526a\u88c1\u77e9\u9635\u5982\u4e0b\u5f0f\u6240\u793a.$$M = \\begin{pmatrix}<br \/>\n\\frac{1}{\\tan\\frac{FOV}{2}} & 0 & 0 & 0 \\\\<br \/>\n0 & \\frac{A_{aspect}}{\\tan\\frac{FOV}{2}} & 0 & 0 \\\\<br \/>\n0 & 0 & -\\frac{f + n}{f - n} & - \\frac{2nf}{f - n} \\\\<br \/>\n0 & 0 & -1 & 0<br \/>\n\\end{pmatrix}.$$<br \/>\n<strong>5.2 \u77e9\u9635\u8f6c\u7f6e\u5904\u7406<\/strong><\/p>\n<p>GPU\u4e0a\u7684\u77e9\u9635\u8868\u793a\u4e0eCPU\u4e0a\u7684\u8868\u793a\u4e0d\u540c. CPU\u4e0a\u901a\u5e38\u4f7f\u7528\u884c\u77e9\u9635, \u800cGPU\u4e0a\u4f7f\u7528\u5217\u77e9\u9635. \u56e0\u6b64, \u5728\u5c06\u77e9\u9635\u4f20\u9012\u5230GPU\u4e4b\u524d, \u9700\u8981\u8fdb\u884c\u8f6c\u7f6e\u5904\u7406, \u786e\u4fdd\u6570\u5b66\u8fd0\u7b97\u7684\u6b63\u786e\u6027.<\/p>\n<p><strong>6. \u865a\u5e7b\u7684ViewMatrix\u7684\u53d8\u6362\u6d41\u7a0b<\/strong><\/p>\n<p>\u5728Nanite\u6e32\u67d3\u7ba1\u7ebf\u4e2d, ViewMatrix\u7684\u5904\u7406\u662f\u5173\u952e\u7b2c\u4e00\u6b65, \u5b83\u51b3\u5b9a\u4e86\u6444\u50cf\u673a\u5728\u4e16\u754c\u7a7a\u95f4\u4e2d\u7684\u4f4d\u7f6e\u548c\u671d\u5411. \u8bfe\u7a0b\u4e2d\u5c06ViewMatrix\u62c6\u5206\u4e3a\u65cb\u8f6c\u548c\u5e73\u79fb\u5206\u91cf, \u8fd9\u4e3a\u540e\u7eed\u7684Cluster\u9009\u62e9\u63d0\u4f9b\u4e86\u57fa\u7840.<br \/>\n$\\\\$ ViewMatrix\u7684\u6570\u5b66\u7ed3\u6784\u662f\u4e00\u4e2a$4 \\times 4$\u77e9\u9635, \u5305\u542b\u4ee5\u4e0b\u4fe1\u606f:<br \/>\n$\\\\$ $\\cdot$ $3 \\times 3$\u5de6\u4e0a\u89d2: \u6444\u50cf\u673a\u7684\u65cb\u8f6c\u77e9\u9635(\u8868\u793a\u6444\u50cf\u673a\u7684\u65b9\u5411);<br \/>\n$\\\\$ $\\cdot$ \u7b2c\u56db\u5217\u524d\u4e09\u884c: \u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u5411\u91cf\u7684\u76f8\u53cd\u5411\u91cf(\u8868\u793a\u6444\u50cf\u673a\u5728\u4e16\u754c\u7a7a\u95f4\u4e2d\u7684\u5750\u6807\u5404\u5206\u91cf\u7684\u76f8\u53cd\u6570\u6784\u6210\u7684\u5750\u6807); <em>\u4e3a\u4e86\u964d\u4f4e\u5927\u4e16\u754cStreaming\u4e0b\u6570\u503c\u7cbe\u5ea6\u8bef\u5dee\u7684\u5f71\u54cd, \u865a\u5e7b\u5f15\u64ce\u901a\u5e38\u5c06World Space\u4e0b\u7684\u5411\u91cf\u8f6c\u6362\u81f3Translated World Space\u4e0b, \u5373\u5c06\u6444\u50cf\u673a\u7f6e\u4e8e\u539f\u70b9\u5904, \u6545\u6b64\u65f6ViewMatrix\u7684\u7b2c\u56db\u5217\u524d\u4e09\u884c\u5168\u4e3a0;<\/em><br \/>\n$\\\\$ $\\cdot$ \u7b2c\u56db\u884c\u7b2c\u56db\u5217: \u901a\u5e38\u4e3a1.0(\u9f50\u6b21\u5750\u6807).<br \/>\n$\\\\$ \u62c6\u5206ViewMatrix\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5355\u72ec\u5904\u7406\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u548c\u671d\u5411, \u8fd9\u5728Cluster\u9009\u62e9\u9636\u6bb5\u975e\u5e38\u91cd\u8981. \u5fc5\u8981\u60c5\u51b5\u4e0b, \u53ef\u4ee5\u5bf9\u6444\u50cf\u673a\u53c2\u6570\u8fdb\u884c\u538b\u7f29, \u53ea\u4fdd\u7559\u5fc5\u8981\u7684\u7cbe\u5ea6, \u4f8b\u5982\u65cb\u8f6c\u548c\u7f29\u653e\u53c2\u6570\u901a\u5e38\u4e0d\u9700\u898132\u4f4d\u6d6e\u70b9\u6570\u7684\u7cbe\u5ea6.<\/p>\n<p><strong>7. \u865a\u5e7b\u7684\u81ea\u52a8\u5316LOD\u7684\u5254\u9664\u903b\u8f91<\/strong><\/p>\n<p><strong>7.1 Clusters\u9009\u62e9\u539f\u7406<\/strong><\/p>\n<p>Cluster\u662fNanite\u6e32\u67d3\u7ba1\u7ebf\u7684\u57fa\u672c\u5355\u4f4d, \u6bcf\u4e2aCluster\u5305\u542b\u7ea6128\u4e2a\u4e09\u89d2\u5f62. Clusters\u9009\u62e9\u7684\u6838\u5fc3\u662f\u5224\u65adClusters\u5728\u89c6\u53e3\u7a7a\u95f4\u7684\u6295\u5f71\u662f\u5426\u53ef\u89c1. \u8fd9\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0:<br \/>\n$\\\\$ $\\cdot$ \u5c06Clusters\u7684\u9876\u70b9\u4ece\u6a21\u578b\u7a7a\u95f4\u8f6c\u6362\u5230\u89c6\u53e3\u7a7a\u95f4;<br \/>\n$\\\\$ $\\cdot$ \u8ba1\u7b97Clusters\u7684\u5c4f\u5e55\u7a7a\u95f4\u6295\u5f71\u8303\u56f4;<br \/>\n$\\\\$ $\\cdot$ \u5224\u65ad\u6295\u5f71\u8303\u56f4\u662f\u5426\u4e0e\u89c6\u53e3\u76f8\u4ea4.<br \/>\n$\\\\$ $\\cdot$ \u57fa\u4e8e\u6295\u5f71\u8303\u56f4\u548c\u8bef\u5dee\u9608\u503c\u9009\u62e9Mipmap Level.<br \/>\n$\\\\$ $\\cdot$ \u6839\u636e\u6295\u5f71\u5927\u5c0f\u51b3\u5b9a\u4f7f\u7528\u786c\u4ef6\u6216\u8f6f\u4ef6\u5149\u6805\u5316\u8def\u5f84.<br \/>\n$\\\\$ Clusters\u9009\u62e9\u5fc5\u987b\u5728\u89c6\u53e3\u7a7a\u95f4\u4e0b\u8fdb\u884c, \u56e0\u4e3a\u8fd9\u662f\u6444\u50cf\u673a\u89c2\u5bdf\u7684\u6700\u7ec8\u7a7a\u95f4.<\/p>\n<p><strong>7.2 Clusters\u53ef\u89c1\u6027\u5224\u65ad<\/strong><\/p>\n<p>Clusters\u53ef\u89c1\u6027\u5224\u65ad\u662fNanite\u6e32\u67d3\u7ba1\u7ebf\u7684\u6838\u5fc3\u7b97\u6cd5, \u5176\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\u6240\u793a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n\/\/frustum volumen vs sphere,bvh node and cluster\r\n\/\/view space,world space\r\nfloat2 GetProjectionScales(float4 inSphereWS){\r\n\tif(ProjectionMatrix[3][3]>=1.0f){\/\/not ortho\r\n\t\treturn float2(1.0f,1.0f);\r\n\t}\r\n\t\/\/translated world\r\n\t\/\/min z(0.1) * 0.1,max(0.9) z * 100.0\r\n\tfloat3 center=inSphereWS.xyz;\r\n\tfloat radius=inSphereWS.w;\r\n\t\r\n\tfloat distanceToSphereCenterSq=dot(center,center);\r\n\tfloat distanceToSphereCenter=sqrt(distanceToSphereCenterSq);\r\n\t\r\n\tfloat zVS=dot(Nanite_ViewForward.xyz,center);\/\/center\r\n\t\r\n\tfloat xVSSq=distanceToSphereCenterSq-zVS*zVS;\r\n\tfloat xVS=sqrt(max(0.0f,xVSSq));\r\n\r\n\tfloat distanceToTangentPointSq=distanceToSphereCenterSq-radius*radius;\r\n\tfloat distanceToTangentPoint=sqrt(max(0.0f,distanceToTangentPointSq));\r\n\r\n\tfloat sinTheta=radius\/distanceToSphereCenter;\r\n\tfloat cosTheta=distanceToTangentPoint\/distanceToSphereCenter;\r\n\r\n\tfloat a=(-sinTheta*xVS+cosTheta*zVS)\/distanceToSphereCenter;\r\n\tfloat b=(sinTheta*xVS+cosTheta*zVS)\/distanceToSphereCenter;\r\n\r\n\tfloat minZ=max(10.0f,zVS-radius);\r\n\tfloat maxZ=max(10.0f,zVS+radius);\r\n\t\r\n\tif(zVS+radius>10.0f){\r\n\t\treturn float2(minZ*a,maxZ*b);\r\n\t}\r\n\treturn float2(0.0f,0.0f);\r\n}\r\n\r\n<\/pre>\n<p>\u901a\u8fc7\u8ba1\u7b97Clusters\u7684\u5305\u56f4\u7403\u5728\u89c6\u53e3\u8303\u56f4\u5185\u7684\u6295\u5f71\u7f29\u653e\u503c, \u53ef\u4ee5\u5feb\u901f\u786e\u5b9aClusters\u662f\u5426\u53ef\u89c1.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales.png\" alt=\"\" width=\"2408\" height=\"1338\" class=\"aligncenter size-full wp-image-4813\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales.png 2408w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales-300x167.png 300w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales-768x427.png 768w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales-1536x853.png 1536w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2025\/12\/diagram_GetProjectionScales-2048x1138.png 2048w\" sizes=\"(max-width: 2408px) 100vw, 2408px\" \/><\/p>\n<p>\u4e0a\u56fe\u53ef\u4f5c\u4e3a\u4e0a\u8ff0\u4ee3\u7801\u7684\u793a\u610f\u56fe. \u4e0a\u8ff0\u4ee3\u7801\u4e2d\u51fd\u6570GetProjectionScales\u7684\u76ee\u7684\u4e3a\u4e86\u83b7\u53d6\u6a21\u578b\u5728\u89c6\u53e3\u7a7a\u95f4\u4e2d\u79bb\u6444\u50cf\u673a\u6700\u8fd1\u70b9\u5750\u6807\u7684$z$\u5206\u91cf\u503c$minZ$, \u8be5\u5206\u91cf\u503c\u4f1a\u6839\u636e\u53d8\u91cf$a$\u7684\u503c\u8fdb\u884c\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u7684\u7f29\u653e, \u5176\u4e2d, \u53d8\u91cf$a$\u7684\u503c\u662f\u901a\u8fc7\u7c7b\u4f3c\u65cb\u8f6c\u53d8\u6362\u7684\u53d8\u6362\u5f97\u5230\u7684; \u800c\u6a21\u578b\u5728\u89c6\u53e3\u7a7a\u95f4\u4e2d\u79bb\u6444\u50cf\u673a\u6700\u8fdc\u70b9\u5750\u6807\u7684$z$\u5206\u91cf\u503c$maxZ$\u5728\u865a\u5e7b\u4e2d\u6682\u65f6\u672a\u88ab\u4f7f\u7528.<\/p>\n<p><strong>7.2 Clusters\u5254\u9664\u903b\u8f91<\/strong><\/p>\n<p>Nanite\u7684Clusters\u5254\u9664\u903b\u8f91: \u7b2c\u4e00\u9636\u6bb5\u662f\u5bf9\u4e8eBVH Nodes\u7684\u521d\u6b65\u7b5b\u9009, \u7b2c\u4e8c\u9636\u6bb5\u662f\u5bf9\u4e8eClusters\u7684\u7cbe\u7ec6\u5254\u9664, \u5176\u4f2a\u4ee3\u7801\u5982\u4e0b\u6240\u793a.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n\/\/ Compute Shader\u4e2dClusters\u5254\u9664\u903b\u8f91\r\n[numthreads(1, 1, 1)]\r\nvoid main(uint3 id : SV_GroupID) {\r\n    \/\/ \u83b7\u53d6BVH Node\u4fe1\u606f, \u5047\u8bbe\u8bb0\u5f55\u4e8eid\u7684x\u5206\u91cf\u4e2d\r\n    uint BVHNodeIndex = id.x;\r\n    BoundingSphere BVHNodeSphere = BVHNodeSpheres[BVHNodeIndex];\r\n\r\n    \/\/ \u8ba1\u7b97BVHNode\u7684LOD\u8bef\u5dee\r\n    float BVHNodeLODError = CalculateBVHNodeLODErrors(BVHNodeSphere);\r\n\r\n    \/\/ \u7b2c\u4e00\u9636\u6bb5\uff1a\u5bf9\u4e8eBVH Nodes\u7684\u521d\u6b65\u7b5b\u9009\r\n    if (BVHNodeLODError > MaxLODError) {\r\n        \/\/ \u5254\u9664\uff0c\u8bef\u5dee\u8fc7\u5927\r\n        return;\r\n    }\r\n\r\n    \/\/ \u83b7\u53d6Cluster\u4fe1\u606f, \u5047\u8bbe\u8bb0\u5f55\u4e8eid\u7684y\u5206\u91cf\u4e2d\r\n    uint ClusterIndex = id.y;\r\n    BoundingSphere ClusterSphere = ClusterSpheres[ClusterIndex];\r\n\r\n    \/\/ \u8ba1\u7b97Cluster\u7684LOD\u8bef\u5dee\r\n    float ClusterLODError = CalculateClusterLODErrors(ClusterSphere);\r\n\r\n    \/\/ \u7b2c\u4e8c\u9636\u6bb5\uff1a\u5bf9\u4e8eClusters\u7684\u7cbe\u7ec6\u5254\u9664\r\n    if (!CheckVisibility(ClusterSphere, ClusterLODError)) {\r\n        \/\/ \u5254\u9664\uff0c\u4e0d\u53ef\u89c1\r\n        return;\r\n    }\r\n\r\n    \/\/ \u6807\u8bb0\u4e3a\u53ef\u89c1\r\n    VisibleClusterIndices[id.x] = ClusterIndex;\r\n}\r\n\r\n<\/pre>\n<p>$\\cdot$ \u521d\u6b65\u7b5b\u9009\u9636\u6bb5\u57fa\u4e8eLOD\u8bef\u5dee\u5224\u65ad, \u5254\u9664\u90a3\u4e9b\u5373\u4f7f\u5728\u6700\u4f73Mipmap Level\u4e0b\u4e5f\u65e0\u6cd5\u6ee1\u8db3\u89c6\u89c9\u8d28\u91cf\u8981\u6c42\u7684BVH Nodes, \u5373\u5254\u9664\u4e0d\u6ee1\u8db3LOD Error\u4e0a\u9650\u7684BVH Nodes, \u5176\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\u6240\u793a.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\nbool ShouldVisitChild(FHierarchyNodeSlice inHierarchyNodeSlice){\r\n\tfloat3 boundingSphere=inHierarchyNodeSlice.LODBounds.xyz;\r\n\tfloat4 boundingSpherePositionWS=mul(ModelMatrix,float4(boundingSphere,1.0f));\r\n\tboundingSpherePositionWS=float4(boundingSpherePositionWS.xyz-Nanite_ViewOrigin.xyz,1.0f);\r\n\t\/\/QEM : Quadric Error Metrics,METIS\r\n\tfloat2 projectionScales=GetProjectionScales(float4(boundingSpherePositionWS.xyz,inHierarchyNodeSlice.LODBounds.w));\r\n\tfloat lodScale=Nanite_ViewOrigin.w;\r\n\tfloat threshold=lodScale*inHierarchyNodeSlice.MaxParentLODError;\r\n\tif(projectionScales.x<=threshold){\r\n\t\t\/\/projectionScales.y>minLODError\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\n<\/pre>\n<p>$\\cdot$ \u7cbe\u7ec6\u5254\u9664\u9636\u6bb5\u57fa\u4e8eClusters\u7684\u5305\u56f4\u7403\u5728\u89c6\u53e3\u8303\u56f4\u5185\u7684\u6295\u5f71\u7f29\u653e\u503c\u5224\u65ad, \u8fdb\u4e00\u6b65\u5254\u9664\u90a3\u4e9b\u4e0d\u6ee1\u8db3LOD Error\u4e0b\u9650\u7684Clusters, \u5176\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\u6240\u793a.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n\r\n\/\/View Direction (World Space),depth\r\n\/\/Translated World\r\n\/\/View Matrix : RotationScale + Translate + ViewForward\r\n\/\/Projection Matrix,fov : y => x : x,y,z\r\n\/\/0~1024 : cluster 0~n\r\n\/\/4096~2048 : cluster n ~ 0\r\n[numthreads(1,1,1)]\/\/1 -> wave : 32\r\nvoid MainCS(){\r\n\tuint clusterCount=WorkArg.Load2(0).y;\r\n\tuint visibleClusterCount=0;\r\n\tfor(uint i=0;i < clusterCount;i++){\r\n\t\tuint2 packedCluster=MainAndPostNodeAndClusterBatches.Load2(i*8u);\r\n\t\tuint pageIndex=packedCluster.x;\r\n\t\tuint clusterIndex=packedCluster.y;\/\/MipLevel,LODBounds,LODError,EdgeLength => SW,HW,Visible(false)\r\n\t\tClusterInfo clusterInfo=GetClusterinfo(pageIndex,clusterIndex);\r\n\t\tfloat3 boundingSphere=clusterInfo.LODBounds.xyz;\r\n\t\tfloat4 boundingSpherePositionWS=mul(ModelMatrix,float4(boundingSphere,1.0f));\r\n\t\tboundingSpherePositionWS=float4(boundingSpherePositionWS.xyz-Nanite_ViewOrigin.xyz,1.0f);\r\n\t\t\/\/QEM : Quadric Error Metrics,METIS\r\n\t\tfloat2 projectionScales=GetProjectionScales(float4(boundingSpherePositionWS.xyz,clusterInfo.LODBounds.w));\r\n\t\tfloat lodScale=Nanite_ViewOrigin.w;\r\n\t\tfloat lodScaleHW=Nanite_ViewForward.w;\r\n\t\tif(projectionScales.x > clusterInfo.LODError*lodScale){\r\n\t\t\tif(projectionScales.x < abs(clusterInfo.EdgeLength)*lodScaleHW){\r\n\t\t\t\t\/\/hw\r\n\t\t\t}else{\r\n\t\t\t\t\/\/sw\r\n\t\t\t}\r\n\t\t\tOutVisibleClustersSWHW.Store2(visibleClusterCount*8u,packedCluster);\r\n\t\t\tvisibleClusterCount++;\r\n\t\t}\r\n\t}\r\n\tWorkArg.Store(4,visibleClusterCount);\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\u5728B\u7ad9\u4e0a\u53d1\u73b0\u4e00\u4e2a\u5b9d\u85cf\u8bfe\u7a0b\u300a[\u8ba9Nanite\u70c2\u5927\u8857\u8ba1\u5212]\u624b\u6413Nanite\u300b, \u6012\u65a5138\u5de8\u8d44\u5b66\u4e60\u4e00\u6ce2.  &hellip; <a href=\"https:\/\/www.caiqinyi.cn\/index.php\/2025\/12\/25\/course_notes_let_nanite_ubiquitous_plan_hand_crafted_nanite\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u300a[\u8ba9Nanite\u70c2\u5927\u8857\u8ba1\u5212]\u624b\u6413Nanite\u300b\u8bfe\u7a0b\u7b14\u8bb0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,31,12,24,10,9,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/4706"}],"collection":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4706"}],"version-history":[{"count":120,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/4706\/revisions"}],"predecessor-version":[{"id":4832,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/4706\/revisions\/4832"}],"wp:attachment":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}