{"id":481,"date":"2026-06-02T00:02:18","date_gmt":"2026-06-01T16:02:18","guid":{"rendered":"http:\/\/chenglixue.top\/?p=481"},"modified":"2026-06-07T19:16:14","modified_gmt":"2026-06-07T11:16:14","slug":"ue-mesh-drawing-pipeline","status":"publish","type":"post","link":"http:\/\/chenglixue.top\/?p=481","title":{"rendered":"UE Mesh Drawing Pipeline"},"content":{"rendered":"<p><div class=\"has-toc have-toc\"><\/div><\/p>\n<h1>\u524d\u8a00<\/h1>\n<p>\u7b14\u8005\u6700\u8fd1\u5728\u5206\u6790UE5\u7ba1\u7ebf\uff0c\u53d1\u73b0cpp\u7aef\u5e38\u91cf\u7f13\u51b2\u533a\u7684\u7ed1\u5b9a\u3001\u6e32\u67d3\u72b6\u6001\u7684\u7ed1\u5b9a\u770b\u8d77\u6765\u5f88\u6298\u78e8\uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48UE5\u4f1a\u8fd9\u6837\u505a\uff0c\u4e3a\u4ec0\u4e48\u4e0eDX12\u5b8c\u5168\u4e0d\u540c\uff0c\u4ee5\u53ca\u8fd9\u6837\u505a\u6709\u4ec0\u4e48\u597d\u5904\uff0c\u8fd9\u7bc7\u6587\u7ae0\u5c06\u4e00\u4e00\u89e3\u7b54<\/p>\n<h1>\u91cd\u8981\u7ec4\u4ef6<\/h1>\n<p>cpp\u5e38\u91cf\u7f13\u51b2\u533a\u7684\u7ed1\u5b9a\u3001\u6e32\u67d3\u72b6\u6001\u7684\u7ed1\u5b9a\u90fd\u9700\u8981Level\u7684\u6570\u636e\uff0c\u8fd9\u4e9b\u6570\u636e\u600e\u4e48\u4f20\u9012\u5230\u7ba1\u7ebf\u7684\u5462\uff1f<\/p>\n<p>UE5\u901a\u8fc7\u5728mesh\u4e0a\u6302\u8f7dcomponent\uff0c\u901a\u8fc7Componet\u5c06\u9700\u8981\u7684\u6570\u636e\u4f20\u9012\u7ed9\u5f15\u64ce\uff0c\u4ece\u800c\u8fdb\u884c\u7ed1\u5b9a<\/p>\n<p>\u8fd9\u91cc\u63d0\u53ca\u51e0\u4e2a\u5fc5\u8981\u7684Component\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>Class<\/th>\n<th>\u4f5c\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>UWorld<\/td>\n<td>\u76f8\u5f53\u4e8e\u4e00\u4e2a\u5730\u56fe\uff0c\u6240\u6709\u7684 Actor \u548c\u7ec4\u4ef6\u90fd\u5728\u8fd9\u91cc\u751f\u6210\u548c\u6e32\u67d3<\/td>\n<\/tr>\n<tr>\n<td>ULevel<\/td>\n<td>\u5206\u4e3aPersistentLevel\u3001Streaming Level<br \/>Persistent Level\uff1a <code>UWorld<\/code> \u7684\u201c\u4e3b\u5fc3\u9aa8\u201d\u3002\u53cc\u51fb\u6253\u5f00\u4e00\u4e2a\u5730\u56fe\u8d44\u4ea7\u65f6\uff0c\u8fd9\u4e2a\u8d44\u4ea7\u5c31\u6210\u4e86\u5f53\u524d\u7684 Persistent Level\uff0c\u5728\u8fd9\u4e2a UWorld \u7684\u6574\u4e2a\u751f\u547d\u5468\u671f\u5185<strong>\u6c38\u8fdc\u5b58\u5728\uff0c\u7edd\u5bf9\u4e0d\u4f1a\u88ab\u5378\u8f7d<\/strong><br \/>Streaming Level\uff1a\u662f<strong>\u52a8\u6001\u7684<\/strong>\u3002\u53ef\u4ee5\u968f\u65f6\u628a\u5b83\u4eec\u52a0\u8f7d\u5230 UWorld\u4e2d\uff0c\u6216\u4ece UWorld\u4e2d\u5378\u8f7d\u6389<\/td>\n<\/tr>\n<tr>\n<td>USceneComponent<\/td>\n<td>\u5f15\u5165\u4e86 Transform \u548c\u7236\u5b50\u5c42\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>UPrimitiveComponent<\/td>\n<td>\u8d4b\u4e88Actor<strong>\u53ef\u6e32\u67d3\u3001\u8fdb\u884c\u7269\u7406\u4ea4\u4e92<\/strong>\u7684\u529f\u80fd\uff0c\u7531Game Thread\u9a71\u52a8\uff0c\u5305\u542bActor\u6240\u6709\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>FScene<\/td>\n<td>\u5bb9\u7eb3\u6240\u6709\u7531Component\u53d1\u9001\u7684Actor \u6570\u636e\uff0cActor\u7684\u6570\u636e\u4ec5\u88ab\u6dfb\u52a0\u5230<strong><code>FScene<\/code><\/strong>\uff08\u6ce8\u518c\u7ec4\u4ef6\u65f6\u8c03\u7528\uff09\u540e\u624d\u4f1a\u5b58\u5728\u4e8eRender<\/td>\n<\/tr>\n<tr>\n<td>FPrimitiveSceneProxy<\/td>\n<td>\u7531UPrimitiveComponent\u521b\u5efa\uff0c\u6253\u5305\u6240\u6709GPU\u9700\u8981\u7684\u6570\u636e\uff0c\u7531Render Thread\u9a71\u52a8\uff0c<strong>\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168<\/strong><\/td>\n<\/tr>\n<tr>\n<td>FPrimitiveSceneInfo<\/td>\n<td>\u4e00\u4e2a\u6e32\u67d3\u6240\u7528\u6570\u636e\uff0c\u7531FScene\u6839\u636eFPrimitiveSceneProxy\uff0c\u8ba1\u7b97\u6253\u5305\u7684\u6e32\u67d3\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>FSceneView<\/td>\n<td>\u5b58\u5728\u4e8e<strong>Engine<\/strong>\uff0c\u5b58\u50a8\u4e0e\u5f53\u524dcamera\u76f8\u5173\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>FViewInfo<\/td>\n<td>\u5b58\u5728\u4e8e<strong>Render<\/strong>\uff0c\u5b58\u50a8\u5f53\u524dcamera\u4e0b\u7684<strong>\u6e32\u67d3\u6570\u636e<\/strong><\/td>\n<\/tr>\n<tr>\n<td>FSceneViewState<\/td>\n<td>\u5b58\u653e\u4e0a\u4e00\u5e27\u7684\u6e32\u67d3\u6570\u636e\u2014\u2014\u662f\u8fd9\u4e00\u5e27\u9700\u8981\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>FSceneRenderer<\/td>\n<td>\u6e32\u67d3\u5668\uff0c\u6e32\u67d3\u7ba1\u7ebf\u7684\u5404\u79cd\u6548\u679c\u90fd\u662f\u5728\u8fd9\u5b9e\u73b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53ef\u4ee5\u628a\u5b83\u4eec\u5206\u4e3aEngine\u90e8\u5206\u4e0eRenderer\u90e8\u5206\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>Engine<\/th>\n<th>Renderer<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>UWorld<\/td>\n<td>FScene<\/td>\n<\/tr>\n<tr>\n<td>UPrimitiveComponent<\/td>\n<td>FPrimitiveSceneInfo<\/td>\n<\/tr>\n<tr>\n<td>FPrimitiveSceneProxy<\/td>\n<td>FViewInfo<\/td>\n<\/tr>\n<tr>\n<td>FSceneView<\/td>\n<td>FSceneViewState<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>DrawList<\/h1>\n<p>\u5728UE4\u65f6\uff0cUE\u5927\u90e8\u5206\u65f6\u671f\u4f7f\u7528\u7684DrawList\u800c\u4e0d\u662fFMeshDrawCommand\uff0c\u5230\u540e\u9762UE\u624d\u5bf9\u7ba1\u7ebf\u8fdb\u884c\u4e86\u91cd\u6784\uff0c\u4ece<strong>DrawList<\/strong>\u8f6c\u5230\u4e86<strong>FMeshDrawCommand<\/strong>\uff0c\u5728\u6b63\u5f0f\u4e86\u89e3Mesh Drawing Pipeline\u4e4b\u524d\uff0c\u4f9d\u7136\u9700\u8981\u77e5\u6653\u4e3a\u4ec0\u4e48UE\u4f1a\u5f03\u7528DrawList\uff0c\u5b83\u6709\u4ec0\u4e48\u7f3a\u70b9<\/p>\n<h2>\u65e9\u671f\u7684\u6e32\u67d3\u6d41\u7a0b<\/h2>\n<p>\u5728UE\u4e2dGame Thread\u4e0eRender Thread\u662f\u5206\u5f00\u7684\uff0c\u4e00\u822cRender Thread\u4f1a\u6bd4Game Thread\u665a\u4e00\u5e27<\/p>\n<ul>\n<li>\u4e3a\u4e86\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff0c\u8fd9\u91cc\u4f1a\u5728\u6e32\u67d3\u7ebf\u7a0b\u4e2d\u4e3a\u6e38\u620f\u7ebf\u7a0b\u4e2d\u7684\u6240\u6709\u7269\u4ef6\u521b\u5efa\u4e00\u4efd\u6e32\u67d3\u6570\u636e\uff0c\u5373FPrimitiveSceneProxy<br \/>\n<img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c05066aa5b6be4f5c84b7.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c05066aa5b6be4f5c84b7.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u4f46\u5728\u6e32\u67d3\u65f6\u5e76\u4e0d\u4f1a\u76f4\u63a5\u4f7f\u7528FPrimitiveSceneProxy\uff0c\u800c\u662f<strong>FMeshBatch<\/strong>\uff0c\u4e3a\u4e86\u5c06\u6e32\u67d3\u6570\u636e\u8f6c\u6362\u6210\u6e32\u67d3\u65f6\u4f7f\u7528\u7684\u6570\u636e\uff0c\u5bf9\u4e8e\u52a8\u6001\/\u9759\u6001\u7269\u4ef6\uff0c\u53ef\u4ee5\u7528GetDynamicMeshElements()\/DrawStaticElements()\u6765\u5f97\u5230FMeshBatch<br \/>\n<img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c07756aa5b6be4f5cc24f.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c07756aa5b6be4f5cc24f.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>\u4ec0\u4e48\u662fFMeshBatch<\/li>\n<\/ul>\n<p>\u4e00\u79cd\u5c06FPrimitiveSceneProxy\u7684\u5b9e\u73b0\u4e0ePass\u89e3\u8026\u7684\u7ed3\u6784\uff0c\u8fd9\u4e2a\u7ed3\u6784\u5305\u542b\u6bcf\u4e2aPass\u6e32\u67d3\u6240\u9700\u8981\u7684\u6240\u6709\u6570\u636e\uff08Vertex Buffer\uff0cShaders\uff0cParameters\u7b49\uff09<br \/>\n<img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3be06aa5b6be4f5d8efd.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3be06aa5b6be4f5d8efd.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u62ff\u5230FMeshBatch\u540e\uff0c\u5c31\u9700\u8981\u8003\u8651\u5982\u4f55\u6e32\u67d3\u3002UE\u4f7f\u7528\u5230\u4e86DrawList\uff0c\u8fd9\u4e2a\u7ed3\u6784\u5305\u542b\u6240\u6709FMeshBatch\u3001FPrimitiveSceneProxy\u6570\u636e\uff1b\u6b64\u5916\u8fd8\u7528\u5230\u4e86DrawingPolicy\uff0c\u8fd9\u4e2a\u7ed3\u6784\u6db5\u76d6\u5982\u4f55\u6e32\u67d3\u67d0\u4e2aPass\uff08\u5982\u7ed1\u5b9aShader\uff09\u3002DrawingPolicy\u904d\u5386DrawList\u7684FMeshBatch\uff0c\u8f93\u51faRHI Command List<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3ec06aa5b6be4f5dd817.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3ec06aa5b6be4f5dd817.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>DrawingPolicy\u904d\u5386<\/li>\n<\/ul>\n<p>DrawingPolicy\u4f1a\u5148\u7ed1\u5b9a\u6e32\u67d3\u72b6\u6001\uff0c\u7136\u540e\u904d\u5386Material Chain\uff0c\u627e\u5230material instance\u7684\u6570\u636e<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c40c06aa5b6be4f5dd85c.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c40c06aa5b6be4f5dd85c.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u6700\u7ec8\u8c03\u7528Draw\u63a5\u53e3<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3f1b6aa5b6be4f5dd826.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c3f1b6aa5b6be4f5dd826.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<\/ul>\n<h2>DrawList\u7684\u7f3a\u70b9<\/h2>\n<ul>\n<li>\n<p>\u7f3a\u70b9<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c46ac6aa5b6be4f5dd9fc.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c46ac6aa5b6be4f5dd9fc.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>\u4f7f\u7528bit array\uff08\u4e8c\u8fdb\u5236\uff09\u8868\u793a\u7269\u4ef6\u53ef\u89c1\u6027\uff0cbitarray\u6db5\u76d6\u573a\u666f\u4e2d\u6240\u6709\u7269\u4f53\uff0c\u5bfc\u81f4\u5728\u90e8\u5206\u6e32\u67d3\u903b\u8f91\u4e2d\u65e0\u6cd5\u5feb\u901f\u627e\u5230\u89c6\u7ebf\u6700\u524d\u9762\u7684\u53ef\u89c1\u7269\u4f53\uff08\u56e0\u4e3a\u8fd9\u91cc\u4ec5\u4ec5\u6839\u636e\u4e8c\u8fdb\u5236\u8868\u793a\u573a\u666f\u4e2d\u6240\u6709\u7269\u4f53\u7684\u53ef\u89c1\u6027\uff0c\u5e76\u4e0d\u6db5\u76d6\u7a7a\u95f4\u4fe1\u606f\uff0c\u4e0d\u77e5\u9053\u8c01\u5728\u524d\u8c01\u5728\u540e\uff09<\/p>\n<\/li>\n<li>\n<p>\u65e0\u6cd5\u5b9e\u73b0\u9759\u6001\u7269\u4ef6\u8ddf\u52a8\u6001\u7269\u4ef6\u7684Draw Sorting\uff0c\u5bfc\u81f4\u6027\u80fd\u63d0\u5347\u4e0d\u80fd\u66f4\u8fdb\u4e00\u6b65<\/p>\n<\/li>\n<\/ul>\n<p>\u56e0\u4e3a\u65e9\u671f\u4f7f\u7528<strong>TStaticMeshDrawList<\/strong>\u5b58\u50a8\u9759\u6001\u7269\u4ef6\uff0c\u8fd9\u662f\u4e00\u4e2a<strong>\u6c38\u4e45\u7f13\u5b58<\/strong>\u7684\u6570\u636e\u7ed3\u6784\uff1b\u800c\u52a8\u6001\u7269\u4ef6\u662f<strong>\u6bcf\u5e27\u4e34\u65f6\u751f\u6210<\/strong><\/p>\n<p>\u8fd9\u5c31\u5bfc\u81f4\u5728Draw\u65f6\uff0cGPU\u4e0d\u5f97\u4e0d\u5148\u753b\u9759\u6001\u7269\u4f53\uff0c\u518d\u753b\u52a8\u6001\u7269\u4ef6\u3002\u5982\u679c\u8fd9\u4e9b\u7269\u4f53\u5c31\u4e00\u79cd\u6750\u8d28\u5176\u5b9e\u8fd8\u597d\uff0c\u4f46\u4e00\u822c\u90fd\u5b58\u5728\u5f88\u591a\u4e0d\u540c\u7684\u6750\u8d28\uff0c\u5bfc\u81f4GPU\u9700\u8981\u5148\u753b\u5b8c\u4e00\u79cd\u6750\u8d28\u5207\u5230\u4e0b\u4e00\u79cd\u6750\u8d28\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u5207\u6362\u5f00\u9500\u51e0\u4e4e\u662f2N<\/p>\n<p>\u53e6\u5916\u4e00\u70b9\uff0c\u5c31\u662fOverdraw\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u9759\u6001\u7269\u4f53\u548c\u52a8\u6001\u7269\u4f53\u5148\u524d\u8c01\u540e<\/p>\n<ul>\n<li>DrawList<strong>\u4ee5Shader Permutation\uff08\u53d8\u4f53\uff09\u4e3a\u6a21\u677f\u53c2\u6570<\/strong>\u521b\u5efa\uff0c\u5bfc\u81f4\u5b58\u5728\u5927\u91cf\u7684\u4e0d\u540c\u79cd\u7c7b\u7684DrawList\uff0c\u4f7f\u5f97\u4ee3\u7801\u5f88\u4e11\u5f88\u96be\u7ef4\u62a4<\/p>\n<\/li>\n<li>\n<p>\u53ea\u6709\u5355\u4e2a\u786c\u7f16\u7801\u7684Frequency\u6570\u636e\u53ef\u4ee5\u7528\u6765\u5b8c\u6210State Sharing\uff0c\u8fd9\u4e5f\u5c31\u610f\u5473\u7740\uff0c\u6211\u4eec\u53ea\u80fd\u901a\u8fc7\u786c\u7f16\u7801\u6765\u5b9e\u73b0instancing<\/p>\n<\/li>\n<li>\n<p>Frequency\u6570\u636e\uff1a\u65e9\u671fconstant buffer\u90fd\u662f\u6309\u4f7f\u7528\u7528\u9014\u5206\u7c7b\uff08Per-View\u3001 Per-Pass\u3001Per-Material\u3001Per-Object\uff09\uff0c\u4e14\u4e0a\u4f20\u9891\u7387\u5404\u4e0d\u76f8\u540c<\/p>\n<\/li>\n<li>\n<p>State Sharing<\/p>\n<p>\u8981\u5b9e\u73b0Instance\uff0c\u65e9\u671f\u9700\u8981\u4e13\u95e8\u4e3a\u67d0\u79cd\u7269\u4f53\u5b9a\u5236shader\uff0c\u5c06Per-Object\u91cc\u585e\u5165instance\u9700\u8981\u7684\u6570\u636e\u3002\u5982\u679c\u53ea\u5236\u5b9a\u4e00\u79cd\u7269\u4f53\u8fd8\u597d\uff0c\u4f46\u82e5\u79cd\u7c7b\u975e\u5e38\u591a\uff0c\u9700\u8981\u4e0d\u65ad\u5b9a\u5236\uff0c\u5f88\u7e41\u7410<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u4e24\u70b9\uff0c1\u662f\u6027\u80fd\u95ee\u9898\uff0c2\u662f\u4ee3\u7801\u53c8\u81ed\u53c8\u957f<\/p>\n<h1>Mesh Drawing Pipeline<\/h1>\n<p>\u4e3a\u4e86\u907f\u514dDrawList\u5e26\u6765\u7684\u95ee\u9898\uff0cUE\u5bf9\u6e32\u67d3\u6d41\u7a0b\u505a\u4e86\u4fee\u6539\uff0c\u4e3b\u8981\u79fb\u9664\u4e86DrawingPolicy\u3001DrawList<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4cfc6aa5b6be4f5e26cf.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4cfc6aa5b6be4f5e26cf.png\" alt=\"\" \/><\/p><\/noscript>\n<p>\u88ab\u5220\u9664\u7684\u90e8\u5206\u4f7f\u7528FMeshDrawCommand\u4ee3\u66ff\uff0c\u5e76\u65b0\u589eFMeshPassProcessor\u3001SubmitMeshDrawCommands\u4e0eFMeshBatch\u4e0eRHICommandList\u8fde\u63a5<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4e256aa5b6be4f5e2740.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4e256aa5b6be4f5e2740.png\" alt=\"\" \/><\/p><\/noscript>\n<h2>\u4ec0\u4e48\u662fFMeshDrawCommand<\/h2>\n<p>\u4e0b\u56fe\u662fFMeshDrawCommand\u7684\u5b9a\u4e49\uff0c\u6709\u4e09\u4e2a\u7279\u70b9\uff1a<\/p>\n<ul>\n<li><strong>stanalone<\/strong>\uff1a\u4e0eFMeshMeshBatch\u76f8\u6bd4\uff0cFMeshDrawCommand\u66f4\u52a0\u5e72\u51c0\uff0c\u5e76\u6ca1\u6709\u6307\u9488\u5bf9\u8c61\uff0c\u662fstanalone\n<p>\u4e0d\u9700\u8981\u901a\u8fc7\u6307\u9488\u5bf9\u8c61\u83b7\u53d6\u6570\u636e\uff0c\u76f4\u63a5\u5b58\u50a8\u5728FMeshDrawCommand<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0d\u4f9d\u8d56Context<\/strong>\uff1a\u5728\u65e7\u7684\u6d41\u7a0b\u4e2d\uff0c\u9700\u8981\u6839\u636ePass\u6267\u884c\u5206\u652f\u5224\u65ad\uff0c\u8bbe\u5b9a\u5149\u6805\u5316\u8bbe\u7f6e\u3001\u6df1\u5ea6\u6d4b\u8bd5\u7b49\uff0c\u6bd4\u8f83\u8017\u65f6\uff1b\u4f46\u5728\u65b0\u7684\u6d41\u7a0b\u4e2d\uff0c\u5728\u542f\u52a8\u524d\u5c06\u8fd9\u4e9b\u63d0\u524d\u6253\u5305\u7f16\u8bd1\u4e3a\u4e00\u4e2a\u4e0d\u53ef\u53d8\u7684\u5bf9\u8c61\u2014\u2014PSO<\/p>\n<\/li>\n<li>\n<p><strong>Data-Oriented<\/strong>\uff1a\u5728\u65e7\u7684\u6d41\u7a0b\u4e2d\uff0cFMeshBatch\u77e5\u9053\u81ea\u5df1\u5f52\u5c5e\u54ea\u4e2a\u5bf9\u8c61\u3002\u4f46\u5728\u65b0\u7684\u6d41\u7a0b\u4e2d\uff0cFMeshDrawCommand\u5e76\u4e0d\u81ea\u5df1\u81ea\u5df1\u7684\u5f52\u5c5e\uff0c\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4e00\u4e32\u53ea\u5305\u542b\u5e95\u5c42\u6e32\u67d3\u53c2\u6570\u7684\u7eaf\u6570\u636e\u5757<\/p>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u5bf9\u6240\u6709\u7269\u4f53\u6392\u5e8f<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4ea06aa5b6be4f5e2772.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c4ea06aa5b6be4f5e2772.png\" alt=\"\" \/><\/p><\/noscript>\n<h2>Mesh Drawing Pipeline\u7684\u4f18\u70b9<\/h2>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c55de6aa5b6be4f5e2a27.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c55de6aa5b6be4f5e2a27.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li><strong>Cached Mesh Draw Commands<\/strong>\n<p>FMeshDrawCommand\u4e0ePass\u7262\u7262\u7ed1\u5b9a\uff0c\u4e14FMeshDrawCommand\u5b58\u50a8\u7684\u6570\u636e\u90fd\u662f\u4e0d\u7528\u6bcf\u5e27\u66f4\u65b0\uff0c\u5728\u6700\u5f00\u59cb\u5c31\u53ef\u4ee5\u786e\u5b9a\u7684\u3002\u56e0\u6b64\u7269\u4f53\u5728\u88ab\u5bfc\u5165Level\u65f6()\uff0c\u53ea\u9700\u8981\u8ba1\u7b97\u4e00\u6b21FMeshDrawCommand\uff0c\u540e\u7eed\u65e0\u9700\u518d\u8ba1\u7b97\uff0c\u5e76\u6c38\u4e45\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p><strong>\u66f4\u7a33\u5b9a\u7684Draw Call Merging<\/strong><\/p>\n<p>\u5728\u65e9\u671f\u7ba1\u7ebf\u4e2d\uff0cMaterialInstance\u80fd\u5426\u5408\u5e76\uff0c\u53d6\u51b3\u4e8e\u4e24\u4e2a\u7269\u4f53\u7684Material Instance\u662f\u5426\u662f\u540c\u4e00\u5bf9\u8c61(\u5730\u5740)\uff0c\u5373\u4f7f\u6750\u8d28\u4fe1\u606f\u5b8c\u5168\u76f8\u540c\uff1b\u800c\u5728\u65b0\u7684\u7ba1\u7ebf\uff0c\u80fd\u5426\u5408\u5e76\u4ec5\u4ec5\u53d6\u51b3\u4e8e<strong>FMeshDrawCommand\u7684\u8d44\u6e90\u7ed1\u5b9a\u662f\u5426\u76f8\u540c<\/strong><\/p>\n<\/li>\n<\/ul>\n<h2>MeshPassProcessor<\/h2>\n<p>\u4ece\u4e0a\u56fe\u770b\u51fa\uff0cUE\u4f7f\u7528FMeshPassProcessor\u6765\u751f\u6210FMeshDrawCommand\uff0c\u8fd9\u91cc\u5177\u4f53\u8bb2\u4e00\u4e0b\u662f\u5982\u4f55\u751f\u6210\u7684<\/p>\n<ul>\n<li>FMeshPassProcessor\u51b3\u5b9aPass\u4f7f\u7528\u7684shader\uff0c\u4ee5\u53cashader bindings\u2014\u2014pass\u3001vertex factory\u3001material\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c60d76aa5b6be4f5e7c4b.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c60d76aa5b6be4f5e7c4b.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>AddMeshBatch()<br \/>\n\u53ef\u4ee5\u770b\u5230\u51fd\u6570\u5b9e\u73b0\u4e0d\u518d\u662f\u57fa\u4e8e\u6a21\u677f<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c61526aa5b6be4f5e7c75.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c61526aa5b6be4f5e7c75.png\" alt=\"\" \/><\/p><\/noscript>\n<p>Pass Filter\u5224\u65ad\u5f53\u524d\u7269\u4f53\u662f\u5426\u9700\u8981\u5f53\u524dPass\u6e32\u67d3<br \/>\nSelect Shader\u9009\u62e9\u9700\u8981\u7528\u5230\u7684Shader<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c61fb6aa5b6be4f5e7ca2.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c61fb6aa5b6be4f5e7ca2.png\" alt=\"\" \/><\/p><\/noscript>\n<p>Process()\uff1a\u5b8c\u6210Shader Bindings\uff0c\u5e76\u6784\u5efaDrawCommand<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c62cd6aa5b6be4f5e7cda.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c62cd6aa5b6be4f5e7cda.png\" alt=\"\" \/><\/p><\/noscript>\n<p>BuildMeshDrawCommands()\uff1a<strong>\u65e0\u9700\u8ba2\u5236\uff0c\u591aPass\u5171\u7528<\/strong><\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c646f6aa5b6be4f5e7d5a.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c646f6aa5b6be4f5e7d5a.png\" alt=\"\" \/><\/p><\/noscript>\n<p>Shader Binding\uff1a\u4e0d\u518d\u76f4\u63a5\u7ed1\u5b9a\u5230RHICommandList\uff0c\u800c\u662f\u7ed1\u5b9a\u5728MeshDrawSingleShaderBindings\u7ed3\u6784\u4f53<br \/>\n<img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c65a16aa5b6be4f5e7db5.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1c65a16aa5b6be4f5e7db5.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<\/ul>\n<h2>DrawCommands\u6392\u5e8f<\/h2>\n<p>\u7531\u4e8eStatic\/Dynamic\u90fd\u4f7f\u7528\u7edf\u4e00\u7684DrawCommands\uff0c\u56e0\u6b64\u53ef\u4ee5\u5c06\u4e24\u8005\u4e00\u8d77\u6392\u5e8f<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d8ae5b3f09b19e9d1ef3e.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d8ae5b3f09b19e9d1ef3e.png\" alt=\"\" \/><\/p><\/noscript>\n<p>\u5728\u65b0\u7684\u7ba1\u7ebf\u4e2d\uff0c\u6211\u4eec\u5c06\u62ff\u5230\u4e00\u4e2a\u5bf9\u5e94\u4e8e\u53ef\u89c1\u7269\u4ef6\u7684\u7269\u4ef6\u6570\u7ec4\uff0c\u800c\u975e\u8001\u7ba1\u7ebf\u4e2d\u7684\u6574\u4e2a\u573a\u666f\u4e2d\u6240\u6709\u7269\u4ef6<\/p>\n<p>\u8fd9\u91cc\u53ef\u80fd\u4e0d\u597d\u7406\u89e3\uff0c\u5176\u5b9e\u5728\u8001\u7ba1\u7ebf\u4e0b\uff0c\u6570\u636e\u662f\u88ab\u6253\u6563\u7684\u2014\u2014\u9759\u6001\u7269\u4f53\u5728\u4e00\u4e2a\u5168\u5c40\u7684 DrawList\uff0c\u52a8\u6001\u7269\u4f53\u5b58\u5728\u6bcf\u4e00\u5e27\u4e34\u65f6\u751f\u6210\u7684\u51e0\u4e2a\u5c0f\u6570\u7ec4\uff0c\u534a\u900f\u660e\u7269\u4f53\u53ef\u80fd\u53c8\u5728\u53e6\u4e00\u4e2a\u5217\u8868\uff0c\u800c\u4e14\u8fd8\u5305\u62ec\u4e86\u7269\u7406\u4e0a\u4e0d\u53ef\u89c1\u7684\u7269\u4f53\uff1b\u4f46\u5728\u65b0\u7ba1\u7ebf\uff0c\u4f1a\u5148\u5728InitView()\u505a\u5254\u9664\uff0c\u5f15\u64ce\u4f1a\u63d0\u53d6\u53ef\u89c1\u7269\u4f53\u7684FMeshDrawCommand\uff0c\u5c06\u4ed6\u4eec\u585e\u5165\u6570\u7ec4\uff0c\u5bf9\u5b83\u4eec\u4e00\u89c6\u540c\u4ec1<\/p>\n<h2>Submit<\/h2>\n<p>\u6392\u5e8f\u5b8c\u6210\u540e\uff0c\u5c31\u53ef\u4ee5Submit\u4e86<br \/>\n<img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d8f69b3f09b19e9d1f333.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d8f69b3f09b19e9d1f333.png\" alt=\"\" \/><\/p><\/noscript>\n<p>\u7531\u4e8e\u65b0\u7ba1\u7ebfFMeshDrawCommand\u662f\u5df2\u7ecf\u786e\u5b9a\u7684\u4e14\u6570\u636e\u72ec\u7acb\uff0c\u4e14\u662f\u6570\u7ec4\u7ed3\u6784\u53ef\u4ee5\u77e5\u6653\u6574\u4f53\u6570\u91cf\uff0c\u56e0\u6b64\u65b0\u7ba1\u7ebf\u4e0bSubmitMeshDrawCommands()\u662f\u53ef\u4ee5\u5e76\u884c\u7684<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d92fab3f09b19e9d22bcf.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d92fab3f09b19e9d22bcf.png\" alt=\"\" \/><\/p><\/noscript>\n<h2>FMeshDrawCommand\u7684\u7f13\u5b58<\/h2>\n<h3>\u4e3a\u4ec0\u4e48\u9700\u8981\u7f13\u5b58FMeshDrawCommand<\/h3>\n<ul>\n<li>\u7531\u4e8eWorld\u7684\u7edd\u5927\u90e8\u5206\u7269\u4f53\u90fd\u662fStatic\u7684\uff0c\u56e0\u6b64\u4e00\u6b21DrawCommand\u751f\u6210\uff0c\u591a\u6b21\u4f7f\u7528\u662f\u6ca1\u6709\u95ee\u9898\u7684\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d952eb3f09b19e9d22ccf.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d952eb3f09b19e9d22ccf.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u7531\u4e8e\u91cd\u65b0\u7ed1\u5b9a\u5f00\u9500\u5f88\u9ad8\uff0cDrawCommand\u5fc5\u987b\u6ee1\u8db3\u53d8\u5316\u9891\u7387\u5f88\u4f4e\u8fd9\u4e00\u7279\u6027\uff0c\u4e3a\u4e86\u5f25\u8865\u8fd9\u4e00\u7279\u6027\uff0c\u53ef\u4ee5\u91c7\u7528Uniform Buffer\u5b58\u50a8\u6570\u636e\uff0c\u800c\u4e0d\u5b58\u50a8\u5728DrawCommand<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9691b3f09b19e9d22d8f.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9691b3f09b19e9d22d8f.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<\/ul>\n<h3>\u5982\u4f55\u7f13\u5b58<\/h3>\n<ul>\n<li>\n<p>\u6ca1\u5fc5\u8981\u6bcf\u5e27\u90fd\u521b\u5efaUniform Buffer\uff0c\u53ea\u6709\u5f53Uniform Buffer\u5185\u90e8\u6570\u636e\u6709\u53d8\u5316\uff0c\u624d\u521b\u5efa<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9741b3f09b19e9d22e17.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9741b3f09b19e9d22e17.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d97fcb3f09b19e9d22eb0.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d97fcb3f09b19e9d22eb0.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>\u5f53AddMeshBatch()\u7684\u5f15\u7528\u5bf9\u8c61\u4e0eShader Bindings\u6709\u6240\u53d8\u5316\uff0c\u9700\u8981\u6807\u8bb0FMeshDrawCommand\u4e3aInvalidated\uff0c\u8ba9CPU\u91cd\u65b0build\u4e00\u4e2aFMeshDrawCommand\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9923b3f09b19e9d22fed.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9923b3f09b19e9d22fed.png\" alt=\"\" \/><\/p><\/noscript>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d99dcb3f09b19e9d230c9.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d99dcb3f09b19e9d230c9.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u5982\u4f55\u68c0\u6d4b\u662f\u5426\u9057\u6f0fInvalidated\u6807\u8bb0\u5462\uff1f\u53ef\u4ee5\u7528\u5230\u5f15\u64ce\u81ea\u5e26\u7684\u5b8fVALIDATE_UNIFORM_BUFFER_LIFETIME<br \/>\nVALIDATE_UNIFORM_BUFFER_LIFETIME\u9ed8\u8ba4\u4e3a0\uff0c\u8981\u542f\u7528\u68c0\u6d4b\u4e3a1<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9b24b3f09b19e9d23247.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9b24b3f09b19e9d23247.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u4e0d\u540c\u7c7b\u578b\u7684\u7269\u4f53\u6709\u4e0d\u540c\u7684\u66f4\u65b0\u65b9\u5f0f<\/p>\n<ul>\n<li>\u52a8\u6001\u7269\u4f53\uff1aMeshBatch -> DrawCommand -> CommandList\u90fd\u662f\u6bcf\u5e27\u66f4\u65b0<\/p>\n<\/li>\n<li>\n<p>\u9700\u8981SceneView\u7684\u9759\u6001\u7269\u4f53\uff1a\u53ef\u4ee5\u7f13\u5b58MeshBatch\uff0c\u4f46\u9700\u6bcf\u5e27\u66f4\u65b0 DrawCommand -> CommandList<\/p>\n<\/li>\n<\/ul>\n<p>\u56e0\u4e3ashader bindings\u6709\u53d8\u5316<\/p>\n<ul>\n<li>\u4e0d\u9700\u8981SceneView\u7684\u9759\u6001\u7269\u4f53\uff1a\u53ef\u4ee5\u7f13\u5b58MeshBatch\u3001DrawCommand \uff0c\u9700\u6bcf\u5e27\u66f4\u65b0CommandList<\/li>\n<\/ul>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9d82b3f09b19e9d234eb.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9d82b3f09b19e9d234eb.png\" alt=\"\" \/><\/p><\/noscript>\n<\/li>\n<li>\n<p>\u6765\u770b\u4e00\u4e2a\u4f8b\u5b50<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9e99b3f09b19e9d27098.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1d9e99b3f09b19e9d27098.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>\u52a0\u8f7d\u65f6(AddToScene)\uff0c\u8ba1\u7b97 <code>MeshBatch<\/code> \u5e76\u5b58\u5165 <code>FPrimitiveSceneInfo<\/code>\u3002\u5728\u6e32\u67d3\u65f6\uff0c\u4ea4\u7531 <code>MeshPassProcessor<\/code> \u6839\u636e\u5f53\u524d\u7684 <code>SceneView<\/code>\uff0c\u751f\u6210\u8fd9\u4e00\u5e27\u7684 <code>DrawCommand<\/code><\/li>\n<li>\u5f53\u5929\u5149\u91cd\u8bbe\u65f6\uff0c\u9700\u8981\u5c06\u5df2\u7f13\u5b58\u7684DrawCommands\u7684\u6709\u6548\u72b6\u6001\u91cd\u7f6e\u4e3a\u65e0\u6548<\/li>\n<li>\u6267\u884cInitViews()\uff08\u6bcf\u5e27\uff09\u65f6\uff0c\u9700\u8981\u904d\u5386\u6bcf\u4e2aPrimitive\uff0c\u5982\u679c\u662f\u9759\u6001\u7684\uff0c\u8ba1\u7b97LOD\uff0c\u5e76\u5c06\u6b64LOD\u5bf9\u5e94\u7684DrawCommand\u6dfb\u52a0\u5230visible set\uff1b\u5982\u679c\u662f\u52a8\u6001\u7684\uff0c\u5c31\u9700\u8981\u5b8c\u6210MeshBatch\u7684\u91cd\u5efa<\/li>\n<li>RenderDepth\u8c03\u7528visible set\u4e2d\u7684\u6bcf\u4e2aMesh DrawCommand\u5b8c\u6210\u7ed8\u5236<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u5982\u4f55\u5408\u5e76<\/h3>\n<p>DrawCommands\u5f88\u5bb9\u6613\u5c31\u80fd\u5b9e\u73b0Dynamic Instancing\uff0c\u56e0\u4e3aDrawCommands\u4e0d\u5305\u542b\u4e0a\u5c42\u4ee3\u7801\uff0c\u5341\u5206\u81ea\u7acb\uff0c\u6240\u4ee5\u53ea\u9700\u7b80\u5355\u5730\u6bd4\u5bf9\u5c31\u80fd\u5224\u65adDrawCommands\u662f\u5426\u80fd\u591f\u5408\u5e76<\/p>\n<p>\u66f4\u91cd\u8981\u7684\u662f\uff0c\u8fd9\u79cd\u5408\u5e76\u903b\u8f91\u4e0d\u9700\u8981\u7f8e\u672f\u505a\u989d\u5916\u7684\u8bbe\u7f6e\uff0c\u5b8c\u5168\u81ea\u52a8<\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1da223b3f09b19e9d27273.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1da223b3f09b19e9d27273.png\" alt=\"\" \/><\/p><\/noscript>\n<p>\u4f46\u662f\uff0c\u4e5f\u4e0d\u80fd\u6bcf\u5e27\u90fd\u5408\u5e76\uff0c\u56e0\u6b64UE\u57fa\u4e8e\u4e0d\u540c\u7684Render States\u751f\u6210\u591a\u4e2abucket\uff0c\u628a<strong>\u7f13\u5b58\u7684DrawCommand\u7684\u6e32\u67d3\u72b6\u6001<\/strong>\u585e\u5165\u5bf9\u5e94bucket\uff0c\u5728\u4f7f\u7528\u65f6\u53ef\u4ee5\u5feb\u901f\u67e5\u627e\uff0c\u5c06\u72b6\u6001\u6bd4\u8f83\u964d\u7ef4\u6253\u51fb\u4e3aID\u6bd4\u8f83<br \/>\n\u540e\u7eed\u8fd8\u4f1a\u5bf9\u5c4f\u5e55\u4e0a\u53ef\u89c1\u7684DrawCommand \u6536\u96c6\u5728\u4e00\u4e2a\u6570\u7ec4\uff0c\u5e76\u6839\u636eDrawCommand\u7684StateBucketId\u6392\u5e8f\u3002\u987a\u7740\u6570\u7ec4\u626b\uff0c\u53ea\u8981\u76f8\u90bb\u7684 ID \u4e00\u6837\uff0c\u8ba1\u6570\u5668\u5c31 +1\uff1b\u4e00\u65e6 ID \u53d8\u4e86\uff0c\u76f4\u63a5\u6253\u65ad\uff0c\u53d1\u8d77<code>DrawIndexedInstanced<\/code><\/p>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1da2b4b3f09b19e9d272ac.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1da2b4b3f09b19e9d272ac.png\" alt=\"\" \/><\/p><\/noscript>\n<p><img decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/pic1.imgdb.cn\/item\/6a1daaabb3f09b19e9d27a4e.png\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  alt=\"\" \/><\/p >\n<noscript><img decoding=\"async\" src=\"https:\/\/pic1.imgdb.cn\/item\/6a1daaabb3f09b19e9d27a4e.png\" alt=\"\" \/><\/p><\/noscript>\n<h1>\u5982\u4f55\u5feb\u901f\u5206\u6790Pass<\/h1>\n<p>\u5206\u6790Pass\u5927\u81f4\u5206\u4e3a\u56db\u4e2a\u6b65\u9aa4<\/p>\n<h2>\u770bPass\u4f4d\u7f6e<\/h2>\n<ul>\n<li>\u76ee\u7684\uff1a\u9700\u8981\u5148\u786e\u5b9a\u8fd9\u4e2aPass\u5927\u81f4<strong>\u5728\u6e32\u67d3\u7ba1\u7ebf\u54ea\u4e2a\u4f4d\u7f6e<\/strong>\uff0c\u6bd4\u5982PrePass\u662f\u5728Base Pass\u4e4b\u524d\u8fd8\u662f\u4e4b\u540e<\/p>\n<\/li>\n<li>\n<p>\u627e\u4ec0\u4e48\uff1aGraphBuilder.AddPass<\/p>\n<\/li>\n<\/ul>\n<h2>\u770bConstant Buffer<\/h2>\n<ul>\n<li>\u76ee\u7684\uff1a\u67e5\u627e\u5f53\u524dPass <strong>\u4ecec++\u7aef\u4f20\u7ed9GPU\u7aef\u7684\u53d8\u91cf\u3001\u8d34\u56fe\u3001Sampler<\/strong><\/li>\n<li>\u627e\u4ec0\u4e48\uff1a\u5728cpp\u7aef\u67e5\u627e<strong>BEGIN_SHADER_PARAMETER_STRUCT<\/strong><\/li>\n<\/ul>\n<h2>\u627e\u6e32\u67d3\u72b6\u6001\u7ed1\u5b9a<\/h2>\n<ul>\n<li>\n<p>\u76ee\u7684\uff1a\u67e5\u627ecpp<strong>\u5982\u4f55\u8bbe\u7f6ePSO\u3001Blend\u3001Depth\u3001Stencil\u3001Shader\u53d8\u4f53<\/strong><\/p>\n<\/li>\n<li>\n<p>\u627e\u4ec0\u4e48\uff1a\u627e\u5f53\u524dpass\u7684FMeshPassProcessor\uff0c\u91cd\u70b9\u770b\u5176\u4e2d\u7684Process()\u3001AddMeshBatch()<\/p>\n<p>\u4f46\u5728UE5.7\uff0c\u7b14\u8005\u6d4b\u8bd5\u7684UE\u5927\u5e45\u5229\u7528\u5230\u4e86\u5e76\u884c\u7279\u6027\uff0c\u5728InitViews()\u9636\u6bb5\u5c31\u8ba1\u7b97\u597dFMeshDrawCommand\uff0c\u800c\u4e0d\u662f\u4e32\u884c\u4e00\u4e2a\u4e00\u4e2apass AddMeshBatch()\uff0c\u76f4\u63a5\u88c5\u8fdbParallelMeshDrawCommandPasses\uff0c\u56e0\u6b64\u6bcf\u4e2aPass\u4e0d\u4f1a\u518dAddMeshBatch()\uff0c\u6211\u4eec\u53ea\u9700\u8981\u770bProcess()<\/p>\n<\/li>\n<\/ul>\n<h2>\u627eShader\u7ed1\u5b9a<\/h2>\n<ul>\n<li>\n<p>\u76ee\u7684\uff1a\u67e5\u627e\u8fd9\u4e2aPass\u5177\u4f53\u662f\u600e\u4e48\u8ba1\u7b97\u7684\uff0c\u7528\u7684\u4ec0\u4e48\u7b97\u6cd5<\/p>\n<\/li>\n<li>\n<p>\u627e\u4ec0\u4e48\uff1acpp\u7aef\u67e5\u627e<strong>IMPLEMENT_MATERIAL_SHADER_TYPE<\/strong><\/p>\n<\/li>\n<li>\n<p>IMPLEMENT_MATERIAL_SHADER_TYPE<\/p>\n<ul>\n<li>\u5b9a\u4e49<\/li>\n<\/ul>\n<pre><code class=\"line-numbers\">#define IMPLEMENT_MATERIAL_SHADER_TYPE(TemplatePrefix,ShaderClass,SourceFilename,FunctionName,Frequency) \\\n    IMPLEMENT_SHADER_TYPE( \\\n        TemplatePrefix, \\\n        ShaderClass, \\\n        SourceFilename, \\\n        FunctionName, \\\n        Frequency \\\n        );\n<\/code><\/pre>\n<ul>\n<li>TemplatePrefix\uff1a\u5982\u679cShader class\u662ftemplate class\uff0c\u5219\u586b\u5199\u6a21\u677f\u524d\u7f00\u3002\u666e\u901aclass\u5219\u4e0d\u5199\uff0c\u6216\u8005\u5199template&lt;><\/li>\n<li>ShaderClass\uff1a\u7ee7\u627f\u81ea <code>FMaterSialShader<\/code> \u7684\u7c7b\u540d\u2014\u2014\u5373Pass Class<\/li>\n<li>SourceFilename\uff1a.usf shader \u6587\u4ef6\u8def\u5f84<\/li>\n<li>FunctionName\uff1a\u5165\u53e3\u51fd\u6570<\/li>\n<li>Frequency\uff1ashader\u7c7b\u578b\u2014\u2014VS\u3001PS\u3001CS<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>Reference<\/h1>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/zhuanlan.zhihu.com\/p\/678885337\" target=\"_blank\"  rel=\"nofollow\" >\u865a\u5e7b\u5f15\u64ce\u7684Mesh Drawing Pipeline<\/a><br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/epicgames.ent.box.com\/s\/qhy66rf44mbbor33rpm05b3xf83wpvim\" target=\"_blank\"  rel=\"nofollow\" >Refactoring the Mesh Drawing Pipeline for Unreal Engine 4.22<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u7b14\u8005\u6700\u8fd1\u5728\u5206\u6790UE5\u7ba1\u7ebf\uff0c\u53d1\u73b0cpp\u7aef\u5e38\u91cf\u7f13\u51b2\u533a\u7684\u7ed1\u5b9a\u3001\u6e32\u67d3\u72b6\u6001\u7684\u7ed1\u5b9a\u770b\u8d77\u6765\u5f88\u6298\u78e8\uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48UE5\u4f1a\u8fd9\u6837\u505a\uff0c\u4e3a\u4ec0\u4e48\u4e0eDX &#8230;<\/p>","protected":false},"author":1,"featured_media":449,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/481"}],"collection":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=481"}],"version-history":[{"count":4,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":486,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/481\/revisions\/486"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/media\/449"}],"wp:attachment":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}