<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Unity on 欢迎来到我的个人博客</title>
    <link>https://hugo-blog-1ij.pages.dev/tags/unity/</link>
    <description>Recent content from 欢迎来到我的个人博客</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    
    <managingEditor>19398561589@163.com (胡宇琛)</managingEditor>
    <webMaster>19398561589@163.com (胡宇琛)</webMaster>
    
    <copyright>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</copyright>
    
    <lastBuildDate>Mon, 06 Apr 2026 00:00:00 +0000</lastBuildDate>
    
    
    <atom:link href="https://hugo-blog-1ij.pages.dev/tags/unity/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>Unity Shader 入门精要学习笔记</title>
      <link>https://hugo-blog-1ij.pages.dev/post/unity-shader%E5%85%A5%E9%97%A8%E7%B2%BE%E8%A6%81%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/</link>
      <pubDate>Mon, 06 Apr 2026 00:00:00 &#43;0000</pubDate>
      <author>19398561589@163.com (胡宇琛)</author>
      <guid>https://hugo-blog-1ij.pages.dev/post/unity-shader%E5%85%A5%E9%97%A8%E7%B2%BE%E8%A6%81%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/</guid>
      <description>
        <![CDATA[<h1>Unity Shader 入门精要学习笔记</h1><p>Author: 胡宇琛(19398561589@163.com)</p>
        
          <h1 id="unity-shader-入门精要学习笔记">
<a class="header-anchor" href="#unity-shader-%e5%85%a5%e9%97%a8%e7%b2%be%e8%a6%81%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0"></a>
Unity Shader 入门精要学习笔记
</h1><h2 id="unity-shader-中-subshader-的工作机制和选择逻辑">
<a class="header-anchor" href="#unity-shader-%e4%b8%ad-subshader-%e7%9a%84%e5%b7%a5%e4%bd%9c%e6%9c%ba%e5%88%b6%e5%92%8c%e9%80%89%e6%8b%a9%e9%80%bb%e8%be%91"></a>
Unity Shader 中 SubShader 的工作机制和选择逻辑
</h2><ul>
<li>SubShader 的基本规则：一个 Shader 文件可以包含一个或多个 SubShader，但最少要有一个</li>
<li>SubShader 的基本规则：平台适配性（根据硬件内容）</li>
<li>Unity 是如何选择 SubShader 的：在加载 Shader 时会遍历所有 SubShader，然后选择第一个可以在目标平台运行的，如果都不支持的话，会使用 FallBack 指定的 Shader</li>
<li>为什么需要多个 SubShader？因为不同显卡的能力不同，高端 PC 支持复杂计算、多 Pass、高级特效，低端手机只可以跑基础版本</li>
<li>每个 Pass 等于一次完整的渲染流程（顶点处理 → 片元处理 → 输出），所以多 Pass 会影响帧率性能</li>
</ul>
<h3 id="第一层架构全景">
<a class="header-anchor" href="#%e7%ac%ac%e4%b8%80%e5%b1%82%e6%9e%b6%e6%9e%84%e5%85%a8%e6%99%af"></a>
第一层：架构全景
</h3><p><img src="/images/image-1.png" alt="第一层架构全景"></p>
        
        <hr><p>Published on 2026-04-06 at <a href='https://hugo-blog-1ij.pages.dev/'>欢迎来到我的个人博客</a>, last modified on 2026-04-06</p>]]>
      </description>
      
        <category>学习笔记</category>
      
    </item>
    
  </channel>
</rss>
