{"id":330,"date":"2025-01-11T21:55:02","date_gmt":"2025-01-11T13:55:02","guid":{"rendered":"http:\/\/chenglixue.top\/?p=330"},"modified":"2025-01-11T21:55:02","modified_gmt":"2025-01-11T13:55:02","slug":"%e6%b3%95%e7%ba%bf%e8%b4%b4%e5%9b%be%e5%8e%8b%e7%bc%a9%e4%b8%8e%e8%ae%a1%e7%ae%97","status":"publish","type":"post","link":"http:\/\/chenglixue.top\/?p=330","title":{"rendered":"\u6cd5\u7ebf\u8d34\u56fe\u538b\u7f29\u4e0e\u8ba1\u7b97"},"content":{"rendered":"<p><div class=\"has-toc have-toc\"><\/div><\/p>\n<h1>\u53cc\u901a\u9053\u6cd5\u7ebf\u8d34\u56fe<\/h1>\n<p>\u5728\u79fb\u52a8\u7aef\u7528\u4e8e\u5e26\u5bbd\u53d7\u9650\u7684\u7f18\u6545\uff0c\u5ef6\u8fdf\u7ba1\u7ebf\u4e0b\u4e0d\u80fd\u8bbe\u5b9a\u592a\u591aGBuffer\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u624b\u673a\u53d1\u70ed\u3002\u5bf9\u4e8enormal tex\uff0c\u662f\u53ef\u4ee5\u901a\u8fc7xy\u6765\u7b97\u51faz\u7684<\/p>\n<pre><code class=\"line-numbers\">inline float3 GetNormalTSFromXY(float4 normal, float normalIntensity = 1.f)\n{\n    float3 o = 0.f;\n\n    float2 normalXY = normal.rg * 2.f - 1.f;\n    o.z = max(1e-16, sqrt(1.f - saturate(dot(normalXY, normalXY))));\n    o.xy = normalXY * normalIntensity;\n\n    return o;\n}\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u7701\u51fa\u4e00\u4e2a\u901a\u9053\u6765\u88c5\u586b\u5176\u4ed6\u6570\u636e\uff0c\u5982AO<\/p>\n<h1>\u5b58\u5728\u7684\u95ee\u9898<\/h1>\n<ul>\n<li>\u4f46\u53cc\u901a\u9053\u4e5f\u5b58\u5728\u4e00\u5b9a\u7684\u95ee\u9898\uff0c\u56e0\u4e3a\u7b2c\u4e09\u4e2a\u901a\u9053\u586b\u5145\u4e86AO\u6570\u636e\uff0c\u5bf9\u4e8e<strong>normal tex\u6709\u7279\u5b9a\u7684\u56fe\u7247\u538b\u7f29\u65b9\u5f0f<\/strong>\uff0c\u800cnormal.xy\u6570\u636e\u548cao\u672c\u6765\u5c31\u6ca1\u4ec0\u4e48\u5173\u8054\uff0c\u6240\u4ee5\u5f88\u53ef\u80fd\u4f1a\u5bfc\u81f4normal.xy\u7684\u6570\u636e\u4e0d\u5bf9<\/p>\n<\/li>\n<li>\n<p>\u7eb9\u7406\u8fc7\u6ee4\u4e22\u5931\u9ad8\u9891\u4fe1\u606f<\/p>\n<p>normal tex\u56e0\u4e3a\u5b58\u50a8\u7684\u662f\u4e00\u4e2a\u5411\u91cf\uff0c\u6240\u4ee5\u5bf9normal tex\u8fdb\u884c\u7eb9\u7406\u8fc7\u6ee4\uff0c\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a<strong>\u7403\u9762\u63d2\u503c<\/strong>\u7684\u8fc7\u7a0b\u3002\u6700\u7ec8\u5728<strong>\u63d2\u503c\u4e24\u4e2anormal\u5411\u91cf\u65f6\uff0c\u5f53\u65b9\u5411\u5dee\u8ddd\u8d8a\u5927\uff0c\u4f1a\u4f7f\u5f97normal.z\u7684\u6570\u636e\u8d8a\u9519\u8bef<\/strong><\/p>\n<\/li>\n<\/ul>\n<h1>\u7eb9\u7406\u538b\u7f29\u4e0e\u901a\u9053\u50a8\u5b58<\/h1>\n<ul>\n<li>\n<p>\u4e3a\u4e86\u652f\u6301\u53cc\u901a\u9053normal tex\uff0c\u4ece\u6700\u65e9\u7684PC\u7aefDXT5\u5f00\u59cb\uff0c\u5230\u73b0\u5728\u79fb\u52a8\u7aefASTC\uff0c\u90fd\u63a8\u51fa\u4e86\u76f8\u5e94\u7684\u538b\u7f29\u7b97\u6cd5\u2014\u2014\u9700\u8981\u5c06rg\u6570\u636e\u653e\u5728ag\u4e2d\u8ba1\u7b97<\/p>\n<p>\u56e0\u6b64\u5728\u8ba1\u7b97normal\u65f6\uff0c\u9700\u8981<strong>\u5c06r\u901a\u9053\u7684\u503c\u8d4b\u7ed9a\u901a\u9053<\/strong>\uff0c\u5e76\u4f7f\u7528ag\u901a\u9053\u6765\u8ba1\u7b97normal<\/p>\n<\/li>\n<\/ul>\n<h1>GBuffer\u5e94\u8be5\u538b\u7f29Normal\u5417\uff1f<\/h1>\n<p>\u5927\u90e8\u5206\u5382\u5546\u90fd\u6ca1\u6709\u538b\u7f29GBuffer\uff0c\u5373\u4f7f\u662f\u79fb\u52a8\u7aef\u4e5f\u662f\u5982\u6b64\uff0c\u5982UE\u7b49<\/p>\n<p>\u56e0\u4e3a\u538b\u7f29Normal\u53ef\u80fd\u4f1a\u5bfc\u81f4normal\u7684\u504f\u5dee\uff0c\u6700\u7ec8\u5bfc\u81f4\u6e32\u67d3\u7684\u8bef\u5dee\uff0c\u5982\u9ad8\u5149\u3001\u8d34\u753b\u7b49\uff0c\u800c\u4e14\u662f\u6bd4\u8f83\u660e\u663e\u7684\uff0c\u4e3a\u4e86\u7a33\u5b9a\u8fd8\u662f\u66f4\u5efa\u8bae\u4e0d\u538b\u7f29<\/p>\n<p>\u5f53\u7136CryEngine\u7528\u5230\u4e86\u5947\u6deb\u6280\u5de7MicroGBuffer\u6765\u538b\u7f29Normal\uff0c\u4e5f\u662f\u53ef\u4ee5\u7684<\/p>\n<h1>Reference<\/h1>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/blog.codingnow.com\/2019\/07\/compressed_normal_map.html\" target=\"_blank\"  rel=\"nofollow\" >\u6cd5\u7ebf\u8d34\u56fe\u7684\u538b\u7f29\u683c\u5f0f\u6bd4\u8f83<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/zhuanlan.zhihu.com\/p\/387973907\" target=\"_blank\"  rel=\"nofollow\" >\u4e3a\u4ec0\u4e48\u75282\u4e2a\u901a\u9053pack\u6cd5\u7ebf\u4e0d\u662f\u4e00\u4e2a\u597d\u6ce8\u610f<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/developer.nvidia.com\/astc-texture-compression-for-game-assets\" target=\"_blank\"  rel=\"nofollow\" >Using ASTC Texture Compression for Game Assets<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/zhuanlan.zhihu.com\/p\/126345392\" target=\"_blank\"  rel=\"nofollow\" >GBuffer\u7684\u538b\u7f29\u53caCryEngine\u7684MicroGBuffer\u7684\u5b9e\u73b0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53cc\u901a\u9053\u6cd5\u7ebf\u8d34\u56fe \u5728\u79fb\u52a8\u7aef\u7528\u4e8e\u5e26\u5bbd\u53d7\u9650\u7684\u7f18\u6545\uff0c\u5ef6\u8fdf\u7ba1\u7ebf\u4e0b\u4e0d\u80fd\u8bbe\u5b9a\u592a\u591aGBuffer\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u624b\u673a\u53d1\u70ed\u3002\u5bf9\u4e8enormal tex\uff0c\u662f &#8230;<\/p>","protected":false},"author":1,"featured_media":319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/330"}],"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=330"}],"version-history":[{"count":1,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":331,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/331"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=\/wp\/v2\/media\/319"}],"wp:attachment":[{"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/chenglixue.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}