{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/rendering-light-probes/",
  "atlas": "https://www.pystone.net/?node=rendering-light-probes#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/rendering-light-probes.md",
  "context": "https://www.pystone.net/notes/rendering-light-probes.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:rendering-light-probes",
  "slug": "rendering-light-probes",
  "title": "【光照】光照探针",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "【光照】光照探针",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "1788e38bf7d0f854fd8ec189bd4e86704691870426d32476d882128de28dd9f2",
  "assets": [],
  "headings": [
    {
      "depth": 1,
      "text": "【光照】光照探针",
      "anchor": "光照光照探针",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E5%85%89%E7%85%A7%E5%85%89%E7%85%A7%E6%8E%A2%E9%92%88"
    },
    {
      "depth": 2,
      "text": "Instroduction",
      "anchor": "instroduction",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#instroduction"
    },
    {
      "depth": 2,
      "text": "基础知识",
      "anchor": "基础知识",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86"
    },
    {
      "depth": 3,
      "text": "球的坐标",
      "anchor": "球的坐标",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E7%90%83%E7%9A%84%E5%9D%90%E6%A0%87"
    },
    {
      "depth": 3,
      "text": "拉普拉斯方程",
      "anchor": "拉普拉斯方程",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E6%8B%89%E6%99%AE%E6%8B%89%E6%96%AF%E6%96%B9%E7%A8%8B"
    },
    {
      "depth": 3,
      "text": "球谐函数",
      "anchor": "球谐函数",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E7%90%83%E8%B0%90%E5%87%BD%E6%95%B0"
    },
    {
      "depth": 2,
      "text": "实现原理",
      "anchor": "实现原理",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86"
    },
    {
      "depth": 2,
      "text": "实践应用",
      "anchor": "实践应用",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E5%AE%9E%E8%B7%B5%E5%BA%94%E7%94%A8"
    },
    {
      "depth": 3,
      "text": "经验",
      "anchor": "经验",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#%E7%BB%8F%E9%AA%8C"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/rendering-light-probes/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "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": "渲染基础中的“【光照】光照探针”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%B8%B2%E6%9F%93%E5%9F%BA%E7%A1%80"
    }
  ],
  "contentMarkdown": "# 【光照】光照探针\n\n> 创建时间：2021/6/1 11:18\n\n## Instroduction\n\n背景：预计算实时GI或者烘焙照明只对静态的物体起作用\n\nLight Probes provide a way to **capture and use information about light that is passing through the empty space** in your scene.\n\n**lightmaps** store lighting information about light hitting the surfaces in your scene\n**light probes** store information about light passing through empty space in your scene.\n\n> 为了让动态物体（如交互式场景元素或角色）能够获得静态物体反弹的光线，需要将这些光照信息记录下来，并且在运行时能快速读取和使用。\n\nLight Probes are positions in the scene where the light is measured (probed) during the bake.\nAt runtime, the **indirect light that hits dynamic GameObjects** is approximated **using the values from the nearest Light Probes to that object**.\n\n## 基础知识\n\n### 球的坐标\n\n### 拉普拉斯方程\n\n讲的很好的文章：<https://zhuanlan.zhihu.com/p/350388376>\n\n### 球谐函数\n\n## 实现原理\n\n探测照明通过3D空间中的探头对入射光进行采样并将这些信息通过 **球谐函数** 编码处理后保存成文件。这些信息占用的存储空间很少并且在运行时解码非常快。场景中的Shader可以使用这些信息来模拟物体表面的光照。\n\n详细的原理：<https://docs.unity3d.com/Manual/LightProbes-TechnicalInformation.html>\n\n## 实践应用\n\n劣势：在一定的计算量下，探测照明很难表现变化复杂的照明效果。但是如果增加模拟精度，计算代价也会随之增高。基于性能的考虑，Unity限制了计算的精度。另外一个，由于一个3D位置只用了一个球来进行模拟，在大模型以及较平的模型表面上的光照效果可能会不太好。\n适用性：探测照明在小的、凸状的物体上有很好的效果，同时性能很好。\n\n### 经验\n\n非静态物体根据距离最近的探头来接收光照。\n光照探头会将整个空间划分成一个个四面体，一个物体最终从哪个探头读取光照数据这个物体最终落在哪一个四面体中确定的。为了能够形成这些四面体，探头在摆放时必须形成三维的立体形状或者笼子的形状（不能只在一个平面上摆放，在Y轴至少要放置两层）。\n\n  * 以整齐的密集网格排列会减少摆放时的工作量，但是这样会造成很多探头的浪费，因为很多探头在相近的位置接收到的光照都类似，在相似的光照位置，只需要一个或几个探头就足够了。\n\n  * 为了提高探头的效率，应该在光照变化比较大的地方多放置探头，在光照变化不大的地方少放探头。比如应该在从明亮到阴影的过渡位置多放探头，在反射光较强烈的表面多放置探头，在大的平面上少放探头。\n\n  * 接近地面的区域可以多放置一些，空中可以少放置一些\n\n  * 在放置探头时，记住检查最底端的探头是否高于地面（在地面以下可能会造成地面上的物体光照信息错误）。\n\n  * 在GI烘焙中，大量的小物体会增加非常多的计算量，但是这些小物体反射的光基本上对场景没有影响。所以如果能将这些小物体排除在外，只接收间接光，不反射光，可以将预计算的时间减少很多。这也是光照探头针对GI的一个优化点。\n\n## Ref\n\n<https://zhuanlan.zhihu.com/p/38550884>\n<http://www.ppsloan.org/publications/StupidSH36.pdf>\n<http://cseweb.ucsd.edu/~ravir/papers/envmap/envmap.pdf>\n<https://zhuanlan.zhihu.com/p/153352797>\n"
}
