{"id":1028,"date":"2025-07-29T02:10:51","date_gmt":"2025-07-28T18:10:51","guid":{"rendered":"http:\/\/meecarlo.com\/?p=1028"},"modified":"2025-07-29T02:11:33","modified_gmt":"2025-07-28T18:11:33","slug":"unity%e4%b8%ad%e7%9a%84%e7%a7%bb%e5%8a%a8%e5%b9%b3%e5%8f%b0rvt%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/meecarlo.com\/old\/2025\/07\/29\/unity%e4%b8%ad%e7%9a%84%e7%a7%bb%e5%8a%a8%e5%b9%b3%e5%8f%b0rvt%e5%ae%9e%e7%8e%b0\/","title":{"rendered":"Unity\u4e2d\u7684\u79fb\u52a8\u5e73\u53f0RVT\u5b9e\u73b0"},"content":{"rendered":"\n<p><strong>\u8c01\u5728\u7528Runtime Virtual Texture\u8fd9\u4e2a\u6280\u672f<\/strong><\/p>\n\n\n\n<p>\u00b7 UBI\u57282016\u5e74\u516c\u5e03\u4e86\u5728Far Cry 4\u4e2d\u4f7f\u7528\u7684<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=188769741&amp;content_type=Article&amp;match_order=1&amp;q=Adaptive+Virtual+Texture&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">Adaptive Virtual Texture<\/a>\u5176\u4e2d\u5c31\u5305\u542bRuntime virtual texture.<\/p>\n\n\n\n<p>\u00b7UE\u57284.25\u7248\u672c\u53d1\u5e03\u4e86Runtime Virtual Texture<\/p>\n\n\n\n<p>\u00b7\u9e45\u5382\u5927\u4f6c\u516c\u5e03\u5929\u6daf\u660e\u6708\u5200\u4e2d\u4f7f\u7528\u4e86Runtime Virtual Texture\uff0c\u8868\u793a2\u5c42\u4ee5\u4e0a\u7684\u6df7\u5408\u5c31\u80fd\u8868\u73b0\u51fa\u660e\u663e\u7684\u6027\u80fd\u4f18\u52bf<br><\/p>\n\n\n\n<p><strong>\u4e3a\u4ec0\u4e48\u9700\u8981Runtime Virtual Texture<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f60\u8981\u505a\u4efb\u4f55\u7684\u5927\u578b\u7684\u666f\u89c2\uff0c\u5c31\u7ed5\u4e0d\u5f00\u4f7f\u7528<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=188769741&amp;content_type=Article&amp;match_order=1&amp;q=Unity+Terrain&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">Unity Terrain<\/a>\/&nbsp;<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=188769741&amp;content_type=Article&amp;match_order=1&amp;q=UE4+Landscape&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">UE4 Landscape<\/a>\u8fd9\u6837\u7684\u591a\u5c42\u6df7\u5408\u6750\u8d28\u5de8\u578b\u52a8\u6001Mesh\u3002<br><\/li>\n\n\n\n<li>\u4ece\u65e9\u5e74\u7684world machine\u5230\u73b0\u5728\u6d41\u884c\u7684<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=188769741&amp;content_type=Article&amp;match_order=1&amp;q=Houdini&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">Houdini<\/a>\u5728\u5730\u5f62\u5236\u4f5c\u8fd9\u4e2a\u90e8\u5206\u90fd\u5728\u75af\u72c2\u5730\u4e30\u5bcc\u4e00\u4e2a\u4e1c\u897f&#8212;\u56fe\u5c42\uff0c8\u5c42\uff0c\u582a\u582a\u591f\u7528\u800c\u5df2\u3002<\/li>\n<\/ul>\n\n\n\n<p>8\u5c42\u5728\u5341\u5e74\u524d\u4f60\u53ef\u4ee5\u8ba4\u4e3a\u662f8\u5f20\u989c\u8272\u8d34\u56fe\u52a0\u4e24\u5f20\u63a7\u5236\u56fe\u7684\u6df7\u5408\uff0c\u5341\u5f20\uff0c\u597d\u50cf\u662f\u6709\u70b9\u591a\uff0c\u4f46\u662f\u73b0\u5728\u662fPBR\u7684\u65f6\u4ee3,\u4ee5Unity\u7684Terrain\u6750\u8d28\u4e3a\u4f8b8\u5c42\u610f\u5473\u7740<\/p>\n\n\n\n<p>\uff081 Albeto + 1 Normal + 1 Detail[AO R + Metal G + Roughness A]\uff09* 8 + 2 Control Map =&nbsp;<strong>26\u6b21\u8d34\u56fe\u91c7\u6837<\/strong><\/p>\n\n\n\n<p>\u5373\u6bcf\u4e2a\u50cf\u7d20\uff0c\u6bcf\u5e27\u90fd\u4f1a\u670926\u6b21\u8d34\u56fe\u91c7\u6837\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48Unity\u5b98\u65b9\u63a8\u8350\u79fb\u52a8\u5e73\u53f0\u4e0d\u8981\u8d85\u8fc74\u5c42\u7684\u539f\u56e0\u3002\u4f60\u4ee5\u4e3a4\u5c42\u5c31\u6ca1\u4e8b\u4e86\u5417\uff1f\u8fd9\u4e2a\u6807\u51c6\u53ea\u80fd\u4fdd\u8bc1\u4e2d\u7aef\u8bbe\u5907\u80fd\u8dd130\u5e27\u4e14\u70eb\u4e0d\u70eb\u5b8c\u5168\u4e0dcare\u3002<\/p>\n\n\n\n<p><strong>\u539f\u7406<\/strong><\/p>\n\n\n\n<p>Runtime Virtual Texture\u505a\u7684\u4e8b\u60c5\u975e\u5e38\u7b80\u5355\uff0c\u628aTerrain Mesh\u5206\u5757\uff0c\u628a\u6bcf\u5757\u768426\u5f20\u8d34\u56fe\u5408\u5e76\u62102\u5f20render target\uff0c\u8fd9\u6837\u6211\u4eec\u6e32\u67d3\u7684\u65f6\u5019\u4e0d\u7ba1\u6709\u591a\u5c11\u56fe\u5c42\u5230\u4e86\u6e32\u67d3\u7684\u65f6\u5019\u90fd\u53ea\u67092\u4e2a\u8d34\u56fe\u91c7\u6837\uff0c\u4f46\u662f\u663e\u5b58\u5fc5\u7136\u662f\u6709\u66f4\u5927\u7684\u5f00\u9500\u7684\uff0c\u7a7a\u95f4\u6362\u65f6\u95f4\u4e0d\u591a\u5e9f\u8bdd\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u5fc5\u987b\u63d0\u51fa\u6765\u4e00\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u6211\u4eec\u5b8c\u5168\u7528\u9759\u6001\u8d44\u6e90\uff0c\u6211\u4eec\u7684\u8d44\u6e90\u5230\u5e95\u6709\u591a\u5927\uff1f\u4ee5git\u5de5\u7a0b\u7684\u793a\u4f8b\u573a\u666f\u4e3a\u4f8b\uff0c\u4e00\u4e2a\u4f20\u7edf\u7684RPG\u89c6\u89d2\uff0c\u6211\u4eec\u7684LOD 0\u6700\u5c0f\u5207\u5272\u52308m * 8m\uff0c\u8fd9\u6837\u7684\u4e00\u5757\u5728\u89c6\u89d2\u5185\u8981\u6ee1\u8db32k\u5206\u8fa8\u7387\uff0c\u9700\u8981\u81f3\u5c111024\u5206\u8fa8\u7387\u7684\u8d34\u56fe\uff0c\u5f53\u7136\u6d4b\u8bd5\u4e0b\u6765512\u4e5f\u662f\u53ef\u4ee5\u5fcd\u7684\u3002\u5bf9\u4e8e\u4e00\u5757512\u7684Terrain\uff0c\u6211\u4eec\u7684\u8d34\u56fe\u9700\u6c42\u662f 4096\u59571024\u8d34\u56fe\uff08albeto + normal + detail\uff09\uff0c\u8fd9\u4e2a\u8d44\u6e90\u91cf\uff0c\u518d\u52a0\u4e0amipmap\u7684\u5f00\u9500<\/p>\n\n\n\n<p><strong>\u4e00\u3001RVT\u6838\u5fc3\u539f\u7406<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u865a\u62df\u7eb9\u7406\u673a\u5236<\/strong><\/li>\n<\/ul>\n\n\n\n<p>RVT\u901a\u8fc7\u903b\u8f91\u4e0a\u7684\u65e0\u9650\u5927\u7eb9\u7406\u52a8\u6001\u52a0\u8f7d\u5c40\u90e8\u6240\u9700\u7eb9\u7406\uff0c\u7c7b\u4f3c\u5185\u5b58\u5206\u9875\u7ba1\u7406\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Feedback\u9636\u6bb5<\/strong>\uff1a\u4f4e\u5206\u8fa8\u7387\u6e32\u67d3\u83b7\u53d6\u5f53\u524d\u89c6\u91ce\u6240\u9700\u7eb9\u7406\u7684mipmap\u7b49\u7ea7\u548c\u4f4d\u7f6e\u4fe1\u606f\uff08RGB\u5b58\u50a8\u683c\u5b50\u5750\u6807\u4e0emip\u7b49\u7ea7\uff09<\/li>\n\n\n\n<li><strong>PageTable\u7ba1\u7406<\/strong>\uff1a\u7ef4\u62a4\u52a8\u6001\u66f4\u65b0\u7684\u9875\u8868\uff0c\u8bb0\u5f55\u7eb9\u7406\u52a0\u8f7d\u72b6\u6001\u548c\u7269\u7406\u5b58\u50a8\u4f4d\u7f6e\uff08LRU\u7b97\u6cd5\u4f18\u5316Tile\u590d\u7528\uff09<\/li>\n\n\n\n<li><strong>TileTexture\u70d8\u7119<\/strong>\uff1a\u901a\u8fc7MRT\uff08\u591a\u6e32\u67d3\u76ee\u6807\uff09\u5b9e\u65f6\u70d8\u7119Diffuse\u3001\u6cd5\u7ebf\u7b49\u6570\u636e\u5230\u7269\u7406\u8d34\u56fe\u96c6<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u79fb\u52a8\u7aef\u7b80\u5316\u65b9\u6848<\/strong><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u56db\u53c9\u6811\u52a8\u6001\u5206\u5757<\/strong>\uff1a\u6839\u636e\u76f8\u673a\u8ddd\u79bb\u5212\u5206\u5730\u5f62\u533a\u5757\uff0c\u6bcf\u5757\u5206\u914d\u76f8\u540c\u5c3a\u5bf8\u8d34\u56fe\uff0c\u7528<code>Texture2DArray<\/code>\u5b58\u50a8\uff08\u7d22\u5f15\u5373\u6570\u7ec4\u4e0b\u6807\uff09\uff0c\u907f\u514d\u4f20\u7edfRVT\u7684\u590d\u6742\u7a7a\u95f4\u7ba1\u7406<\/li>\n\n\n\n<li><strong>\u5206\u5e27\u52a0\u8f7d<\/strong>\uff1a\u9650\u5236\u6bcf\u5e27\u7ec6\u5206\/\u5408\u5e76\u64cd\u4f5c\u6b21\u6570\uff08\u5982\u6bcf\u5e27\u6700\u5927\u7ec6\u52064\u6b21\uff09\uff0c\u907f\u514d\u5361\u987f<\/li>\n<\/ol>\n\n\n\n<p><strong>\u4e8c\u3001\u5173\u952e\u5b9e\u73b0\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u56db\u53c9\u6811\u52a8\u6001LOD\u7ba1\u7406<\/strong><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6570\u636e\u7ed3\u6784<\/strong>\uff1a\u8282\u70b9\u8bb0\u5f55\u5750\u6807(x,z)\u3001\u5c3a\u5bf8(size)\u3001\u7269\u7406\u8d34\u56fe\u7d22\u5f15(physicTexIndex)\u53ca\u7236\u5b50\u8282\u70b9\u5f15\u7528\u3002<\/li>\n\n\n\n<li><strong>\u5408\u5e76\u4e0e\u7ec6\u5206<\/strong>\uff1a<strong>\u5408\u5e76<\/strong>\uff1a\u5f53\u8282\u70b9\u8fdc\u79bb\u76f8\u673a\u65f6\uff0c\u56de\u6536\u5b50\u8282\u70b9\u8d34\u56fe\u7d22\u5f15\uff0c\u7528\u7236\u8282\u70b9\u4f4e\u7cbe\u5ea6\u8d34\u56fe\u8986\u76d6\u3002<strong>\u7ec6\u5206<\/strong>\uff1a\u9760\u8fd1\u76f8\u673a\u65f6\u5206\u88c2\u4e3a4\u4e2a\u5b50\u8282\u70b9\uff0c\u5206\u914d\u65b0\u7d22\u5f15\u52a0\u8f7d\u9ad8\u7cbe\u5ea6\u8d34\u56fe\u3002<\/li>\n\n\n\n<li><strong>\u5e27\u66f4\u65b0\u4f18\u5316<\/strong>\uff1a\u6bcf\u5e27\u904d\u5386\u53f6\u8282\u70b9\u961f\u5217\uff0c\u6309LOD\u53d8\u5316\u51b3\u7b56\u5408\u5e76\/\u7ec6\u5206\uff0c\u4ea4\u6362\u53cc\u961f\u5217\u907f\u514dGC<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7269\u7406\u8d34\u56fe\u751f\u6210<\/strong><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Blit\u66ff\u4ee3\u76f8\u673a\u6e32\u67d3<\/strong>\uff1a\u907f\u514d\u4f20\u7edf\u76f8\u673a\u6e32\u67d3\u5730\u5f62Mesh\u7684\u5f00\u9500\uff0c\u76f4\u63a5\u901a\u8fc7Shader\u4e00\u6b21\u6027\u91c7\u6837\u6240\u6709\u5730\u8868\u7eb9\u7406\uff08\u598216\u5c42\uff09\u8f93\u51fa\u5230<code>Texture2DArray<\/code><\/li>\n\n\n\n<li><strong>\u7d22\u5f15\u8d34\u56fe\u6620\u5c04<\/strong>\uff1a\u6839\u636e\u5730\u5f62UV\u751f\u6210\u7d22\u5f15\u8d34\u56fe\uff0c\u5b58\u50a8\u8282\u70b9\u8d77\u59cb\u5750\u6807\u3001\u5c3a\u5bf8\u3001\u8d34\u56fe\u6570\u7ec4\u7d22\u5f15\uff0cShader\u91c7\u6837\u65f6\u76f4\u63a5\u8ba1\u7b97\u5b9e\u9645UV<\/li>\n<\/ol>\n\n\n\n<p><strong>\u4e09\u3001\u79fb\u52a8\u7aef\u4e13\u9879\u4f18\u5316<\/strong><\/p>\n\n\n\n<p>1\u3001<strong>\u7eb9\u7406\u4e0e\u5185\u5b58\u7ba1\u7406<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>AlphaMap\u5206\u7ec4<\/strong>\uff1a\u6bcf4\u79cd\u7eb9\u7406\u5171\u7528\u4e00\u5f20AlphaMap\uff0c\u51cf\u5c11\u8d34\u56fe\u5207\u6362\uff08\u598212\u79cd\u7eb9\u7406\u97003\u5f20\u56fe\uff09<\/li>\n\n\n\n<li><strong>\u5f02\u6b65\u52a0\u8f7d<\/strong>\uff1a\u901a\u8fc7<code>AsyncGPUReadback<\/code>\u5f02\u6b65\u56de\u8bfbFeedback\u6570\u636e\uff0c\u5ef6\u8fdf\u4e00\u5e27\u4f7f\u7528\u907f\u514d\u963b\u585e<\/li>\n<\/ul>\n\n\n\n<p>2\u3001<strong>\u6d77\u6d0b\u4e3b\u9898\u9002\u914d<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5c9b\u5c7f\u72ec\u7acb\u8282\u70b9<\/strong>\uff1a\u5c06\u5c9b\u5c7f\u62bd\u8c61\u4e3a\u72ec\u7acb\u56db\u53c9\u6811\u8282\u70b9\uff0c\u652f\u6301\u968f\u673a\u5206\u5e03\u4e0e\u7d27\u5bc6\u6570\u636e\u6392\u5217<\/li>\n\n\n\n<li><strong>\u68cb\u76d8\u683c\u70d8\u7119<\/strong>\uff1a\u4ee5512\u00d7512\u7c73\u4e3a\u5355\u4f4d\u70d8\u7119\u5730\u5f62\u6570\u636e\uff0c\u9002\u914d\u822a\u6d77\u7c7b\u5927\u4e16\u754c<\/li>\n<\/ul>\n\n\n\n<p><strong>\u56db\u3001\u5de5\u7a0b\u5b9e\u8df5\u5efa\u8bae<\/strong><\/p>\n\n\n\n<p>1\u3001<strong>\u5f00\u53d1\u7ba1\u7ebf\u96c6\u6210<\/strong><\/p>\n\n\n\n<p><strong>Houdini\u6d41\u7a0b<\/strong>\uff1a\u7528Houdini\u751f\u6210\u5730\u5f62\/\u9053\u8def\/\u6865\u6881\uff0c\u5bfc\u51faUnity\u540e\u901a\u8fc7HLOD System\u9884\u5904\u7406\uff08\u51cf\u9762+\u5408\u6279\uff09\uff0c\u51cf\u5c1170%+ DrawCall<\/p>\n\n\n\n<p><strong>\u5149\u7167\u65b9\u6848<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fd1\u8ddd\u79bb\uff1a\u7ea7\u8054\u9634\u5f71\uff08CSM\uff09<\/li>\n\n\n\n<li>\u8fdc\u8ddd\u79bb\uff1a\u4f53\u7d20\u5316\u9634\u5f71\uff08VSM\uff09+ LightProbe\u6d41\u5f0f\u52a0\u8f7d<\/li>\n<\/ul>\n\n\n\n<p>2\u3001<strong>\u8c03\u5f0f\u5de5\u5177<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53ef\u89c6\u5316Feedback\u8d34\u56fe\u4e0ePageTable\u72b6\u6001\uff0c\u5b9e\u65f6\u76d1\u63a7Tile\u52a0\u8f7d\u60c5\u51b5<\/li>\n\n\n\n<li>\u8d1f\u53cd\u9988\u6027\u80fd\u8c03\u8282\u7cfb\u7edf\uff1a\u52a8\u6001\u9650\u5236\u9ad8\u8d1f\u8f7d\u64cd\u4f5c\uff08\u5982\u5206\u5e27\u7ec6\u5206\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u5176\u5b9e\u5427RVT\u7684\u6838\u5fc3\u67b6\u6784\u4e00\u5f20\u56fe\u5c31\u80fd\u8bf4\u6e05\u695a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"179\" src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/image.png\" alt=\"\" class=\"wp-image-1029\" srcset=\"https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image.png 719w, https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-300x75.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/figure>\n\n\n\n<p>\u4e0e\u4f20\u7edf\u7684\u8d34\u56fe\u65b9\u6848\u5bf9\u6bd4\u4f18\u52bf<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"734\" src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/image-2.png\" alt=\"\" class=\"wp-image-1031\" srcset=\"https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-2.png 708w, https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-2-289x300.png 289w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p>\u4f18\u52bf\u573a\u666f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8d85\u5927\u89c4\u6a21\u5730\u5f62<\/strong>\uff08\u5982\u98de\u884c\u6a21\u62df\u4e2d\u7684\u5168\u7403\u5730\u8868\uff09<\/li>\n\n\n\n<li><strong>\u7a0b\u5e8f\u5316\u751f\u6210\u4e16\u754c<\/strong>\uff08\u65e0\u9650\u5730\u5f62\u52a8\u6001\u70d8\u7119\uff09<\/li>\n\n\n\n<li><strong>\u9ad8\u6e05\u6750\u8d28\u7edf\u4e00\u7ba1\u7406<\/strong>\uff08\u907f\u514d\u91cd\u590d\u8d44\u6e90\uff09<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1440\" style=\"aspect-ratio: 2560 \/ 1440;\" width=\"2560\" controls src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/2025-07-28-23-52-16.mp4\"><\/video><\/figure>\n\n\n\n<p>\u4e0b\u9762\u6211\u4e00\u6b65\u4e00\u6b65\u4ece\u524d\u5f80\u540e\u68b3\u7406\u6574\u4e2a\u8fc7\u7a0b\uff0c\u4ee5\u53ca\u5728Unity\u7684\u5b9e\u73b0\u6280\u672f\u7ec6\u8282\u3002<\/p>\n\n\n\n<p><strong>\u683c\u5b50<\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u4f1a\u6839\u636e\u53ef\u89c6\u8303\u56f4\u628a\u8303\u56f4\u5185\u7684\u6240\u6709\u5730\u5757\u5212\u5206\u6210\u683c\u5b50\uff0c\u683c\u5b50\u8d8a\u5c0f\uff0c\u5206\u5230\u56fa\u5b9a\u5206\u8fa8\u7387\u5927\u5c0f\u7684\u8d34\u56fe\u6e05\u6670\u5ea6\u5c31\u8d8a\u9ad8\uff0c\u5f53\u7136\u6027\u80fd\u4e5f\u5c31\u8d8a\u5dee\u3002UE\u662f\u56fa\u5b9a\u683c\u5b50\uff0c\u76f4\u63a5\u662f\u4ee5\u5730\u5f62\u4e3a\u5355\u4f4d\u5212\u5206\u7684\u3002\u4f46\u662f\u5bf9\u4e8e\u4e00\u4e2a\u8d85\u5927\u4e16\u754c\u6765\u8bb2\uff0c\u8fd9\u4e2a\u8303\u56f4\u662f\u53d8\u5316\u7684\uff0c\u6240\u4ee5\u683c\u5b50\u4e5f\u662f\u52a8\u6001\u53d8\u5316\u7684\u3002\u8fd9\u91cc\u53ea\u4ea4\u5f85\u4e00\u4e2a\u6982\u5ff5\uff0c\u540e\u9762\u5728\u5404\u4e2a\u90e8\u5206\u7684\u65f6\u5019\u518d\u8be6\u7ec6\u8bb2\u3002<\/p>\n\n\n\n<p><strong>FeedBack<\/strong><\/p>\n\n\n\n<p>feedback\u6709\u70b9\u7c7b\u4f3c\u4e8e\u906e\u6321\u5254\u9664\uff0c\u4f1a\u9884\u5148\u70d8\u4e00\u4e2a\u4f4e\u5206\u8fa8\u7387\u7684\u8d34\u56fe\u4fe1\u606f\uff0crgb\u5206\u522b\u8868\u793a\u683c\u5b50\u5750\u6807\uff0cmipmap\u7b49\u7ea7\u3002\u683c\u5b50\u5750\u6807\u901a\u8fc7\u4e16\u754c\u5750\u6807\u5728\u53ef\u89c6\u533a\u57df\uff0c\u4ee5\u53ca\u683c\u5b50\u7684\u5927\u5c0f\u8fd9\u4e9b\u53c2\u6570\u5c31\u80fd\u7b97\u51fa\u6765\u3002mipmap\u7b49\u7ea7\u5219\u662f\u901a\u8fc7\u504f\u5bfc\u6c42\u51fa\u6765\u7684\u3002<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\n\nfeed_v2f VTVertFeedback(feed_attr v)\n{\n    feed_v2f o;\n    UNITY_SETUP_INSTANCE_ID(v);\n    \n#if defined(UNITY_INSTANCING_ENABLED)\n    float2 patchVertex = v.vertex.xy;\n    float4 instanceData = UNITY_ACCESS_INSTANCED_PROP(Terrain, _TerrainPatchInstanceData);\n\n    float2 sampleCoords = (patchVertex.xy + instanceData.xy) * instanceData.z; \/\/ (xy + float2(xBase,yBase)) * skipScale\n    float height = UnpackHeightmap(_TerrainHeightmapTexture.Load(int3(sampleCoords, 0)));\n\n    v.vertex.xz = sampleCoords * _TerrainHeightmapScale.xz;\n    v.vertex.y = height * _TerrainHeightmapScale.y;\n    \n    v.texcoord = sampleCoords * _TerrainHeightmapRecipSize.zw;\n#endif\n    \n    VertexPositionInputs Attributes = GetVertexPositionInputs(v.vertex.xyz);\n    \n    o.pos = Attributes.positionCS;\n    float2 posWS = Attributes.positionWS.xz;\n    o.uv = (posWS - _VTRealRect.xy) \/ _VTRealRect.zw;\n    \n    return o;\n}\n\nfloat4 VTFragFeedback(feed_v2f i) : SV_Target\n{\n\tfloat2 page = floor(i.uv * _VTFeedbackParam.x);\n\n\tfloat2 uv = i.uv * _VTFeedbackParam.y;\n\tfloat2 dx = ddx(uv);\n\tfloat2 dy = ddy(uv);\n\tint mip = clamp(int(0.5 * log2(max(dot(dx, dx), dot(dy, dy))) + 0.5 + _VTFeedbackParam.w), 0, _VTFeedbackParam.z);\n\n\treturn float4(page \/ 255.0, mip \/ 255.0, 1);\n}\n<\/pre>\n\n\n<p>\u5728unity urp\u914d\u7f6e\u6e32\u67d3\u7ba1\u7ebf\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u4e00\u4e2arenderdata\uff0c\u914d\u7f6e\u597d\u53c2\u6570<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"751\" src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/image-3.png\" alt=\"\" class=\"wp-image-1035\" srcset=\"https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-3.png 651w, https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-3-260x300.png 260w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u5728\u5730\u5f62\u91cc\u8fb9\u6dfb\u52a0\u4e00\u4e2afeedback\u7684pass<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"210\" src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/image-4.png\" alt=\"\" class=\"wp-image-1036\" srcset=\"https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-4.png 655w, https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-4-300x96.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\u5728feedback\u76f8\u673a\u4e0a\u9009\u62e9\u8fd9\u4e2arender<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"556\" src=\"http:\/\/meecarlo.com\/wp-content\/uploads\/2025\/07\/image-5.png\" alt=\"\" class=\"wp-image-1037\" srcset=\"https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-5.png 641w, https:\/\/meecarlo.com\/old\/wp-content\/uploads\/2025\/07\/image-5-300x260.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/figure>\n\n\n\n<p>feedback\u7684\u76f8\u673a\u8981\u4fdd\u8bc1\u8ddf\u573a\u666f\u76f8\u673a\u53c2\u6570\u4e00\u6837\uff0c\u53ef\u4ee5\u5199\u4e2a\u811a\u672c\u590d\u5236\u53c2\u6570\uff0c\u7136\u540e\u628a\u8fd9\u4e2a\u76f8\u673a\u6302\u5728\u573a\u666f\u76f8\u673a\uff0ctransform\u5f52\u96f6\u5c31ok\u4e86\u3002\u8fd9\u91cc\u6211\u628acamera\u7684enable\u53bb\u6389\u4e86\uff0c\u6211\u81ea\u5df1\u6765\u8c03\u7528render\uff0c\u56e0\u4e3a\u8fd9\u91cc\u53ef\u4ee5\u81ea\u5df1\u63a7\u5236\u66f4\u65b0\u9891\u7387\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6e32\u67d3\u7684\u65f6\u5019\u5206\u8fa8\u7387\u964d\u4f4e\u4e00\u534a\uff0c\u5982\u679c\u89c9\u5f97\u8fd8\u4e0d\u591f\u53ef\u4ee5\u518d\u964d\u4e00\u4e9b\uff0c\u8fd9\u91cc\u4e3a\u5565\u4e0d\u4e00\u5f00\u59cb\u5c31\u7528\u4f4e\u5206\u8fa8\u7387\u5462\uff0c\u662f\u56e0\u4e3a\uff0c\u5148\u4ee5\u4e00\u4e2a\u5dee\u4e0d\u591a\u7684\u5206\u8fa8\u7387\u7cbe\u5ea6\u6bd4\u8f83\u9ad8\uff0c\u518d\u964d\u662f\u53d6\u6700\u5927\u7684mipmap\u7b49\u7ea7\uff0c\u8fd9\u6837\u4f1a\u4fdd\u8bc1\u6b63\u786e\u6027\u3002<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nfloat4 GetMaxFeedback(float2 uv, int count)\n{\n\tfloat4 col = float4(1, 1, 1, 1);\n\tfor (int y = 0; y &lt; count; y++)\n\t{\n\t\tfor (int x = 0; x &lt; count; x++)\n\t\t{\n\t\t\tfloat4 col1 = tex2D(_MainTex, uv + float2(_MainTex_TexelSize.x * x, _MainTex_TexelSize.y * y));\n\t\t\tcol = lerp(col, col1, step(col1.b, col.b));\n\t\t}\n\t}\n\treturn col;\n}\n\n<\/pre>\n\n\n<p>\u8fd9\u91cc\u4e4b\u6240\u4ee5\u5bf9\u5206\u8fa8\u7387\u8981\u6c42\u8fd9\u4e48\u9ad8\uff0c\u662f\u56e0\u4e3a\u6211\u4eec\u9700\u8981\u628a\u8d34\u56fe\u6570\u636e\u4ecerendertarget\u91cc\u53d6\u51fa\u5230cpu\u6765\u8bfb\u53d6\u6570\u636e\u3002<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ \u53d1\u8d77\u5f02\u6b65\u56de\u8bfb\u8bf7\u6c42\nm_ReadbackRequest = AsyncGPUReadback.Request(texture);\n<\/pre>\n\n\n<p>\u8fd9\u662f\u4e00\u4e2a\u5f02\u6b65\u8bf7\u6c42\uff0c\u6211\u4eec\u53ef\u80fd\u6709\u4e00\u4e2a\u5ef6\u8fdf\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e00\u822c\u662f\u8fd9\u4e00\u5e27\u4f7f\u7528\u7684\u662f\u4e0a\u4e00\u5e27\u7684feedback<\/p>\n\n\n\n<p><strong>PageTable<\/strong><\/p>\n\n\n\n<p>\u9875\u8868\u662f\u4e00\u4e2amipmap\u5c42\u7ea7\u7ed3\u6784\u7684\u8868\uff0c\u6bd4\u5982\u8bf4\u6211\u4eec\u7684\u683c\u5b50\u662f\u4e00\u4e2a256&#215;256\u7684\u77e9\u9635\uff0c\u90a3\u4e48mipmap\u4e3a0\u7684\u7b49\u7ea7\u5c31\u662f256&#215;256\u7684cell\uff0cmipmap\u4e3a1\u7684\u5c31\u662f128&#215;128\u7684cell\uff0c\u4f9d\u6b21\u7c7b\u63a8\u3002cell\u7684\u4e0a\u9762\u9664\u4e86\u5b58\u653emipmap\u7b49\u7ea7\uff0c\u5360\u636e\u7684rect\uff0c\u8fd8\u6709page\u7684\u52a0\u8f7d\u60c5\u51b5\u3002<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npublic class TableNodeCell\n{\n        public RectInt Rect { get; set; }\n\n        public PagePayload Payload { get; set; }\n\n        public int MipLevel { get; }\n\n        public TableNodeCell(int x, int y, int width, int height,int mip)\n        {\n            Rect = new RectInt(x, y, width, height);\n            MipLevel = mip;\n            Payload = new PagePayload();\n        }\n}\n\n\n<\/pre>\n\n\n<p>\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f\u6211\u4eec\u8fd9\u7684pagetable\u662f\u4e2a\u53ef\u53d8\u5316\u7684\uff0c\u9488\u5bf9\u79fb\u52a8\u662f\u8c03\u6574\u540e\u9762\u5355\u72ec\u62ce\u51fa\u6765\u8bf4\u3002<\/p>\n\n\n\n<p>\u4e0a\u9762feedback\u5904\u7406\u5b8c\u5f97\u5230\u4e00\u5f20feedback\u7684\u8d34\u56fe\uff0c\u4e0a\u9762\u5404\u4e2a\u50cf\u7d20\u8868\u793a\u9700\u8981\u663e\u793a\u7684cell\u4ee5\u53camipmap\u7b49\u7ea7\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u4fe1\u606f\uff0c\u53bb\u89e6\u53d1\u52a0\u8f7dTileTexture\u3002<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/\/ &lt;summary&gt;\n\/\/\/ \u6fc0\u6d3b\u9875\u8868\n\/\/\/ &lt;\/summary&gt;\nprivate TableNodeCell ActivatePage(int x, int y, int mip)\n{\n            if (mip &gt; MaxMipLevel || mip &lt; 0 || x &lt; 0 || y &lt; 0 || x &gt;= TableSize || y &gt;= TableSize)\n                return null;\n            \/\/ \u627e\u5230\u5f53\u524d\u9875\u8868\n            var page = m_PageTable[mip].Get(x, y);\n            if(page == null)\n            {\n                return null;\n            }\n            if(!page.Payload.IsReady)\n            {\n                LoadPage(x, y, page);\n\n                \/\/\u5411\u4e0a\u627e\u5230\u6700\u8fd1\u7684\u7236\u8282\u70b9\n                while(mip &lt; MaxMipLevel &amp;amp;&amp;amp; !page.Payload.IsReady)\n                {\n                    mip++;\n                    page = m_PageTable[mip].Get(x, y);\n                }\n            }\n\n            if (page.Payload.IsReady)\n            {\n                \/\/ \u6fc0\u6d3b\u5bf9\u5e94\u7684\u5e73\u94fa\u8d34\u56fe\u5757\n                m_TileTexture.SetActive(page.Payload.TileIndex);\n                page.Payload.ActiveFrame = Time.frameCount;\n                return page;\n            }\n\n            return null;\n}\n\/\/\/ &lt;summary&gt;\n\/\/\/ \u52a0\u8f7d\u9875\u8868\n\/\/\/ &lt;\/summary&gt;\nprivate void LoadPage(int x, int y, TableNodeCell node)\n{\n   if (node == null)\n     return;\n\n   \/\/ \u6b63\u5728\u52a0\u8f7d\u4e2d,\u4e0d\u9700\u8981\u91cd\u590d\u8bf7\u6c42\n   if(node.Payload.LoadRequest != null)\n       return;\n\n   \/\/ \u65b0\u5efa\u52a0\u8f7d\u8bf7\u6c42\n   node.Payload.LoadRequest = m_RenderTextureJob.Request(x, y, node.MipLevel);\n}\n<\/pre>\n\n\n<p><strong>TileTexture<\/strong><\/p>\n\n\n\n<p>tileTexture\u4f1a\u8bbe\u7f6etile\u7684size\uff0c\u6bcf\u4e2asize\u7684\u5206\u8fa8\u7387\u5927\u5c0f\uff0c\u4ee5\u53capadding\u50cf\u7d20<\/p>\n\n\n\n<p>\u5728\u8fd9\u91cc\u6211\u4eec\u6709\u4e00\u4e2a\u6e32\u67d3\u961f\u5217\uff0c\u7531\u4e8e\u540c\u4e00\u5e27\u53ef\u80fd\u8bf7\u6c42\u6bd4\u8f83\u591a\uff0c\u6211\u4eec\u53ef\u4ee5\u4ecemipmap\u7b49\u7ea7\u9ad8\u5230\u5e95\u6392\u5e8f\uff0c\u7136\u540e\u63a7\u5236\u6bcf\u5e27\u6e32\u67d3\u6570\u91cf\u6765\u8fdb\u884c\u3002<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic void Update()\n{\n            if (m_PendingRequests.Count &lt;= 0)\n                return;\n\n            \/\/ \u4f18\u5148\u5904\u7406mipmap\u7b49\u7ea7\u9ad8\u7684\u8bf7\u6c42\n            m_PendingRequests.Sort((x, y) =&gt; { return x.MipLevel.CompareTo(y.MipLevel); });\n\n            int count = m_Limit;\n            while (count &gt; 0 &amp;amp;&amp;amp; m_PendingRequests.Count &gt; 0)\n            {\n                count--;\n                \/\/ \u5c06\u7b2c\u4e00\u4e2a\u8bf7\u6c42\u4ece\u7b49\u5f85\u961f\u5217\u79fb\u5230\u8fd0\u884c\u961f\u5217\n                var req = m_PendingRequests[m_PendingRequests.Count - 1];\n                m_PendingRequests.RemoveAt(m_PendingRequests.Count - 1);\n\n                \/\/ \u5f00\u59cb\u6e32\u67d3\n                StartRenderJob?.Invoke(req);\n            }\n}\n<\/pre>\n\n\n<p>\u5728\u5904\u7406\u4e00\u4e2a\u5177\u4f53\u7684tile\u65f6\uff0c\u7531\u4e8e\u6211\u4eec\u9700\u8981\u70d8\u7119diffuse\uff0cnormal\uff0cMask\uff08\u6682\u65f6\u6ca1\u5904\u7406\uff09\uff0c\u6211\u4eec\u8fd9\u91cc\u4f7f\u7528\u7684MRT\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u5c31\u8f6c\u5316\u5230\u8981\u628apage\u4e0a\u7684\u67d0\u4e2arect\uff0c\u753b\u5230TileTexture\u7684\u67d0\u4e2atile\u4e0a\u4e86\uff0c\u8fd9\u91cc\u8fd8\u5f97\u8003\u8651padding\u8fd9\u4e9b\uff0c\u6d89\u53ca\u5230\u975e\u5e38\u7e41\u7410\u7684tileoffset\u7684\u8ba1\u7b97\uff0c\u8fd9\u91cc\u82b1\u4e86\u6211\u4e0d\u5c11\u65f6\u95f4\u3002\u9664\u4e86\u6e32\u67d3\u5730\u5f62\uff0c\u4ee5\u540e\u5982\u679c\u6709\u4e9b\u9700\u8981\u8d34\u5230\u5730\u5f62\u4e0a\u7684\u8d34\u82b1\u4e5f\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u8fdb\u884c\u3002<\/p>\n\n\n\n<p>drawtexture\u7684shader\u4e5f\u5c31\u662f\u5e38\u89c4\u7684blend\u6df7\u5408\uff0c\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5bf9\u4e8e\u5730\u5f62\u8d85\u51fa\u56db\u5c42\u7684\u60c5\u51b5\uff0c\u7b2c\u4e00\u4e2a\u56db\u5c42\u6b63\u5e38\u6e32\u67d3\uff0c\u7b2c\u4e8c\u4e2a\u56db\u5c42\u4ee5\u53ca\u540e\u9762\u7684\u8d34\u82b1\u53ef\u4ee5\u91c7\u7528Blend One One\u7684\u5f62\u5f0f<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nPixelOutput frag(v2f_drawTex i) : SV_Target\n{\n    float4 blend = tex2D(_Blend, i.uv * _BlendTile.xy + _BlendTile.zw);\n    \n#ifdef TERRAIN_SPLAT_ADDPASS\n    clip(blend.x + blend.y + blend.z + blend.w &lt;= 0.005h ? -1.0h : 1.0h);\n#endif\n    \n    float2 transUv = i.uv * _TileOffset1.xy + _TileOffset1.zw;\n    float4 Diffuse1 = tex2D(_Diffuse1, transUv);\n    float4 Normal1 = tex2D(_Normal1, transUv);\n    transUv = i.uv * _TileOffset2.xy + _TileOffset2.zw;\n    float4 Diffuse2 = tex2D(_Diffuse2, transUv);\n    float4 Normal2 = tex2D(_Normal2, transUv);\n    transUv = i.uv * _TileOffset3.xy + _TileOffset3.zw;\n    float4 Diffuse3 = tex2D(_Diffuse3, transUv);\n    float4 Normal3 = tex2D(_Normal3, transUv);\n    transUv = i.uv * _TileOffset4.xy + _TileOffset4.zw;\n    float4 Diffuse4 = tex2D(_Diffuse4, transUv);\n    float4 Normal4 = tex2D(_Normal4, transUv);\n\n    PixelOutput o;\n    o.col0 = blend.r * Diffuse1 + blend.g * Diffuse2 + blend.b * Diffuse3 + blend.a * Diffuse4;\n    o.col1 = blend.r * Normal1 + blend.g * Normal2 + blend.b * Normal3 + blend.a * Normal4;\n    return o;\n}\n<\/pre>\n\n\n<p><em>\uff08\u8fd9\u91cc\u6ce8\u610f\u91c7\u6837\u7eb9\u7406\u4e00\u5b9a\u8981\u81ea\u5df1\u6307\u5b9amipmap\u7b49\u7ea7\u4e3a0\uff0c\u4e0d\u7136\u663e\u5361\u4f1a\u964dmipmap\u7b49\u7ea7\u5bfc\u81f4\u53d8\u6a21\u7cca\uff0c\u8fd9\u4e5f\u662f\u6211\u540e\u9762\u53d1\u73b0\u7684\uff0c\u6587\u7ae0\u548cdemo\u90fd\u6ca1\u4fee\u6539\uff09<\/em><\/p>\n\n\n\n<p>\u753b\u5b8c\u540e\u5c31\u8981\u901a\u77e5pagetable\u6211\u52a0\u8f7d\u5b8c\u6bd5\uff0c\u5e76\u4e14\u66f4\u65b0cell\u4e0a\u7684\u52a0\u8f7d\u4fe1\u606f\u3002<\/p>\n\n\n\n<p><strong>LookUp<br><\/strong>\u5728pagetable\u6bcf\u5e27\u66f4\u65b0\u4e2d\uff0c\u4f1a\u5c06TileTexture\u5404\u4e2aTile\u6fc0\u6d3b\u4e0b\u7684\u6570\u636e\u5199\u5165lookup\u8d34\u56fe\uff0c\u8fd9\u4e2alookup\u7684\u5c3a\u5bf8\u8ddfpagetable\u7684cell\u683c\u5b50\u6570\u4e00\u6837\u5927\u5c0f\uff0crgb\u5206\u522b\u8868\u793a\uff0ccell\u5750\u6807\uff0cmipmap\u7b49\u7ea7\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u8981\u6ce8\u610f\u51e0\u4e2a\u5730\u65b9\uff0c\u7b2c\u4e00\uff0cActive\u7684page\u53ea\u9700\u53d6\u5b58\u5728feedback\u4e0a\u7684activepage\uff0c\u800c\u4e0d\u9700\u53d6\u6574\u4e2aTileTexture\u4e0a\u7684\u3002\u7b2c\u4e8c\uff0cactive\u7684page\u53ef\u80fd\u4f1a\u6709\u91cd\u5408\u7684\u5730\u65b9\uff0c\u8fd9\u91cc\u4ee5mipmap\u7b49\u7ea7\u4f4e\u7684\u8986\u76d6\u7b49\u7ea7\u9ad8\u7684\u3002\u7531\u4e8e\u6709\u8fd9\u4e24\u70b9\uff0c\u6211\u8d77\u521d\u662f\u76f4\u63a5\u5728CPU\u521b\u5efa\u4e00\u5f20Texture2D\uff0c\u5f80\u91cc\u586b\u6570\u636e\uff0c\u540e\u6765\u6d4b\u8bd5\u53d1\u73b0\u8fd9\u6837\u4f1a\u975e\u5e38\u6162\uff0c\u7279\u522b\u662fTexture2D\u7684Apply\u3002\u540e\u6765\u53c2\u8003UE\u7684\u4ee3\u7801\u91c7\u7528GPUInstance\u76f4\u63a5\u753b\u4e0a\u53bb\uff0c\u8fd9\u91cc\u7531\u4e8e\u9700\u8981\u4f7f\u7528mipmap\u7b49\u7ea7\u4f4e\u7684\u8986\u76d6\u9ad8\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528\u753b\u5bb6\u7b97\u6cd5\uff0c\u6309mipmap\u6392\u5e8f\u3002ue\u8fd8\u4f7f\u7528\u4e86\u83ab\u987f\u7801\uff0c\u6211\u8fd9\u91cc\u76f4\u63a5\u4f7f\u7528InstanceData\u4f20\u5165\u8fdb\u53bb\u6574\u4e2a\u6570\u636e<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar mats = new Matrix4x4[drawList.Count];\nvar pageInfos = new Vector4[drawList.Count];\nfor(int i=0;i&lt;drawList.Count;i++){\n    float size = drawList[i].rect.width \/ TableSize;\n    mats[i] = Matrix4x4.TRS(\n                    new Vector3(drawList[i].rect.x \/ TableSize, drawList[i].rect.y \/ TableSize), \n                    Quaternion.identity,\n                    new Vector3(size, size, size));\n    pageInfos[i] = new Vector4(drawList[i].drawPos.x, drawList[i].drawPos.y, drawList[i].mip \/ 255f,0);\n}\nGraphics.SetRenderTarget(m_LookupTexture);\nvar tempCB = new CommandBuffer();\nvar block = new MaterialPropertyBlock();\nblock.SetVectorArray(&quot;_PageInfo&quot;, pageInfos);\nblock.SetMatrixArray(&quot;_ImageMVP&quot;, mats);\ntempCB.DrawMeshInstanced(mQuad, 0, drawLookupMat,0, mats, mats.Length, block);\nGraphics.ExecuteCommandBuffer(tempCB);\n<\/pre>\n\n\n<p>shader\u4ee3\u7801<\/p>\n\n\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nUNITY_INSTANCING_BUFFER_START(InstanceProp)\nUNITY_DEFINE_INSTANCED_PROP(float4, _PageInfo)\nUNITY_DEFINE_INSTANCED_PROP(float4x4, _ImageMVP)\nUNITY_INSTANCING_BUFFER_END(InstanceProp)\nVaryings vert(Attributes IN)\n{\n\tVaryings OUT ;\n\tUNITY_SETUP_INSTANCE_ID(IN);\n\tfloat4x4 mat = UNITY_MATRIX_M;\n\tmat = UNITY_ACCESS_INSTANCED_PROP(InstanceProp, _ImageMVP);\n\tfloat2 pos = saturate(mul(mat, IN.positionOS).xy);\n\tpos.y = 1 - pos.y;\n\tOUT.positionHCS = float4(2.0 * pos  - 1,0.5,1);\n\tOUT.color = UNITY_ACCESS_INSTANCED_PROP(InstanceProp, _PageInfo);\n\treturn OUT;\n}\n\nhalf4 frag(Varyings IN) : SV_Target\n{\n\treturn IN.color;\n}\n<\/pre>\n\n\n<p>\u8fd9\u91ccUnity\u6709\u51e0\u4e2a\u5751\u903c\u7684\u5730\u65b9\uff0c\u9996\u5148unity\u8c03\u7528drawMeshInstanced\u4f20\u5165\u7684\u90a3\u4e2a\u77e9\u9635\u4ed6\u4f1a\u4fee\u6539\u91cc\u8fb9\u7684\u6570\u636e\uff0c\u5bfc\u81f4\u6211\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u90a3\u4e2a\u6570\u636e\uff0c\u56e0\u4e3a\u6211\u8fd9\u91cc\u4e0d\u662f\u6807\u51c6\u7684MVP\u77e9\u9635\uff0c\u4ed6\u53ef\u80fd\u5e2e\u6211\u8f6c\u6362\u4e86\uff0c\u6211\u8fd9\u91cc\u91cd\u65b0\u5f04\u4e86\u4e00\u4e2a\u77e9\u9635instanceData\u3002\u8fd8\u6709\u4e00\u70b9\u5c31\u662f\u5982\u679c\u4f60\u5728shader\u91cc\u4e0d\u4f7f\u7528UNITY_MATRIX_M\u8fd9\u4e2a\u53d8\u91cf\uff0cunity\u5c31\u8ba4\u4e3a\u4f60\u8fd9\u4e2a\u4e0d\u662fdrawInstance\u3002\u6240\u4ee5\u6211\u5728shader\u91cc\u52a0\u4e86\u4e00\u53e5\u65e0\u610f\u4e49\u7684\u4ee3\u7801float4x4 mat = UNITY_MATRIX_M;<\/p>\n\n\n\n<p><strong>DrawVT<\/strong><\/p>\n\n\n\n<p>\u6240\u6709\u6570\u636e\u51c6\u5907\u5b8c\u6bd5\u540e\uff0c\u73b0\u5728\u5c31\u6bd4\u8f83\u7b80\u5355\u4e86\u3002\u76f4\u63a5\u4f7f\u7528RVT\u8d34\u56fe\u91cc\u7684diffuse\u548cNormal\uff0c\u7136\u540e\u53c2\u4e0e\u5149\u7167\u8ba1\u7b97\u5c31OK\u4e86\u3002<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhalf4 GetRVTColor(Varyings IN)\n{\n    float2 uv = (IN.positionWS.xz - _VTRealRect.xy) \/ _VTRealRect.zw;\n    float2 uvInt = uv - frac(uv * _VTPageParam.x) * _VTPageParam.y;\n\tfloat4 page = tex2D(_VTLookupTex, uvInt) * 255;\n#ifdef _SHOWRVTMIPMAP\n    return float4(clamp(1 - page.b * 0.1 , 0, 1), 0, 0, 1);\n#endif\n\tfloat2 inPageOffset = frac(uv * exp2(_VTPageParam.z - page.b));\n    uv = (page.rg * (_VTTileParam.y + _VTTileParam.x * 2) + inPageOffset * _VTTileParam.y + _VTTileParam.x) \/ _VTTileParam.zw;\n    half3 albedo = tex2D(_VTDiffuse, uv);\n    half3 normalTS = UnpackNormalScale(tex2D(_VTNormal, uv), 1);\n    InputData inputData;\n    InitializeInputData(IN, normalTS, inputData);\n    half metallic = 0;\n    half smoothness = 0.1;\n    half occlusion = 1;\n    half alpha = 1;\n    half4 color = UniversalFragmentPBR(inputData, albedo, metallic, \/* specular *\/ half3(0.0h, 0.0h, 0.0h), smoothness, occlusion, \/* emission *\/ half3(0, 0, 0), alpha);\n    SplatmapFinalColor(color, inputData.fogCoord);\n\n    return half4(color.rgb, 1.0h);\n}\n<\/pre>\n\n\n<p><strong>\u52a8\u6001\u66f4\u65b0<br><\/strong>\u4ee5\u4e0a\u57fa\u672c\u5c31\u80fd\u628a\u5730\u5f62\u901a\u8fc7rvt\u753b\u51fa\u6765\u4e86\uff0c\u4f46\u662f\u8fd9\u6837\u6709\u4e2a\u57fa\u672c\u9650\u5236\uff0c\u90a3\u5c31\u662f\u6211\u4eec\u79fb\u52a8\u7684\u65f6\u5019\uff0c\u5982\u679c\u662f\u8d85\u5927\u4e16\u754c\uff0c\u90a3\u4e48\u8fd9\u4e2apagetable\u5bf9\u5e94\u7684\u4f4d\u7f6e\u5c31\u6709\u9650\u3002ue\u7684\u89e3\u51b3\u529e\u6cd5\u662f\u6bcf\u4e2a\u5730\u5f62\u4e00\u5957rvt\uff0c\u8fd9\u6837\u4f1a\u9020\u6210\uff0c\u5728\u5730\u5f62\u8fb9\u754c\u53ef\u80fd\u51fa\u73b0\u56db\u5957rvt\uff0c\u8fd9\u57fa\u672c\u4e0d\u80fd\u63a5\u53d7\u3002\u5929\u5200\u91c7\u7528\u7684\u662f\u52a8\u6001\u66f4\u65b0pagetable\uff0c\u4e5f\u5c31\u662f\u8bf4pagetable\u5bf9\u5e94\u7684cell\u8868\u793a\u7684\u8303\u56f4\u4f1a\u52a8\u6001\u53d8\u5316\u3002<\/p>\n\n\n\n<p>\u5728changerect\u7684\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u6700\u5927\u9650\u5ea6\u5730\u590d\u7528TileTexture\uff0c\u4e0d\u7136\u9700\u8981\u91cd\u7ed8\u6240\u6709\u7684TileTexture\uff0c\u8fd9\u6837\u4f1a\u9020\u6210\u6bd4\u8f83\u5927\u7684\u5361\u987f\u3002\u8fd9\u91cc\u5bf9\u4e8echangrect\u7684rect\u7684\u89c4\u8303\u5c31\u6bd4\u8f83\u6709\u8bb2\u7a76\u4e86\uff0c\u6211\u4eec\u9700\u8981fixed\u8fd9\u4e2arect\uff0c\u8ba9\u4ed6\u5c3d\u53ef\u80fd\u5730\u591a\u590d\u7528pagetable\u3002\u6211\u4eec\u8fd9\u662f\u901a\u8fc7\u8bbe\u7f6e\u66f4\u65b0\u8ddd\u79bb\u4e3a\u6574\u4e2a\u53ef\u89c6\u8ddd\u79bb\u7684\u56db\u5206\u4e4b\u4e00\u6216\u8005\u516b\u5206\u4e4b\u4e00\u8fd9\u79cd\uff0c\u7136\u540e\u901a\u8fc7\u8fd9\u4e2a\u56db\u5206\u4e4b\u4e00\u53bbfixed\u53ef\u89c6\u8303\u56f4center<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8c01\u5728\u7528Runtime Virtual Texture\u8fd9\u4e2a\u6280\u672f \u00b7 UBI\u57282016\u5e74\u516c\u5e03\u4e86\u5728Far Cry 4 &hellip; <a href=\"https:\/\/meecarlo.com\/old\/2025\/07\/29\/unity%e4%b8%ad%e7%9a%84%e7%a7%bb%e5%8a%a8%e5%b9%b3%e5%8f%b0rvt%e5%ae%9e%e7%8e%b0\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Unity\u4e2d\u7684\u79fb\u52a8\u5e73\u53f0RVT\u5b9e\u73b0<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":942,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/posts\/1028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/comments?post=1028"}],"version-history":[{"count":2,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/posts\/1028\/revisions"}],"predecessor-version":[{"id":1039,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/posts\/1028\/revisions\/1039"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/media\/942"}],"wp:attachment":[{"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/media?parent=1028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/categories?post=1028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meecarlo.com\/old\/wp-json\/wp\/v2\/tags?post=1028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}