{"id":457,"date":"2023-11-01T20:16:16","date_gmt":"2023-11-02T04:16:16","guid":{"rendered":"https:\/\/karasu.tech\/?p=457"},"modified":"2025-02-01T20:19:16","modified_gmt":"2025-02-02T04:19:16","slug":"unity%e6%b8%b2%e6%9f%93%e5%ba%94%e7%94%a8%e5%9f%ba%e7%a1%80%e8%ae%a4%e7%9f%a5-%e5%83%8f%e7%b4%a0%ef%bc%8c%e4%bd%93%e7%b4%a0%ef%bc%8cvdb","status":"publish","type":"post","link":"https:\/\/karasu.tech\/?p=457","title":{"rendered":"Unity\u6e32\u67d3\u5e94\u7528\u57fa\u7840\u8ba4\u77e5\u2014\u2014\u50cf\u7d20\uff0c\u4f53\u7d20\uff0cVDB"},"content":{"rendered":"<p>\u5728 Unity \u4e2d\uff0c\u50cf\u7d20\u3001\u4f53\u7d20\u548c VDB\uff08Volume Data Block\uff09\u662f\u4e09\u79cd\u4e0d\u540c\u7684\u6982\u5ff5\uff0c\u5b83\u4eec\u5728\u6e38\u620f\u5f00\u53d1\u548c\u56fe\u5f62\u5904\u7406\u4e2d\u6709\u7740\u5404\u81ea\u72ec\u7279\u7684\u5e94\u7528\u573a\u666f\u548c\u7279\u70b9<\/p>\n<hr \/>\n<h4>\u50cf\u7d20<\/h4>\n<p>\u6982\u5ff5\uff1a\u50cf\u7d20\uff08Pixel\uff09\u662f\u56fe\u50cf\u7684\u57fa\u672c\u5355\u4f4d\uff0c\u662f\u6784\u6210\u6570\u5b57\u56fe\u50cf\u7684\u6700\u5c0f\u5355\u5143\u3002\u5728 Unity \u4e2d\uff0c\u50cf\u7d20\u901a\u5e38\u7528\u4e8e 2D \u56fe\u50cf\u548c\u7eb9\u7406\u7684\u5904\u7406\u3002\u6bcf\u4e2a\u50cf\u7d20\u90fd\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u989c\u8272\u503c\uff0c\u8fd9\u4e9b\u989c\u8272\u503c\u7ec4\u5408\u5728\u4e00\u8d77\u5f62\u6210\u4e86\u5b8c\u6574\u7684\u56fe\u50cf\u3002<\/p>\n<p>\u5e94\u7528\u573a\u666f\uff1a\u50cf\u7d20\u5728 Unity \u4e2d\u5e7f\u6cdb\u5e94\u7528\u4e8e 2D \u6e38\u620f\u7684\u5f00\u53d1\uff0c\u5982\u7cbe\u7075\uff08Sprite\uff09\u7684\u7ed8\u5236\u3001\u7eb9\u7406\u7684\u6620\u5c04\u7b49\u3002\u901a\u8fc7\u64cd\u4f5c\u50cf\u7d20\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u73b0\u56fe\u50cf\u7684\u6e32\u67d3\u3001\u6ee4\u955c\u6548\u679c\u3001\u56fe\u50cf\u5408\u6210\u7b49\u529f\u80fd\u3002<\/p>\n<p>\u5b9e\u73b0\u65b9\u5f0f\uff1a\u5728 Unity \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u50cf\u7d20\u7740\u8272\u5668\uff08Pixel Shader\uff09\u6765\u5bf9\u50cf\u7d20\u8fdb\u884c\u5904\u7406\uff0c\u5b9e\u73b0\u5404\u79cd\u56fe\u50cf\u6548\u679c\u3002\u6b64\u5916\uff0cUnity \u8fd8\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684 API \u6765\u64cd\u4f5c\u7eb9\u7406\u548c\u50cf\u7d20\uff0c\u5982 Texture2D \u7c7b\u7b49\u3002<\/p>\n<hr \/>\n<h4>\u4f53\u7d20<\/h4>\n<p>\u6982\u5ff5\uff1a\u4f53\u7d20\uff08Voxel\uff09\u662f\u4e09\u7ef4\u7a7a\u95f4\u4e2d\u7684\u50cf\u7d20\uff0c\u662f\u6784\u6210\u4e09\u7ef4\u4f53\u6570\u636e\u7684\u57fa\u672c\u5355\u4f4d\u3002\u6bcf\u4e2a\u4f53\u7d20\u90fd\u6709\u4e00\u4e2a\u4f4d\u7f6e\u548c\u5c5e\u6027\uff08\u5982\u989c\u8272\u3001\u5bc6\u5ea6\u7b49\uff09\uff0c\u901a\u8fc7\u8fd9\u4e9b\u4f53\u7d20\u53ef\u4ee5\u6784\u5efa\u51fa\u590d\u6742\u7684\u4e09\u7ef4\u6a21\u578b\u548c\u573a\u666f\u3002<\/p>\n<p>\u5e94\u7528\u573a\u666f\uff1a\u4f53\u7d20\u5728 Unity \u4e2d\u5e38\u7528\u4e8e\u6c99\u76d2\u6e38\u620f\u3001\u5efa\u7b51\u6a21\u62df\u3001\u533b\u5b66\u53ef\u89c6\u5316\u7b49\u9886\u57df\u3002\u901a\u8fc7\u4f53\u7d20\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u73b0\u5730\u5f62\u751f\u6210\u3001\u7269\u4f53\u7834\u574f\u3001\u6d41\u4f53\u6a21\u62df\u7b49\u6548\u679c\uff0c\u4e3a\u73a9\u5bb6\u63d0\u4f9b\u66f4\u52a0\u4e30\u5bcc\u548c\u771f\u5b9e\u7684\u4f53\u9a8c\u3002<\/p>\n<p>\u5b9e\u73b0\u65b9\u5f0f\uff1a\u5728 Unity \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4f53\u7d20\u6570\u7ec4\u6765\u5b58\u50a8\u4f53\u7d20\u6570\u636e\uff0c\u7136\u540e\u4f7f\u7528\u4f53\u7d20\u6e32\u67d3\u6280\u672f\uff08\u5982\u4f53\u7d20\u5149\u7ebf\u6295\u5c04\u3001\u4f53\u7d20\u7f51\u683c\u5316\u7b49\uff09\u5c06\u4f53\u7d20\u6570\u636e\u6e32\u67d3\u6210\u4e09\u7ef4\u6a21\u578b\u3002\u6b64\u5916\uff0cUnity \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u4f53\u7d20\u76f8\u5173\u7684\u63d2\u4ef6\u548c\u5de5\u5177\uff0c\u5982 Voxel Importer \u7b49\uff0c\u65b9\u4fbf\u5f00\u53d1\u8005\u8fdb\u884c\u4f53\u7d20\u6a21\u578b\u7684\u5bfc\u5165\u548c\u5904\u7406\u3002<\/p>\n<hr \/>\n<h4>VDB\uff08Volume Data Block\uff09<\/h4>\n<p>\u6982\u5ff5\uff1aVDB \u662f\u4e00\u79cd\u7528\u4e8e\u7269\u7406\u6a21\u62df\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5b83\u5c06\u4e00\u4e2a\u4e09\u7ef4\u7a7a\u95f4\u5212\u5206\u4e3a\u591a\u4e2a\u7acb\u65b9\u4f53\u7f51\u683c\uff0c\u6bcf\u4e2a\u7f51\u683c\u90fd\u6709\u4e00\u4e2a\u4f53\u79ef\u503c\u3002\u8fd9\u4e9b\u4f53\u79ef\u503c\u53ef\u4ee5\u7528\u4e8e\u8868\u793a\u7269\u4f53\u7684\u5bc6\u5ea6\u3001\u8d28\u91cf\u7b49\u4fe1\u606f\u3002<\/p>\n<p>\u5e94\u7528\u573a\u666f\uff1aVDB \u5728 Unity \u4e2d\u4e3b\u8981\u7528\u4e8e\u7269\u7406\u6a21\u62df\uff0c\u5982\u6d41\u4f53\u6a21\u62df\u3001\u8f6f\u4f53\u6a21\u62df\u7b49\u3002\u901a\u8fc7 VDB\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u73b0\u66f4\u52a0\u7cbe\u786e\u7684\u78b0\u649e\u68c0\u6d4b\u548c\u7269\u4f53\u8fd0\u52a8\uff0c\u63d0\u9ad8\u7269\u7406\u6a21\u62df\u7684\u7cbe\u5ea6\u548c\u6548\u7387\u3002<\/p>\n<p>\u5b9e\u73b0\u65b9\u5f0f\uff1a\u5728 Unity \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u7269\u7406\u6a21\u62df\u811a\u672c\uff0c\u7ed3\u5408 VDB \u6570\u636e\u7ed3\u6784\u6765\u5b9e\u73b0\u7269\u7406\u6a21\u62df\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528 Unity \u63d0\u4f9b\u7684\u7269\u7406\u5f15\u64ce\uff08\u5982 NVIDIA PhysX\uff09\u6765\u5904\u7406\u78b0\u649e\u68c0\u6d4b\u548c\u7269\u4f53\u8fd0\u52a8\uff0c\u540c\u65f6\u5229\u7528 VDB \u6765\u5b58\u50a8\u548c\u7ba1\u7406\u7269\u7406\u5c5e\u6027\u6570\u636e\u3002<\/p>\n<hr \/>\n<p>\u50cf\u7d20\uff1a\u4e3b\u8981\u7528\u4e8e 2D \u56fe\u50cf\u548c\u7eb9\u7406\u7684\u5904\u7406\uff0c\u662f\u56fe\u50cf\u7684\u57fa\u672c\u5355\u4f4d\u3002<br \/>\n\u4f53\u7d20\uff1a\u7528\u4e8e\u6784\u5efa\u4e09\u7ef4\u6a21\u578b\u548c\u573a\u666f\uff0c\u662f\u4e09\u7ef4\u4f53\u6570\u636e\u7684\u57fa\u672c\u5355\u4f4d\uff0c\u5177\u6709\u9ad8\u5ea6\u7684\u81ea\u5b9a\u4e49\u6027\u548c\u4e30\u5bcc\u7684\u89c6\u89c9\u6548\u679c\u3002<br \/>\nVDB\uff1a\u7528\u4e8e\u7269\u7406\u6a21\u62df\uff0c\u901a\u8fc7\u5c06\u4e09\u7ef4\u7a7a\u95f4\u5212\u5206\u4e3a\u7acb\u65b9\u4f53\u7f51\u683c\uff0c\u5b9e\u73b0\u7cbe\u786e\u7684\u7269\u7406\u5c5e\u6027\u5b58\u50a8\u548c\u6a21\u62df\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Unity \u4e2d\uff0c\u50cf\u7d20\u3001\u4f53\u7d20&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,3],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-renedermath","category-game-engine"],"_links":{"self":[{"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/karasu.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=457"}],"version-history":[{"count":1,"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":458,"href":"https:\/\/karasu.tech\/index.php?rest_route=\/wp\/v2\/posts\/457\/revisions\/458"}],"wp:attachment":[{"href":"https:\/\/karasu.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/karasu.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/karasu.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}