{"id":1759,"date":"2020-04-17T17:36:50","date_gmt":"2020-04-17T09:36:50","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=1759"},"modified":"2020-09-26T22:44:25","modified_gmt":"2020-09-26T14:44:25","slug":"unityshaderpass%e4%b8%ad%e6%bc%8f%e5%8a%a0lightmode%e7%9a%84%e4%b8%a5%e9%87%8d%e6%80%a7","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=1759","title":{"rendered":"[Unity]ShaderPass\u4e2d\u6f0f\u52a0LightMode\u7684\u4e25\u91cd\u6027"},"content":{"rendered":"\n<p>\u5177\u4f53\u8868\u73b0\u4e3a\uff0c\u540c\u4e00\u4efd\u6750\u8d28\uff0c\u540c\u4e00\u4efdMesh\u7684\u4e24\u4e2a\u4e0d\u900f\u660e\u7269\u4ef6<br>\u5728\u6e32\u67d3\u65f6\u4f7f\u7528\u4e86\u4e24\u4e2aKeywords<br>\u4e00\u4e2a\u4f7f\u7528\u4e86DIRECTIONAL<br>\u4e00\u4e2a\u4f7f\u7528 DIRECTIONAL, SHADOWS_SCREEN<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"423\" src=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-3.png\" alt=\"\" class=\"wp-image-1760\" srcset=\"https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-3.png 877w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-3-300x145.png 300w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-3-768x370.png 768w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-3-70x34.png 70w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"903\" height=\"363\" src=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-4.png\" alt=\"\" class=\"wp-image-1761\" srcset=\"https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-4.png 903w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-4-300x121.png 300w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-4-768x309.png 768w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/04\/image-4-70x28.png 70w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/figure>\n\n\n\n<p>\u6d4b\u8bd5\u65b9\u6cd5\u4e00\uff1a<br>\u5efa\u7acb\u7a7a\u573a\u666f\uff0c\u5c06\u6b64\u6750\u8d28\u8d4b\u4e8e\u4e00\u5bf9\u8c61\uff0c\u518d\u52a0\u4e00\u9ed8\u8ba4Sphere\uff0c\u79fb\u52a8\u6b64Sphere\uff0c\u67e5\u770b\u8868\u73b0\uff1b<br>\u968f\u673a \u8868\u73b01\uff1a\u6b64\u6750\u8d28\u63a5\u53d7\u5230\u4e86\u9634\u5f71<br>\u968f\u673a \u8868\u73b02\uff1a\u6b64\u6750\u8d28\u65e0\u6cd5\u63a5\u53d7\u9634\u5f71<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    SubShader\n    {\n        LOD 300\n        Pass\n        {\n            CGPROGRAM\n            #pragma vertex vert\n            #pragma fragment frag\n            #pragma multi_compile_fwdbase_fullshadows \n            #include \"UnityCG.cginc\"\n            #include \"UnityStandardConfig.cginc\"\n            #include \"UnityStandardUtils.cginc\"\n            #include \"AutoLight.cginc\"\n            #include \"300.cginc\"\n            ENDCG\n        }\n    }\n<\/code><\/pre>\n\n\n\n<p>\u7ecf\u4ee3\u7801\u5bf9\u6bd4\uff0c\u53d1\u73b0\u6f0f\u5199\u4e86LightMode<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    SubShader\n    {\n        LOD 300\n        Pass\n        {\n            Tags { \"LightMode\"=\"ForwardBase\" }\n            CGPROGRAM\n            #pragma vertex vert\n            #pragma fragment frag\n            #pragma multi_compile_fwdbase_fullshadows \n            #include \"UnityCG.cginc\"\n            #include \"UnityStandardConfig.cginc\"\n            #include \"UnityStandardUtils.cginc\"\n            #include \"AutoLight.cginc\"\n            #include \"300.cginc\"\n            ENDCG\n        }\n    }\n<\/code><\/pre>\n\n\n\n<p>\u95ee\u9898\u89e3\u51b3\uff0c\u8868\u73b0\u6b63\u5e38\uff1b<\/p>\n\n\n\n<p>\u4ece\u4ee5\u4e0a\u95ee\u9898\u53ef\u4ee5\u770b\u51fa\uff1a<br>1\u3001Unity\u5f15\u64ce\u5185\u7f6e\u4e86\u6f5c\u89c4\u5219<br>2\u3001Unity\u4ee3\u7801\u8d28\u91cf\u4f4e\uff0c\u4f18\u8d28\u7684\u4ee3\u7801\u8d28\u91cf\u8981\u4e48\u9519\u8981\u4e48\u5bf9\uff0cUnity\u662f\u968f\u673a\u9519\u8bef<br>3\u3001\u4e00\u5207\u6309Unity\u7684\u6f5c\u89c4\u5219\u6765\u65b9\u80fd\u4fdd\u5e73\u5b89<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5177\u4f53\u8868\u73b0\u4e3a\uff0c\u540c\u4e00\u4efd\u6750\u8d28\uff0c\u540c\u4e00\u4efdMesh\u7684\u4e24\u4e2a\u4e0d\u900f\u660e\u7269\u4ef6\u5728\u6e32\u67d3\u65f6\u4f7f\u7528\u4e86\u4e24\u4e2aKeywords\u4e00\u4e2a\u4f7f\u7528\u4e86DIRECT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1759"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1759"}],"version-history":[{"count":3,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1759\/revisions"}],"predecessor-version":[{"id":1765,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1759\/revisions\/1765"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}