{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-live2d-smooth-gradient#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient.md",
  "context": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-live2d-smooth-gradient",
  "slug": "uwa-answer-live2d-smooth-gradient",
  "title": "Live2D平滑渐变方案",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "Live2D平滑渐变方案",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "0c6a677a80d4c155a4e1916f9758a57dac520dc15481f4fd21c5528f31f71b26",
  "assets": [
    {
      "reference": "assets/60b9e8d8608bed3338d78717/01.png",
      "url": "/media/e1f5db423a99ac3a6446.png",
      "mediaType": "image/png",
      "contentHash": "e1f5db423a99ac3a6446598c3513d193ec3b923c3652fab9be0335394e5b5ad7",
      "byteLength": 124568,
      "width": 1352,
      "height": 524
    },
    {
      "reference": "assets/60b9e8d8608bed3338d78717/02.png",
      "url": "/media/8dfcfde4c18db37177c1.png",
      "mediaType": "image/png",
      "contentHash": "8dfcfde4c18db37177c1a9201918a4d0ff65c0f4780cbd7794995de9d07cf697",
      "byteLength": 21982,
      "width": 533,
      "height": 109
    },
    {
      "reference": "assets/60b9e8d8608bed3338d78717/03.png",
      "url": "/media/2eab3824b3cd7d4a7dea.png",
      "mediaType": "image/png",
      "contentHash": "2eab3824b3cd7d4a7dea598f7195a381ae8b94231c078d5ae8e691e61fea6024",
      "byteLength": 21953,
      "width": 319,
      "height": 452
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "Live2D平滑渐变方案",
      "anchor": "live2d平滑渐变方案",
      "citation": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/#live2d%E5%B9%B3%E6%BB%91%E6%B8%90%E5%8F%98%E6%96%B9%E6%A1%88"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "claims": [],
  "outgoing": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "上位集合：我的 UWA 问答",
      "citation": "https://www.pystone.net/notes/uwa-answer-live2d-smooth-gradient/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "incoming": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "2021-06-05：Live2D平滑渐变方案（Shader、渲染模块、终端平台）",
      "citation": "https://www.pystone.net/notes/my-uwa-answers/#2021"
    },
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "我的UWA问答中的“2021-06-05 - Live2D平滑渐变方案”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# Live2D平滑渐变方案\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\nLive2D官方提供的组件CubismRenderController通过设置Opacity可以设置Cubism的透明度,但是过渡很生硬,如下图\n\n![327T`YU`6GJMIK2QAB3.png](assets/60b9e8d8608bed3338d78717/01.png)\n\n目前的方案是把Cubism通过RT渲染到面板上,通过控制面板透明度来达到平滑过渡效果,请问大家还有什么好的解决方案？\n\n- 提问者：黑白凌乱\n- 提问时间：2021-06-05 00:48:24\n\n## 我的回答\n\n所谓透明度“不平滑过度”，本质原因在于，原先的逻辑是 身体的每一个小部分单独应用cubism_ModelOpacity之后，各个部分再进行混合。核心代码如下：\n\n![image.png](assets/60b9e8d8608bed3338d78717/02.png)\n\n身体是一部分一部分画的：\n\n![image.png](assets/60b9e8d8608bed3338d78717/03.png)\n\n而题主要的效果是：在渲染出整体结果之后，再对整体应用透明效果。所以， ”全身绘制之后，再使用透明度处理一次“ 这一做法是必然的。本质是身体各部分绘制完成后，要取到FrameBuffer，然后使用透明度处理一次。因此”通过RT渲染到面板上，再控制面板的透明度的做法是合理“的。\n\n所以题主的问题是，有没有更直接的方法，对这一过程进行优化。我这边还没有想到更好的优化方法，可能Builtin-RenderPipeline没有那么灵活，也或许可以考虑有没有优化的必要。\n\n- 回答时间：2021-06-05 07:30:59\n- 最后更新：2021-06-05 07:30:59\n- 采纳状态：已采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：Shader、渲染模块、终端平台\n- 原始问题：[Live2D平滑渐变方案](https://answer.uwa4d.com/question/60b9e8d8608bed3338d78717)\n- 源页最后更新：2021-06-05 07:30:59\n"
}
