You are currently viewing Unity Rendering Note4 – Reflection Probe

Unity Rendering Note4 – Reflection Probe

  • Post category:筆記
  • Reading time:6 mins read
  • Post author:

Reflection Probe是Unity中時常使用、十分重要的工具,但它的功能卻常常被誤會,在剛接觸到Reflection Probe時,我對它的理解是「在其範圍內的物件,可以反射周遭靜態物件」,甚至自作聰明的把它掛在角色下成為子物件,跟著角色移動…
這樣的解釋其實並非全錯,只是差在反射的原理不構清楚。Unity中的反射並非物理意義上的反射,簡單的說,是將環境變成貼圖,貼在物件上,一般來說,這個環境貼圖就是Skybox。
如果將這個環境貼圖稱作反射球,Reflection Probe的功用是改變反射球

在Unity,所有物件都會無條件的反射Environment Reflections中的Source,也就是說即使是在室內中的物體依然會反射Skybox,這樣會很不自然。 因此,在室內、或不該被天空照射到的地方,要使用Reflection Probe將反射球改變。

先用Cube搭出簡單的室內場景,可以看到中間的Sphere雖然有變暗,但依然反射Skybox。

加了Reflection Probe後,物件就會反射Reflection Probe範圍內的靜態物件

至於反射的方法,可以想成是將方形範圍的六個面,變形壓縮成一個球型,並貼在物件表面。
(如果對詳細原理有興趣,可以搜尋Cubemap,Skybox本身也有用到差不多的原理。)

當物件一進入Reflection Probe,反射球就會立刻被改變,因此Reflection Probe的範圍十分重要,如果範圍太大,物件還沒完全進到室內就會先碰到,換成室內的反射球。 因此可以多複製幾個,讓反射球從室外到室內是漸變的。

補充一下物件同時碰到多個Reflection Probe時,該如何處理。

物件的Mesh Renderer中有4個選項可以選。

  1. Off:不受Reflection Probe影響。
  2. Blend Probes:混合,但不包含Skybox,一般用於室內。
  3. Blend Probes And Skybox:混合,包含Skybox,一般用於室外。
  4. Simple:只使用權種最高的一個Reflection Probe。
Blend Probes
Blend Probes And Skybox
Off
Simple

另外,預設的Reflection Probe只能反射靜態物件,要反射動態物件,必須將Type改成Realtime;Refersh Mode改成Every Frame就能每幀更新反射球。 (下圖方塊是動態物件。)



最後統整一下Reflection Probe的重點:

  1. 用於改變反射球
  2. 同時碰到數個Reflection Probe時,在Mesh Renderer中調整效果,包含是否反射天空。
  3. Bake模式只能反射靜態物件
  4. Realtime模式可以實時更新反射球。
  5. 推薦一個優質的Youtube影片

by Steven

This Post Has 8 Comments

  1. 362

    If some one desires exper view regarding blogyging then i advis
    him/her tto pay a qquick visit this website, Keepp
    up the good work.

  2. 527

    Pretty! This wass a really wonderful post. Many thhanks foor providing thse details.

  3. 376

    Outstanding story there. What happened after?
    Goood luck!

  4. 518

    Whhat a tuff of un-ambiguity and preserveness off
    valuable knowlege on the topikc off unpredicted emotions.

  5. jablex.com

    you’re truhly a jusxt rigt webmaster. The web site loading
    pace is incredible. It seems that you’re dling any
    uniquie trick. Also, Thee contennts are masterwork. yoou hawve done a wonderful actvity oon this matter!

  6. 619

    Attraactive component to content. I juhst stumbled upo your web site and iin accession capital tto claim thaqt I get iin fact enjoyed account your weblog posts.
    Anyway I will be subscribing on ylur augvment annd even I success you geet entry too persisxtently rapidly.

  7. I lopved as much as you willl recxeive caried out rifht here.
    The sketch is tasteful, your authored materrial stylish.
    nonetheless, yyou command get bought ann edxginess over thaat you wis
    be deliverig the following. unwekl unquestionably coje furether formesrly again sincce xactly thee sae nearrly a lot often inside case you shield thijs increase.

  8. dev.xxxcrunch.com

    Hello! Thiss is my first visit too your blog!
    We are a collection off volunteers and startin a neww project inn a community iin thee same niche.
    Your log provided uus valuable information to work on. You have
    done a wonderful job!

Leave a Reply