{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-alpha-channel-image-size#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size.md",
  "context": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-alpha-channel-image-size",
  "slug": "uwa-answer-alpha-channel-image-size",
  "title": "贴图Alpha通道的对图片大小的影响",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "贴图Alpha通道的对图片大小的影响",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "af066dc248bdfe9719ccd2430209890c134b03913942ec5f0012f8eee992ecfa",
  "assets": [
    {
      "reference": "assets/5fa25e7cdc477370c2c1f015/01.png",
      "url": "/media/e848b00e65035ae1d0ce.png",
      "mediaType": "image/png",
      "contentHash": "e848b00e65035ae1d0cea369d9f0ce4b3c205e2d3b24131af24609c188af9d17",
      "byteLength": 345653,
      "width": 558,
      "height": 667
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "贴图Alpha通道的对图片大小的影响",
      "anchor": "贴图alpha通道的对图片大小的影响",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E8%B4%B4%E5%9B%BEalpha%E9%80%9A%E9%81%93%E7%9A%84%E5%AF%B9%E5%9B%BE%E7%89%87%E5%A4%A7%E5%B0%8F%E7%9A%84%E5%BD%B1%E5%93%8D"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 4,
      "text": "以下是测试资源配置",
      "anchor": "以下是测试资源配置",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E4%BB%A5%E4%B8%8B%E6%98%AF%E6%B5%8B%E8%AF%95%E8%B5%84%E6%BA%90%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 4,
      "text": "测试结果",
      "anchor": "测试结果",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C"
    },
    {
      "depth": 4,
      "text": "问题",
      "anchor": "问题-1",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E9%97%AE%E9%A2%98-1"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-alpha-channel-image-size/#%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-alpha-channel-image-size/#%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": "2020-11-05：贴图Alpha通道的对图片大小的影响（资源管理）",
      "citation": "https://www.pystone.net/notes/my-uwa-answers/#2020"
    },
    {
      "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问答中的“2020-11-05 - 贴图Alpha通道的对图片大小的影响”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# 贴图Alpha通道的对图片大小的影响\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\nhttps://blog.uwa4d.com/archives/UWA_Pipeline19.html\n\n在 UWA 的这篇文章中，描述了图片含有 Alpha 通道的话，会对内存有影响\n\n#### 以下是测试资源配置\n\n- Tga_Alpha - 含有 Alpha 通道\n- Tga_NoAlpha - 不含有 Alpha 通道\n- Png_Trans - 含有透明的图片\n- 进入到 Unity 中的 Format，全部代码设置为 TextureImporterFormat.ASTC_6x6\n\n#### 测试结果\n\n- 三张图片 Unity 全部 Format 为下图格式\n- 三张图片显示的内存大小全部一样\n- Texture Importer 的 Alpha Source 设置为 None, 对测试结果无影响\n- ![image.png](assets/5fa25e7cdc477370c2c1f015/01.png)\n\n#### 问题\n\n图片是否含有 Alpha 通道，对于同一个 Format 格式，内存大小都是一样的\n\n[Tex.7z](https://uwa-public.oss-cn-beijing.aliyuncs.com/answer/attachment/public/112946/1604477064644.7z)\n\n- 提问者：什么时候才能支持注销\n- 提问时间：2020-11-04 23:55:40\n\n## 我的回答\n\n游戏运行时Texture的alpha通道要看导入后的情况，不能看源文件的情况。UWA本地资源检测对于Texture的Alpha通道检测的就是导入后的结果。\n\n图片源文件的格式，图形硬件是不支持的，Unity也不直接接管。导入图片后，会按照Import Settings中的设置对图片进行处理，将图片导入成硬件支持的格式（在引擎中的格式），而在运行中使用的资源也是导入后的。\n\n题主将 Alpha Source 设置为 None，那么导入时就不对源文件的Alpha通道进行导入，而压缩格式为ASTC_6x6，这个格式是包含Alpha通道的。这样导入后三个资源都会默认生成一个全为1的alpha通道。占用内存大小自然一样。\n\n- 回答时间：2020-11-05 01:57:58\n- 最后更新：2020-11-05 01:57:58\n- 采纳状态：未采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：资源管理\n- 原始问题：[贴图Alpha通道的对图片大小的影响](https://answer.uwa4d.com/question/5fa25e7cdc477370c2c1f015)\n- 源页最后更新：2020-11-05 02:21:34\n"
}
