tags: Unity 視覺效果

reflection probe

在Unity中,Reflection Probe是一個元件,用於模擬場景中的反射效果,使場景呈現效果更為真實。

生成一個反射區域,並在該區域內捕捉到周圍物體的反射訊息。當攝影機在該區域內渲染時,Reflection Probe元件可以根據該訊息生成相對應的反射貼圖,使得周圍物體的反射效果更加真實。

  • 先將其添加到場景中
  • 設置其作用範圍(可以被捕捉反射訊息的範圍)

為了使反射效果更加真實,Reflection Probe通常需要包含要反射的內容顯示反射的物體
設置Reflection Probe的Type屬性,可以選擇即時渲染烘焙(Bake),如果選擇烘焙,還需要手動點擊Bake按鈕生成反射貼圖。


  1. 加入建模鏡子 (顯示反射的物體)
  2. 新增一個material,調整metallic map、smoothness使數值接近1,然後拖曳至鏡子
    記得將下面的advanced裡的specular highlight取消勾選,不然鏡子裡會多一個光圈(影片忘記取消了)
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  3. 新增light中的 reflection probe,拖曳至鏡子的位置(位置高低會影響反射的角度)
    調整type為real time,
    refresh mode調為every frame
    time slicing調為 no time slicing
    將下方的cubemap capture setting中的resolution從128改為1024(數值越高鏡中的反射物體越清楚,但會使系統效能增加)
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

參考網址應用

  1. 定義
    使表面光滑的物体反射周围的环境光。适用于玻璃、金属、塑料等材质。

  2. 步骤
    建立反射區域:工具列 > GameObject > Light > Reflection Probe
    設定該物體的Reflection Probe元件,設定其作用範圍。必須同時包含要反射的內容和顯示反射的物體
    設定Type為realtime等於即時渲染。如果選擇bake,則必須點擊下方的bake按鈕
    建立反射物體,給物體指定帶有Smooth屬性的Shader,並將值設為1。
    ————————————————
    原文链接:https://blog.csdn.net/lengyoumo/article/details/105473403