vray教材總匯[轉帖]

vrayvray使用了一段時間,最近研究了一下fr, 發現 vray的參數和 fr都差不多, 結合以前研究的 viz4 , insight 將最近的研究結果寫出來,
以下黑色的部分為 vray, 紅色的部分為fr, insight, viz4的相關內容
至於那個渲染器好, 它的優點是什麼, 那就要看你使用后的感覺了. 這不是本文探討的內容之列, 而且我認為沒有必要在此花費時間, 我覺得用精用好哪一種都行

1. 關於渲染器的多邊形面數及圖幅問題
 再沒有使用vray之前,我們首先建立一個概念,vray的參數設置與渲染出圖的圖幅大小相關.同樣的參數,對於一般抗鋸齒AA, texture AA來說, 圖幅越大精度越低
對於GI計算結果來說,圖幅越大精度越高.

viz4, insight GI計算的精度, texture AA的精度與圖幅無關, 同樣的參數, 3200x2400與320x240的精度是一樣的, 同樣的參數,對於一般抗鋸齒AA, texture AA來說, 圖幅越大精度越低
fr的相關情況還不太清楚

2 . 安裝:
1:請下載最新版本
下載地址: http://www.51cad.com

2:將.....40.DLL文件拷貝到3DMAX下,將.....40.DLR文件拷貝到PLUES
下就可使用。
注意: 這個外掛程式好像設置了使用期限,過期后將日期調回去應該可以使用,但后面的版本我就不知道開發人員會不會加什麼祕密武器在里面了,我的日期是在之前所有版本的限時快到時調到2001年的,所以一直都沒出什麼問題,呵呵!
Fr, viz4, insight 的安裝程序, 安裝方法, 及解密程序http://www.51cad.com均可找到, insight不解密, 只有一個月的試用期

3. v-ray全局照明GI的打開
建立場景,認為材質和攝影角度滿意后,在功能表Customize\preferences\Rendering\Current Renderer中將渲染器設為 vray
這一步驟和 insight渲染器的設置方法是一樣的。

2、在渲染功能表中,在indirect illmination(GI)下,勾選On, 就可以渲染出最簡單的GI效果來。
打開fr的GI方法:
2 選擇所有物體, 勾選

.勾選

4 AA選項的打開
是不是發現物體邊緣有很多鋸齒邊?下邊再勾選Image sampler(Anti-aliasing)中的 adaptive
關於 vray的AA計算
我個人的經驗, 圖幅3200x2400的AA為 2, 4 , 3, 5 ------ adaptive AA, 對於vray的預設AA值, 640x480的圖幅, 其精度都十分勉強

注:  vray官方論壇有人認為 interp比 hsph大許多會使圖像變的光滑, 實際上是使間接光下的光效(比如焦散, 間接光下的凹凸貼圖, 間接光下的陰影, 被遮擋處一些陰暗面)的邊界變的光滑.換句話說,低配置的GI(max/min hsph)及Interp不會影響材質及貼圖的表現, 只會影響光照資訊貼圖, 這是渲染圖往往看起來很平

你要是發現一些角落的貼圖或材質表現不清楚, 或整個圖顯得灰蒙蒙的,
加大GI參數是沒有用的, 見大 AA參數可改善這些情況

與fr, insight, 等GI渲染軟體一樣, vray計算速度的瓶頸在 直接光照的AA計算上, 圖幅一大, AA計算特別耗費時間

根據我個人的經驗, 由於預設值的關係,對於一般室內場景,場景中有的角落材質細部有問題, 只要加大Image sampler (Anti-aliasing)的值就可以了

FR的抗鋸齒選項: 有兩處
一般抗鋸齒選項(全局)見上圖
fr的預設選項一般設的太高, 可調小它
下圖 supersample 只針對材質(打開supersample時, 全局aa的 min/maxk可為 1/4
以節省時間

、 VRAY的渲染參數面板中, 有一個環境Environment, 只有兩項
一個是Environent color(環境顏色)選項 ,它的作用就像一盞燈一樣,顏色和燈光強度可設置。當使用一幅圖時,燈光的顏色與貼圖來自這幅圖. 使用巴西的免費外掛程式, 可用HDRI貼圖照明
要得到天空光效果也很容易,打開G I后,在MAX環境功能表中把缺省的黑色改成一個蘭灰色,或者給它一個球形環境貼圖這樣我們就打開了全局照明, 渲一遍試試

注意: 注意: 1. 使用一幅貼圖照明, 有必要將貼圖的 output 加大 3-5,否則場景太黑
2 假如不勾選覆蓋max環境貼圖, 否則背景將不出現max環境貼圖
fr也是這樣, max的environment及本身GI下均有 environment選項, 它的作用就像一盞燈一樣, 顏色和燈光強度可設置。當使用一幅圖時,燈光的顏色與貼圖來自這幅圖. fr可直接使用HDRI貼圖照明
過程就這麼簡單,但經驗還要慢慢陪養喲。

v-ray 入門(1)——全局光照明

我個人的理解, vray 將渲染計算分為兩部分

第一部分 計算漫反射階段 ( 打開GI )
vray有兩種方式可可供選擇來計算漫反射
直接強制計算,計算結果直接與直接光照結果混合計算. 這時屏幕不出現I-map圖
注意: 一次反射, 二次 及二次以上反射的計算方法不同, 對於一次反彈, 加大subdivs
渲染時間爆增, 對於二次及二次以上反彈, 加大subdivs則渲染時間增加的不如一次
反彈來得明顯

2) I-map計算方式, 將計算結果變成一種貼圖 I-map
map是一種光線貼圖,它主要是表現漫反射的光照,與材質(shade)表現,貼圖表現光線跟蹤材質及貼圖並無直接關係,控制這些表現的是 vray中的Image sampler (Anti-aliasing)下的參數. 也就是說:Image sampler (Anti-aliasing)下的參數不光控制著抗鋸齒效果, 也控制著材質及貼圖的表現
   
下圖為vray的I-map
Fr的I-map(紅色方塊為一個pixel)
在進行I-map的GI計算時
第一步  vray從光源分別對場景發射向每個pixel發射出出 hsph個光線, 每條光線碰到 場景中的物體后,根據I-map上的材質特性進行了反彈, 一次反彈的mul值實際上是的第一次反彈光線的強度,飽和度,亮度前面的放大系數
 第二步  第二次反彈的sub確定反彈光線的個數, 假如 hsph為10, sub 為1, 那麼就是說第二次反彈中,10條光線反彈才反跳出一條光線, 三次四次反彈與二次反彈的光線相同. 當hsph為10, sub為20, 二次反彈中,10條光線反彈才反跳出20條光線, 三次四次反彈與二次反彈的光線相同
 注意: 二次三次反彈的計算方法與一次反彈的計算方法不同, 增加sub 
     值, 渲染時間增加不多, 建議hsph=sub
   反彈幾次由參數depth確定, 二次三次反彈前也有放大系數 mul
 第三步: vray在每個pixel上取 insterp個採樣點, 將光照資訊存入 I-map,在render時,在這interp個採樣點上,以貼圖的方式插入渲染結果
注意: I-map與相機視圖相關,移動相機,I-map必須重新計算,
    在動畫中, vray一般每10幀算一幅 I-map 

vray中參數對渲染時間的敏感程度有大到小為: max > min > hsph > Clr thershold 和Normr thershold > depth > sub > interp
vray與fr均可對 I-map進行存入和取出, 再取出計算時, 有個先決條件, 那就是I-mapsh是針對視圖與相機的, 只有場景中的物體, 燈光, 相機或視圖位置不改變,才可將存成的I-map文件取出利用,你可將320x240的I-map取出給 3200x2400使用
上圖為fr下圖為 vray的 I-map的存入與取出
你可將400x320圖幅的I-map用在800x640圖幅上, 或 1600X1280 上, 當然,
假如第一幅圖的 max/min 為-2/-1, 將I-map用在800x600 1600x1280的圖幅上, 其精度相當於 max/min -3/-2 -4/-3

第二部分計算 render階段
直接光照(與max的掃瞄線渲染作用相同), 這時還計算cauris, 反鋸齒, 運動模糊等等, 將 I-map插入場景

直接光照是 render 計算
有兩種方式進行全局光照,
直接計算,速度極慢,但gi光照效果準確, 細節真實, 在動畫中也不容易出現閃爍現象. 注意:對於一般的建築室內場景,直接計算消耗時間太長,對於室外場景,由於反彈次數少,可用它進行計算
模擬計算,在原渲染結果上附加一層光照貼圖I-map(vray快速gi的祕訣),
fr的計算方式
..
直接計算方式時間特長, 一般rh-ray不大於32, deffuse depth不大於2

1/8 1/4計算方式容易殘生黑斑, 但速度較快, 一般用來進行草稿渲染
正是出圖建議使用 1/1方式, 特別是室外場景
將光線貼圖插入場景的方式有三種, (見vray附帶說明書 ), 一般使用第二種即可(vray預設), 第三種插入方式最準確, 表現材質貼圖最準確,但是要求採樣值(hsph)及interp最高.

全局參數的設置:
1. Max rate 參數與Min rate參數
我的理解:
此值表現光線分布的層次 , 它將屏幕分成一個各社區住宅pixel,光線對每個小塊採樣計算, 仔細觀察一下, 就可發現每個小塊pixel的亮度, 顏色是相同的, 因此, 小方塊越小光線過渡越光滑,層次越自然,豐富。
一般說來,要表現間接光下的陰影, max/min的值就越高
注意: min的值絕對控制著渲染的時間, 加大 1, 渲染時間增大4倍

2) max/min確定后, 渲染時間與場景渲染出圖圖幅有關, 圖幅越大, 渲染時間越長. 也就是說 800x600的圖幅在其他參數都相同的情況下, 渲染時間是400x300的4倍
假如 max/min為 –3/-2 , 圖幅為800x600, 在其它參數相同的情況下, 渲染時間與max/min為 –4/-3 圖幅為-4/-3的渲染時間完全相同. 但是由於 800x600 max/min 為-4/-3 的圖 ,由於pixel的尺寸比前者的大,容易出現黑斑, 這時需要更大的hsph來消除黑斑,也就是說, hsph只與 max/min相關,與圖幅大小無關
所以, vray作者推荐 先用小圖幅渲染I-map, 存盤后,用大圖幅真實出圖,記住這時要將I-map取出
為什麼圖幅越大,GI的精度越高呢?這是因為 max/min一定, 小方塊的絕對大小就定了, 這時, 假如將場景傳染出圖的圖幅設置的很大, 相對小圖幅的設置來說, 小方塊就多了.
注意: 對 800x640的圖來說, min 為 –1, 一般來說精度已夠高了, 這時渲染時間一般在 1-2個小時, min為0 時, 渲染時間變成了原來的四倍,這時,渲染時間已與直接計算方式相同 有人抱怨說, 圖幅為 4000x2000 max/min為 預設值 –2/-1 ,渲染時間長的受不了實際上是建渲染設置的太高了

Min rate 參數控制細分方格(pixel)的最大值, 在I-map圖上, 它對場景中平坦的部分進行採樣.
Max rate 參數控制細分方格(pixel)的1最小值, 它對場景中邊界,轉折處, 曲面
部分進行採樣
一般說來, 場景中平坦部分. 光照變化均勻部分的pixel應該少些
邊界,轉折處, 曲面, 光照變化不均勻部分的pixel應該多些

Mn rate 參數控制著開始細分計算正方形(pixel)的絕對大小, 渲染計算時, 渲染視窗中會出現一個個小方塊對場景進行細分,出圖尺寸越大, 小方塊的數量越多,
比如, 640x480的小方塊數就是320x240的四倍,

剛開始出現小方塊的大小與Min rate的值相關,其值越小(一般為負數, 絕對值越大) 方塊越大,花的時間越短. 第二遍細分計算小方塊會一分為四
最后一遍計算時的方塊大小由Min rate決定
Max rate 主要控制場景轉折處的光線採樣
Min rate 主要控制場景平坦處的光線採樣
一般來說,模擬計算gi 時渲染時間主要花在光照貼圖的計算上了,計算遍數或者說幾幅光照貼圖 =(max rate值-min rate值 +1),

一般來說, max產生的小方塊應該比場景中需要表現出光效的物體的最小面要小
max越小, 光照情況越準確,精細

計算I-map, 實際上就是用一堆 大小從max到min的小方塊來拼接間接光照圖, 每個方塊pixel的計算時間是相同的, 每個pixel的亮度也是相同的
min-max+1 確定了我們有種 不同大小的方塊
min max決定了方塊的絕對尺寸大小

由上面所說的我們可得出下面的結論

1) I-map尺寸(也就是渲染出圖尺寸越大) , 需要的 小方塊越多, 小渲染時間越長
2) 對於每個 pixel來說, 小方塊尺寸越小, 在保證不出現黑斑的情況下, 要求落在
它上 面的光線也就越少, 當然, 這些光線也要分布的均勻一點
也就是說, max/min越大, hsph可以越小
那麼然和才能讓更多的光線落在 I-map上, 而且更均勻呢,
第一個辦法, 加大 hsph,
第二個辦法, 加大二次反彈中的subdivs,
這兩個辦法並不使圖面亮度增加, 我還發現, 加大 subdivs渲染時間增加的並不多
而且光線分布更均勻, 不容易出現黑斑
vray這一點是符合實際情況的, 光線的第一次漫反射光線強度較二三次要強, 而且還有一定的方向傾向, 二次三次反射光線數量較多, 但總亮度不大, 而且射向四面八方, 分布十分均勻

第三個辦法, 加大反彈次數, 但是這個辦法可使圖面的亮度, 飽和度增加了,
而且不太符合實際情況, 使圖面顯得不太這真實
對於室內一般場景, 光線一般反射6次就可忽略不計了
對於室外一般場景, 光線一般反射2次就可忽略不計了

顯然, 我們希望 小方塊pixel盡可能少, 而且能將光照圖的亮度層次變化表現出來
那麼, 我們是如何來放小方塊的呢 ?
場景平坦的地方, 光照層次變化不大的地方放大方塊來表現
邊界處, 曲面, 凹凸處放小方塊來表現
亮度變化大的地方放小方塊來表現 ( 間接光下, 一般亮度變化不大, 除非一些間接光下的陰影處, 凹凸貼圖處, 被物體遮擋的陰暗處,向光面與背光面才有用亮度變化

vray是如何做到這一點的呢
第一遍, vray將所有I-map 鋪上一遍 由min確定的大方塊pixel, 對每個小方塊進行光線跟蹤計算
第二遍, vray將所有上一次計算的pixel一分為四, 以用兩個判斷條件, 判斷這四個小方塊是否在 物體的邊界處 , 曲面上, 凹凸處, 光照情況變化處…….
假如是, 那末就對此小方塊進行光線跟蹤計算
不是, 次小方塊的光照資訊採用上一級小方塊的光照資訊
第三遍, 第四編同第二編計算一樣, 依次用判斷條件進行判斷計算, 一直到pixel
的大小達到max的要求就停止了
vray靠這種方法, 在場景物體的邊界處 , 曲面上, 凹凸處, 光照情況變化處……放上了應該放的小方塊
那麼, 這兩個判斷條件是什麼呢? Clr thershold 控制pixel是否在光照亮度變化處, Normr thershold判斷pixel是否在場景物體的邊界處 , 曲面上, 凹凸處.
Vray 還有一個參數 show adaptive , 就是為了讓人們了解pixel的計算情況, 第一遍計算是正常顏色, 第二遍計算是綠色, 第三遍紅色, 第四遍藍色>>>>
根據這些顏色分布, 我們可知道 pixel在場景中的分布
'Show adaptive' colors the GI samples based on the irradiance pass when they were computed. The samples from the first pass are with normal colors, those from the second pass are green, from the third is red, the forth - blue etc.

In this way you can see which parts of the image need more GI samples. It will not show where the samples are - you can see this while the irradiance map is being computed. You can also view the individual samples if you save the map and then render with the map loaded from file and Interpolation samples set to 1.

2 其它參數
Hsph subdivs: vray在計算間接光照時, 光源朝各個方向發出一定數量Hsph subdivs個光線,這些光線照到場景中的物體后, 反跳出同樣數量的光線,這樣再進行反彈, 直到達到規定的反彈次數(二次反彈深度系數決定).
最后, Vray計算貼在場景中各個物體表面的I-map上的光照資訊.
在I-map上, vray是靠 interp 個點來儲存光照資訊的, 在進行render時, 又用interp個點來將光照資訊一環境貼圖的方式插入到render階段的場景中的物體上去.

  注意此值表現光線漫反射光照(不是材質及貼圖)的真實程度精確程度,加大它肯定會增加渲染時間,但是可增加圖面漫反射光照的精確程度,真實程度, 減少圖面的斑點,一般來說, 加大到圖面沒有半點就不要增加了
 設置 hsph值的原則, 在 min確定的pixel下圖面部分不能有斑點

Vray推荐的最佳值:
當max/min –3/-2 (vray預設值) 時 , Hspr採樣值為預設值為15.
我的經驗, 640x480的圖幅, Max/min為 –4/-3時, Hspr採樣值為 25, interp 為 27
即可滿足要求
hsph與insterp的作用主要是消除圖面出現的雜斑,hsph太大沒有必要,增加它會顯著增加渲染時間 . max/min越小, 不出現黑斑的hsph越小
Interp. Samples 此值為光照貼圖加入原渲染結果的採樣數,加大一點,不太影響渲染時間, 在I-map和 render階段, 此值都參與了計算
注意, 存儲I-map文件或一氣呵成計算I-map時, hsph 與interp均對I-map結果有影響, 但從文件中取出I-map計算GI時, 只有interp參數起作用, 對GI渲染結果有影響, 其他參數均失效, 不起作用, 一般情況下, 此值與hsph相同或hsph大一點, 比hsph小就會丟失光照資訊
(此值為光照貼圖加入原渲染結果的精度,可設大一點,不太影響渲染時間)

當此值比hsph大許多時, 比如 Hsph 15 Inter 100 多余點的亮度值是程序根據插值運算法則來計算的, 它並不真實, 實際上使 I-map變光滑了(但並不影響shader及貼圖的表現), 與insight 和viz4中的filter作用相同.
注意: 假如interp 比hsph大許多, 焦散, 間接光下的凹凸貼圖, 間接光下的陰影, 被遮擋處一些陰暗面很可能失去
如果它比hsph小就會丟失光照資訊.
        
假如圖面出現黑斑, 斑點, 加大Inter可以解決, 比如: hsph 20 但是 interp 為 100, 圖面絕對不會出現黑斑

漫反射的結果I-map 可保存為文件, 下次計算時(打開gi)可取出. 這樣你就不用再計算了
          在這里有必要再強調一下vray的特點: 
vray的參數設置與出圖大小相關.對於貼圖及材質表現,圖幅越大精度越低,對於GI參數,圖幅越大精度越高

Clr thershold 和Normr thershold
Vray的GI優化參數,根據 vray原作者的回答, 減少它會增加採樣數, 增加渲染時間
根據我的理解, 這兩個值的含義為,
vray在進行gI計算時, 現根據max 值,將要渲染的圖分成一個個小方塊(piexl), max的式確定了小方塊的絕對大小, 
第一遍計算I-map時, vray對每一個小方塊都進行了raytrace的GI運算,
第二遍計算I-map時, vray將每個小方塊一分為四,然后坐了兩個判斷,
如果這些小方塊(pixel)的RGB值及亮度的差異小於clr Threshold的指定值,那麼這個pixel上的光照資訊採用上一級的piexly已經計算的結果,大於clr Threshold的指定值, 就通過正常的光線追蹤計算來此piexl的光照資訊
2) 如果這個pixel上法線的夾角與上一級piexl上法線的夾角只差小於Normr thershold指定的值 ,那麼這個pixel上的光照資訊採用上一級的piexly已經計算的結果,大於normal Threshold的指定值, 就通過正常的光線追蹤計算來此piexl的光照資訊。
一般說來物體的邊界在第二次計算時都會被採樣重新計算
此值越小, 在場景中的邊界,角落 曲面 ,凹凸部分的Pixel計算就越精細

Vray設置這些選項原本的用意是用來來加快渲染速度. 一般說來,
場景中假如很平坦,規矩,簡單, 加大normal的值,
場景中假如五顏六色,但光照層次變化不大,將Clrj加大,甚至可到100, 關掉這個判斷條件.靠normal來對物體的邊界等法線變化出取樣
場景中假如曲面較多,減小normal的值
場景中假如平坦,規矩,簡單, 但光線變化層次較多,減小clr值,加大 normal
總之, 在進行基於max的GI計算后, 是否進行下一步的GI計算就靠這兩個參數來控制, 你可以靠它來使下一級GI在場景中那里計算
可以這樣理解 Normr thershold 控制著在場景中的邊界,角落 曲面 ,凹凸部分…….等幾何條件變化處 進行Pixel計算的敏感程度,
Normr thershold越低, 在這些部分pixel進行跟蹤計算的密度和數量就越大
Clr thershold控制著在場景中的 陰影, 凹凸貼圖, 焦散, 倍遮擋的暗處….等光照變化處 進行Pixel計算的敏感程度,
比如, 減小Normr thershold的 , 在球面進行pixel取樣計算的數量就越多. 加大 Clr thershold值, 間接光下的陰影表現就會不明顯

顯然, max = min  clr與normal不起作用
clr/normal=0時,GI計算就一點沒有優化

Secondary bounces下的subdivs和 depth
Subdivs 控制第二次反射的光線細分值 , 細分值越小, 二次反射的精度越高, 效果越好, 設為1, 每hsph個光線反跳出一條光線.設為10, 每hsph個光線反跳出10條光線 .
我發現, 加大 subdivs渲染時間增加的並不多
而且光線分布更均勻, 不容易出現黑斑
vray這一點是符合實際情況的, 光線的第一次漫反射光線強度較二三次要強, 而且還有一定的方向傾向, 二次三次反射光線數量較多, 但總亮度不大, 而且射向四面八方, 分布十分均勻

depth Depth 控制光線反射 ,反彈的次數, 一般場景不超過 5
我一般將室內 設為 subd=hsph depth 5  比如hsph 30 那末 second bounce
的 sub=30 depth=5
室外我一般設為 subd= 1 depth 1 或者關掉 二次反彈
假如是玻璃, 應該大一點, 一般為 5

關於燈光 一次反彈與二次反彈的 Muliplier值問題 
   一次反彈及二次反彈的 Muliper不僅控制著漫反射光的亮度, 還控制著漫反射光的顏色飽和度
1、非封閉空間,由於沒有很多物體做光線的反射,缺省的一次、二次反彈值都是一樣的,這樣可以彌補空間散失的反射光線。
    可以出效果,但是我覺得這樣的效果很平淡。(建議不要這樣用。)
  
2、非封閉空間,可以利用環境貼圖做為補充照明,所以要把二次反彈值減小。(建議這樣用)要點是把環境貼圖和二次反彈值聯合在一起考慮。
  
3、封閉空間,環境貼圖已經不起作用了,但是物體已經可以形成足夠的二次照明,所以如果還是用缺省的值,二次反彈就會太亮,燈光布置足夠多的時候,連一次反彈都會太亮。所以我的習慣是一次反彈、二次反彈的mulipier 值為
0.8 / 0.5 也可用 0.7\0.7\0.5
總之, 二次反彈的mulipier 值一般不大於1 , 要不然室內就像一個老君爐, 映色太厲害
假如房間有個紅地毯, 整個房間太紅了
根據我個人經驗, 將二次反彈的 depth值設為5, 整個房間光照要勻稱的多,也比較自然

  vray說明書推荐使用第三種 Image sampler (Anti-aliasing)的方式Adaptive subdivision, 這種方式的好處時渲染時間快,但是,它的Anti-aliasing力度沒有Simple two-level來的大, 我發現渲染大圖時,用Simple two-level加大參數渲染要來得快 

3. 燈光參數的意義
On 這不用說了吧

Double-sided 確定燈光是否兩面都發光。

Transparent 不選中時,燈是可見的。選中時,燈不可見,可以用來模擬天光,視窗
的進光

Ingore light normals 預設狀態下,由於採樣數太低, 將陰影區將產生麻點,即使不在陰影中的區域內, 有時也會產生麻點 。勾選中后vraylight照射的麻點會少點,(但物理上是不正確的)

No decay – 勾選不衰減

Store with irradiance map – 將光照結果保存在光照貼圖中, 這在渲染游曆動畫很有用。

U , V , W, 目前只有平面矩形燈, 球狀燈, 正式版本后燈的類型會多點
Subdivs - this controls the quality (graininess) of the shadows. Greater values will produce smoother shadows. The parameter determines the number of samples (per pixel) that VRay will make in order to calculate the shadows (actually, this parameter is the square of the number of samples). VRay may send less (but never more) shadow rays when possible without loss in visual quality.
控制陰影的質量。大點會光滑一點。

Low subdivs - this is used instead of Subdivs for irradiance map calculations and also when the level of a ray becomes greater than the degrade depth (see below). Each intersection of a ray with a surface increases its ray level by one. For example reflections typically increase the level of a ray by one, and refractions - by two, since the ray needs to pass through the front and the back surface of the refractive objects.
這個看不懂,呵呵。

Degrade depth - this is the ray level after which Low subdivs will be used instead of Subdivs. In the recent version of VRay, sampling is to a large extent handled automatically, so you can set this to a large value without performance loss.
這個好像說沒用。嘿嘿。

normal lights are computed separately from the GI. Only VRayLights that had the "Save with irradiance map" option turned on will be saved with the map
小技巧:
1. 要獲得較理想的光照效果還必須打開二次光照反射,速度將會急劇的下降 二就是加大min rate和max rate(最多到-2,-1,再加大就像brazil一樣了),或在rate為-3,-2的情況下加大下面的Hspr細分值(預設為15,到25~30為佳,再大也會像b razil一樣了……………… )!
調試過程中可以暫時關掉二次反彈,正式渲染的時候再打開,不建議關掉二次反彈換取速度,會少很多效果的。
  出現黑斑的處理方式: 加大Irradiance里 Interp的值。
  
2 即使是單色的物體,比如白墻壁,都不要僅給它MAX的基本材質,在DIFFUSE里給它一個白色的貼圖圖片,可以減少產生黑斑。

3, 草圖計算時, 可先用 320x240 圖幅計算光照貼圖, (用此方法可加速, 也可將Min rate值設低, 例如為 –2 達到較好精度 ), 將光照貼圖存盤,

v-ray 入門(2)——景深

1、參考建立場景,並開攝影機的Environment Ranges下的show選項。在數值里填上合適的數值,這些數值控制取景範圍。你會發現在視圖中,有條黃線會隨數值的更改會移動,根據調Near數值盡量把黃線放在Camera.target附近。當然也許你的場景中的Near數值會我不一樣,沒關係的。(Camera.target的位置其實代表的就是興趣點,也就是渲染完最清晰的那部份)

2、打開渲染設制,在Filtering/DDF卷展欄下,勾選在Depth of field下的ON選項,然后在Focal dist里填入剛才那個Near數值,這樣就決定了興趣點的位置。也可以勾選Get from camera(直接從攝影點獲取興趣點),如果你勾選了Get from camera那麼剛才的Near數值就不起作用了。(是不是有點多此一舉?如果你做的是靜帖,那麼直接用Get from camera好了。)

3、 下面有兩個數值值得注意。
Shutter size:它控制著取景深度,如果把這個數值調高的話,那個景深的程度會更大些。(效果上看,更模糊點。)Subdivs:這個數值控制著景深效果的極別,把它調高的,可取得更理想的畫質,(圖3是Subdivs=3的效果,圖4是Subdivs=10的效果。當然會增加渲染時間。我認為最后渲染時,至少要把它設為8以上。

4. 焦點模糊速度很快。
  A區是設置焦點模糊的,勾選ON就可以打開了,第一個按鈕是設置焦距的
  下面的勾,選取后就是以攝影機的落點為焦點。下來是快門的光圈尺寸,和現實中的攝影機一樣,光圈越小越清晰,越大景深越
淺越模糊。B 區是過濾方式,選項很豐富,自己慢慢去試吧。評價是可用、好用、設置簡單、速度飛快。

v-ray簡單入門(3)——焦散。
要作出焦散效果: shadow要用vray shadow , 反射和折射貼圖都要用VRAYMAP才行

焦散的參數簡單得只有4個參數
Sph Subdivisions
越大越真實, 注意, 其值大小的2倍與渲染時間成正比
Multipler
越大焦散效果越明亮
Search Dist.
焦散光子的追蹤影響的範圍值, 調小了就會一個一個的光斑很明顯,如果大一點速度就會明顯下降,但是效果很好。

Max Photons
控制焦散效果的清晰與模糊, 越大, 越模糊, 其值為15時, Sph Subdivions 大於6000后才起作用, 但這時的焦散效果並不是太好

1. 勾選參數后,加大MULTIPLIER值到60000左右就可以出效果了,你顆狠心將其加到100000(最大值), 其速度仍然飛快.
注意: 渲染時間的平方與sph subdivs參數值的兩倍成正比

2. 還有個辦法是加大燈光的亮度然后調整燈光的衰減值,根據其官方範例的的燈光設置時,用vray light 將燈的強度調到20,000以上例如600,000,再打開燈光的指數衰減, 但是我想說的是如果這樣設置將使燈光的擺放位置成為問題,因為有了衰減,燈離的遠些就會使場景迅速變暗,而更糟糕的是就會出現你渲染的圖里那種很亮的邊緣(靠近燈光)而另一邊很暗。 當然也有有辦法可以解決此問題,就是燈光使用預設強度(一般為1.0),再到Vray渲染面板, 在散焦一欄里將強度(英文是Multiplier)設為800000左右,就可輕松設置燈光了!歡迎指教!!

前一個方法簡單一點,我常是兩者合用。我發現它的好處是焦散的效果似乎能落在透明材質本身里面,這樣玻璃的效果非常好。

v-ray簡單入門(4)——材質的制作
vray中自帶的材質主要是vray不支持max中的raytrace材質, 它的功能與raytracee相似, vray支持raytrace貼圖, vraymap的作用與raytrace貼圖作用相同, 但是使用vraymap, 速度更快,效果更好, 特別是計算焦散.

金屬的制作: As for the metal material, set diffuse color to be a dark to very dark grey - VRay reflection map to almost white, say 80 - 85% white and glossiness 20 - 40 depending on how soft you want. Glossy samples should be at least 6 but 8 provides a nice smooth result with just enough noise to create a shimmery feel. I'll do tests at 4 samples just to get quicker idea. The nice thing about now being able to save irradiance maps is that testing refections and refractions is much faster.
玻璃的制作:
you can do fast, realistic thin glass just by making a transparent material with in IOR of 1 and Fresnel reflectance with an IOR of 1.6 or so - but until VRay gets itself a proper, integrated material, it won't look quite right with GI and caustics - but it doesn't do that yet anyway.

well. for architectural renderings, I've been using architecturalglass (doh!), a free s cript/material that quickly helps you make good fast rendering glass by automating the task of getting up and running those falloff maps one should use when making realistic glass. The only thing you've to do by hand (because it even has preset parameters| remember to click on faloff and shadow maps boxes to get them generated) is to change the generated raytrace map for a vray map, so it gets realistic reflections rendered. The fresnel parameter works nice with scanline, and you'd have to do the same thing with the map (change it to vray map and set it to refraction). Get it at www.s criptspot.com Works well for me

Almost, but not quite. The standard MAX material actually doesn't decrease diffuse intensity when reflect intensity is high - that's one if it's big *problems*. The Raytrace material does - a 100% reflective material has 0% diffuse intensity.
For glasses and highly reflective metals, diffuse should always be pure black - *all* the surface appearance comes from reflection/refraction. To get colourised glass/metal, you need to tint your opacity colour (change it to colour if it's on value), and your reflection colour. *Diffuse should be left at black* - lambertian shading models (aka diffuse) are *totally* f!cked up for glasswork and very reflective metal, and make it look *bad*.

Gold silver and chrome are all tinted highly reflective materials. The environment and the model shape gives the metallic look.
Water has fresnel reflectance properties, and an IOR of 1.333 - this means you need a falloff map in your reflection intensity that has an IOR of 1.333, and a material IOR of 1.333. If you are using a Vray material that should do the trick, otherwise, VRay maps + standard material requires a inverted map like that for refract intensity.

While water materials can be slightly tinted, do not make the colour too blue - normally, pure water is pretty colourless stuff (your glass of water isn't bright fluorescent blue, so neither should your CG water be...).
Though for a plastic earth you might want to put a fresnel reflection in - plastics do reflect in a fresnel way, and fresnel reflections are still a great tool for realistic glass, ceramics, and plastics, they just aren't really for metals... so that earth globe might look even nicer with an IOR 2 or 3 fresnel falloff on its blurry reflections...
704.10 in reply to 704.9

Q: For the fast glass you were talking about, should I use vray material, vray map, or just fallof map with a standard shader.
A: Vray material is best, if you can. It is by far the most painless route. For various reasons, you may need to use other techniques - I will explain those 

- If it's a standard shader, what kind would you recommend, wich colors for the faloff map, how much of reflection, should i use other maps such as opacity or refraction? (considering a medium blue tinted glass panel), is it possible to get this shader work as a mirror when it has to (don't know much about physics, guess when you look at certain angles)

There are 3 things you can do:
1) VRay material. As I said, this is the best option. Basically, start with a plain vanilla VRay material, make the diffuse colour black, and any specular stuff turned off, set the VRay material's IOR to 1, then drop a falloff map in your reflect slot. Set the falloff map to not use material IOR (though I don't think it does by default), and set the *falloff* IOR to 1.6.

Bingo, working phyisically realistic material. It should look great when you stick it onto your planar glass, as long as your glass is in an interesting environment and so forth

2) Standard + VRay map. A little harder, but not too much more. Start with a plain vanilla Standard material, then set diffuse and specular to 0 - this should look completely flat black. Set material IOR to 1. Set a VRay map in the Reflect slot, should be set on reflect already, but if not, do. Set a VRay map in the Refract slot, set to refract. Set filter map in the Reflect one to Fresnel, IOR 1.6. Set filter map in Refract one to Fresnel IOR 1.6 (but not the same map), then swap the black for white and vice versa. Voila! Problem solved.

3) You can use a standard map with fresnel falloff and some kind of reflection map in the white slot if you don't need raytracing. This is a lame cheat, looks bad, and there is no reason for it if you have VRay except in exceptional circimstances.

This should make your planes look like glass - note that the reflections on glass are pretty damn subtle - that's why we use the stuff as windows - you can see through it. So it can be hard to see - a lot of what looks "glassy" is really the distorted refractions, and bumps in the glass - even in a pane of glass, the stuff at the edge refracts in more interesting ways. Trouble is, with this technique, bumps only affect the reflected component, when you really want the refraction getting bumped a bit.

Anyway, you may find the subtlety of the reflections is too high, so feel free to change IORs around and stuff - basically, it should act like realistic, ultra thin glass, but that may not look glassy or right for your situation - so stuff around for what works. Maybe use perpendicular maps instead of fresnel (though that is not really realistic at all, technically), or a IOR of 3 or 4 in your slot.

- and last but not least, is it faster/better to use a 3DFACE to represent those glass panels. would the recommendations change then??
I don't know quite what you mean by this - do you mean a box instead of a plane? Using boxes instead of planes is more realistic but slower. If you use a box instead of a plane, make sure you set your *material* IOR to 1.6 or so instead of 1, but otherwise, it's all the same. Usually the planes-with-1 looks much the same as box-with-1.6, but if you want bumpy refractions (reflections work on both), or need the extra realism, use the boxes - general idea is, try both, use the fastest one that looks right 

PD: If someone wants to help sending his glass material would be great!

Droogy has a really good glass material around somewhere - but I'm not sure quite where, I'm afraid... it's a realistic glass material, along the lines of this one, but prepackaged, and it's got a main of 1.6 or something, not 1 (which is the cheat matl IOR). Only difference between cheat matl and accurate one is the material IOR (the fresnel IORs are all the same)...

For tinted glass, exactly the same material, but for all the falloffs in the filter sections of the VRay material (you know, the fresnel things), both the reflect and refract map, set the white colour patch to whatever colour you want your glass tinted to. This is the same for the cheat and the accurate material, but since in the accurate version, it goes through 2 layers of glass, your tint will look darker and stronger than in the fake thin glass one.
I'm afraid I'm writing this in a hurry with a headache, so it's probably a little incoherent, but I hope it clears things up  - sorry that I haven't posted any matlibs, but I'm away from MAX right now... and it has an out of date VRay version anyway - I had a lot of stuff keeping me off it, and I've been doing more in the way of general scene building than renders...

Hope this clears things up, and good luck with the architectural stuff. I'm sorry I've neglected to really cover the theory (i.e. why the hell do I need to do that? What's up with the fresnel stuff), but you don't need it for using a canned glass material, and I will be working on the theory side of things - wait and see 

Yes - since windows bend light rays back to basically their original path, there is minimal distortion when light goes through them.
The way to approximate this (and get fast rendertimes with minimal impact) is to make a glass material as per normal, ensuring your fresnel falloff map does *not* have the "use material IOR thing" or whatever it's called checked, set that to 1.6 or your preferred fresnel value, then set your material IOR to 1 - this tells it to pass light rays through unbent, while preserving the classic fresnel reflectance properties of glass. Then map all this to a plane (not a box, the standard for other glass, as this approximation simulates what happens when going through 2 layers (box) with one (plane)).

Voila! Realistic, fast, flat glass. There are only 2 caveats with this technique:

1) If you get close to the glass, it looks wrong - with real glass, you have thickness, and effects at the edges of the windowpane and with increased distortion at glancing angles make real glass look fairly different close to.

2) There are some other optical things going on in glass windows that are not simulated in this approximation - most notably it doesn't deal with the fact that both layers of glass spawn reflections, and the total internal reflection you get at some angles.

Nevertheless, for distant or medium range glass, this approximation is visually indistinguishable to full blown glass, and the section of your rendertime due to glass objects will be very substantially reduced - because not only do you have half the geometric complexity at each pane, you cut down a lot on recursive reflections between glass layers etc. - and while this has a minor effect on appearance, it still looks right.

Try using a VRay 2-sided material with IOR set to 1.0, Reflect on back side turned on, and optionally, a Falloff map in the Reflect slot.

The material needs to be 2-sided so that diffuse light shows both on front- and back-facing surfaces.

You need to set the IOR to 1.0 to make the glass to be merely transparent, and not refractive, and also to make the refractions symmetrical no matter if you are looking at the surface from the front side, or the back side.

You need to check the "Reflect on back side" so that reflections will be caclulated both for front- and back-facing surfaces.

Finally, you may need the Falloff map in the Reflect slot, because with IOR of 1.0 VRay's Fresnel reflection will do nothing.

A problem you may get with this is that the shadows from lights will not be transparent. You can solve this in two ways - exclude the glass from shadow-casting for your lights; or use caustics. I realize this is not very practical, so there will be a workaround for this soon. The picture below uses caustics.

As a side note, you may extrude the glass for your project only by doubling the amount of faces - you don't need the four sides of the glass (assuming you have frames around it). Then you can use a Standard transparent material with VRay map in the refelction slot. Furhter on, 1.3 mln faces are not that much - VRay should be able to handle them

關於間接光下的bump貼圖問題
有四種解決在間接光照下bump的辦法,

1). 用Direct GI (等於沒說), 不過這是Vlado說的,權威性不消說 

2). 使用Glossy Reflection, 這樣可以比較真實地計算出bump。給一點點反射貼圖,使用glossy模式(vraymap中的)。但是時間也不好說了。相信是正確的,我也試了一下。時間寶貴,舍不得開glossy,直接reflection了。

3.) 使用大片的vraylight面光源來模擬天光,而不是直接使用天光。Vlado也提到用vraylight這一點,當時沒明白,今天看到vlado給出的他sponza渲染,明白了。這個對於完全室內的(如前面的那個室內教堂)還是有問題的。我想來我只能偷偷地打輔助光了
加大hsph 和 interp 的值
在differ通道中有mask貼圖, 但然, bump通道也要有相應的貼圖.

三 使用經驗:
1: 燈光:增加VRAYLIGHT燈,可修改長寬,可做線槽發光效果。
SAMPING是用來調整陰影精度的,但速度也會慢。
建議:使用MAX自帶的燈,可提高速度,做線槽發光效果再用。

2: 貼圖:MAX中增加兩個VRAY貼圖,反射中用VRAYMAP,
建議:可不用修改參數,修改色彩即可。可提高速度。

3: 渲染:勾選ADAPTIVE項,其中參數可提高渲染抗鋸齒精度 .勾選INDIRECT
ILLMINATION項打開

4. gi時 只有vray專用影子,才有陰影 ,反射必須用vray貼圖

5 做焦散燈光強度要高300-1000
燈光要用反比衰減
陰影最好打開vray map.
還有焦散的光子反彈量要在300-1000左右

4. 關於反射的效果,你只要在反射里面貼上vray專用反射帖圖就可以獲得很好的效果了。 如果你打開GI,最好不要讓天空是黑色(除非是夜景)因為如果你調了反射的話,就很可能反射的是天空,當然是黑色的了……因為vray對反射算的很精確。

5. 關於fillter
Catmull-Rom
本來就是max的採樣濾鏡之一,是具有25像數的過濾和顯著的邊界增強效果。
在巨幅靜貞渲染中對比其他的濾鏡來說是效果最好的,但反鋸齒最差。 如不滿意的話建議用blackman. 用vray的話還是不要用max的採樣吧! 用vray自己的……
6關於hdri
我不知道為什麼很多HDR的教程,都沒有提到Mirrored Ball格式的HDRI是無法與3dMax的spherical Environment貼圖類型匹配的。如果你直接把下載的HDRI用於環境貼圖是不能正常顯示的
8bit格式的圖象就像jpg,bmp,16bit格式的圖象就像PFM,HDR是64bit格式。就是高動態圖像,包含不同暴光度的圖象。所以你在降低暴光度的時候,可以看到一些原來高光部分的細節

要產生較好的cauris效果, 必須加大採樣值, 還有, interp 比hsph不能大很多

必須是latitude/longitude格式的HDRI才支持3Dmax的spherical Environment貼圖類型。所以要在HDRshop里轉換格式
先在hdrshop打開下載的HDRi,在image功能表中->arorama->aroramic Transformations...
在跳出的視窗中把目標文件格式改成Latitude/Longitude,然后OK.
把新生成圖象儲存后,就可以在3dmax中正常使用。(用spherical Environment貼圖類型)
879.6 in reply to 879.1

Excuse my ignorance but, how do I preprocess irradiance maps every 10th frame for use in generating an animation?
i think what u do is u set max's render dialog
to render every nth frame.
then set vray's irrad map to incremental add

then render the nth frames

and once all the nth frames are rendered,
u save the irrad map and then use it to render
the whole animation.

arrow
arrow
    全站熱搜

    sleepingwolf 發表在 痞客邦 留言(1) 人氣()