Redshift Optimizations優化

Redshift的Optimizations優化選項包含一些控制,允許用戶從整體角度調整渲染質量和渲染性能。用戶很可能根本不需要修改其中的一些控制。但假如要提高渲染性能或者消除一些渲染瑕疵可能要針對性的了解一些重要的參數。

Maximum Trace Depth最大追蹤深度

The trace depth limits control how deep reflections and refractions can go. There exist separate settings for reflection and refraction. The 「combined」 setting specifies the upper limit for both reflections and refractions. Let』s say, for example, that reflection, refraction and combined are all set to a value of 10. If a ray has already been reflected 8 times, then it can only be reflected or refracted 2 more times because the combined trace depth is 10.

這些設置控制著反射和折射有「多深」。有單獨的控制設置來控制反射和折射。Combined混合控制指定了反射和折射共同的次數上限。例如,我們把所有這三個控制的值都設為10。這樣,如果一條光線已經被反射了8次,那麼它就只能再被反射或者折射2次。

Warning警告

Raising the trace depth limits can increase rendering times!

提高最大追蹤深度會增加渲染的時間.

Most scenes can get away with fairly low reflection and refraction trace depth limits. This is especially true for reflections. How often can you see a reflection of another reflection of another reflection… and so on?

大多數場景會使用相當低的反射和折射次數。但如果場景中有許多玻璃,你就可能會想要提高折射次數,不然你就會看到光線折射結束得太早,並在折射了幾次後產生錯誤的光學效果。

Refractions, on the other hand, can be more challenging. Scenes that contain glass might require the refraction trace depth limit to be raised to avoid incorrect results behind a few layers of glass, as shown below:

Refraction trace depth limit set to 3. Even though it might look correct, several refractions are skipped.

Refraction trace depth limit raised to 16. Both the refractions and shadows are now correct.

Similarly, an 「opposing mirrors」 scene like the one shown below will require the reflection trace depth limit raised.

Reflection trace depth limit set to 3. The mirror-in-mirror reflections of the sphere are cut too early.

Reflection trace depth limit raised to 16. The sphere is reflected several more times.

Cut-off Thresholds剪切閾值

Warning警告

For advanced users only! Incorrect settings can generate noisy images or long rendering times!

僅為高級用戶!不正確的設置會產生噪波或者渲染時間變長。

在光線經過反射、折射和陰影處後,它們就會被染上顏色,亮度也變得更低了。比如,從相機發出的一條光線可能會撞上一面反射非常弱的鏡子。那個鏡子不管發射什麼光線都會使光線變暗。而當光線變暗時,它對最終圖像的影響變得很小,所以渲染器就不再反彈它們。

Cut-off Threshold(剪切閾值)參數設置允許用戶指定成像「黑度」的最小值,並允許渲染器提前結束光線追蹤。

這些參數的默認設置可能會適應大多數場景,但在一些極端情況下,一個非常暗的鏡片可能會反射出非常明亮的幾何體。如果這時渲染器提前Cut-off(忽略)反射的光線,雜點就會出現。

如果你懷疑場景中已經發生這種情況,可以試著將這些參數的數值降為0.001。如果想要完全禁用優化,將這些參數設為0.0即可。

下面的場景測試反映了場景中有非常明亮的物體,但Cut-off不夠低。在場景中的中央,有一個玻璃反射和折射球體。在它周圍是4個非常明亮的、自發光的不球體。我們將反射、折射Trace Depth均設為16,這樣自發光球體發出的光線在玻璃體內部的反射和折射就能「重複」許多次。

請注意,這個場景用到了許多自發光球體以說明潛在問題。如果你的場景中沒有使用如此多的發光球體,那麼你就不需要像這裡一樣降低數值。否則會大大增加渲染時間!

The scene setup場景構成

All cutoffs are disabled. This is the reference (best quality) image.此時禁用了所有Cut-off Thresholds參數。這是參考(沒問題的狀態)圖片。

Cutoffs set to 0.1. This is an aggressive setting. Notice that several reflections/refractions are now rendering noisy.

此時Cut-off Thresholds設為0.1。這是一個非常激進的設置。注意:這時許多反射和折射被剪切了,噪點已經出現了

Cutoffs set to 0.01. A big improvement over the last image, but there』s still some noise in the deeper reflections.

Cut-off Thresholds設為0.01。此圖片效果相比上一張改善了許多,但如果你與第一張相比,就會注意到仍然有反射和折射被剪切了。

Cutoffs set to 0.001. This is the default value. In this case, it produces a near-identical result to the reference image.

此時將Cut-off Thresholds設為0.001。這是默認值。與參考圖片相比,仍然有一些反射被剪切了,但從視覺上來說,更能被接受。

Russian-Roulette俄羅斯輪盤

Certain shaders need to shoot multiple different kinds of rays. For example, a glass shader needs to shoot a ray for reflection and another one for refraction. The architectural shader can shoot two reflection rays (with different gloss values) and one refraction ray. The car paint shader shoots two reflection rays (with different gloss values). When the rays of such shaders 『see』 other shaders of the same kind, the number of rays that have to be shot can grow exponentially with increasing trace depths. The initial two rays of a glass shader might become 4 rays on the next trace depth, then 8, then 16, 32, 64, and so on.

有時需要一些Shader來發出多種類型採樣射線。例如,玻璃shader發出採樣反射的射線,還需要另一條採樣折射的射線。Architectural Shader(建築著色器)能發出兩種採樣反射的射線(取決於不同的光澤值)和一種採樣折射的射線。Car Paint(車漆著色器)可發出兩種採樣反射射線(取決於不同的光澤值)。當一類Shader發出的採樣射線「看見」同類Shader時,採樣射線的數量就會指數上升,Trace Depth也會提高。即最開始的由一個玻璃Shader發出的光線會在下一個Trace Depth變成4條光線,然後是8條,再然後是16條、32條、64條等等。

Russian-Roulette allows the renderer to shoot only one kind of ray once the importance of the ray is low. For example, a glass seen through a very faint mirror can often get away with sometimes shooting a reflection ray and some other times shooting a refraction ray. Choosing which kind of ray to shoot (reflection or refraction) is driven by shader parameters. If a glass, for example, is very transparent and only has a very faint amount of reflection, the renderer will mostly choose refractive rays versus reflective ones.

如果某種採樣射線的權重比較低,通過設置Russian-Roulette允許渲染器只發射一種採樣射線。例如從一塊反射很弱的鏡頭中看一塊玻璃,玻璃經常會消失。因為渲染器有時發射反射採樣射線,有時發射折射採樣射線。選擇究竟發射那種採樣(反射還是折射)是著色器參數決定的。如果這塊玻璃非常透明,並只有很弱的反射,那麼渲染器主要會選擇折射採樣射線來代替反射。

The 「Importance Threshold」 decides when the renderer will start performing this optimization. Very low numbers mean 「start doing it for very dim rays」 while higher numbers mean 「do it for slightly brighter rays」. So the higher the number, the earlier the optimization will happen. Starting it too early, though, can introduce grain artifacts. If you see grain in your glass and you are suspecting the Russian-Roulette, you can try lowering this number to 0.001. To disable this optimization completely, set it to 0.0.

Importance Threshold就是用來設定渲染器在何種情況下開始優化。非常小的值表示在「光影很微弱時開始優化」,而比較大的值意味著在「光影相對較強時開始優化」。因此數值越大,優化就越早開始。然而,如果開始得過早,可能會導致顆粒感。如果發現渲染出來的玻璃顆粒化嚴重,而又懷疑是Russian Roulette導致,可以嘗試將數值降低到0.001。要完全取消優化,設置為0.0。

The 「Falloff」 parameter 『eases』 into the Russian-Roulette optimization. This means that once a ray』s intensity crosses the 「Importance Threshold」 value the renderer won』t go abruptly into Russian Roulette but will do it gradually. This improves potential noise-banding artifacts. How gradually the renderer will ease into Russian-Roulette optimization is controlled by the 「Falloff」 parameter. Setting this parameter to 0.0 will enable the optimization abruptly, while 1.0 does it very smoothly. It』s very rare that users will need to adjust this parameter, so its advised you leave it at 0.5.

Falloff衰減用說減弱Russian-Roulette優化。這就意味著當採樣射線取到亮度超過Importance threshold指定的值,渲染器不會馬上進入Russian Roulette優化,而是逐漸引入。這能降低Noise-Banding噪點帶缺陷的出現。用Falloff可以控制渲染器進入Russian-Roulette優化的快慢程度。將參數設為0.會使得優化驟然啟動。而參數1,表示緩慢地引入。只有很少量的用戶會調整這個參數,所以讓它保持0.5即可。

To demonstrate the Russian-roulette parameters, we』ll use the same scene we used for the cut-offs.

為說明Russian-Roulette優化參數效果,我們將使用Cut-Off Thresholds的例子。

請注意下面的場景使用了數量巨大的自發光球體以說明潛在的問題。如果你的場景中沒有這麼多強自發光球體,那麼你無須像下面這樣降低參數值。不合理地降低設定會極大的增加渲染的時間。

Russian-Roulette is disabled. This is what the frame is supposed to look like.

下圖中的Russian_roulette被禁用了。下面是希望渲染的效果。

Importance Threshold set to 0.1. The renderer has to choose between reflection and refraction way too early which produces excessive noise!

此時Importance Threshold值設為0.1。渲染器不得不更早在反射和折射之間做出選擇,這就產生了過量的噪點。

Importance Threshold set to 0.01. While there is less noise compared to before, it』s still visible.

此時的Importance Threshold設為了0.01,這是默認值。很明顯,與之前相比,噪點少了一些。

Importance Threshold set to 0.001 (the default). Russian-roulette now happens very rarely, which eliminates all noise.

此時的Importance Threshold被設為0.001。這一值極低,此時Russian-Rouletle優化幾乎不發生-----這會消除所有噪點。

Texture Sampling貼圖採樣

Redshift supports high quality texture mapping via 『Anisotropic』 filtering. Redshift also supports fast but lower quality texture mapping techniques such as 『Bilinear』 (blurry) and 『Point』 (blocky)。

Redshift支持質量非常高的紋理貼圖過濾,這在Maya中默認啟用了。當Softimage中將紋理節點設為使用Anisotropic(各向異性)時也可以啟用。Redshift也支持快速紋理貼圖過濾技術,比如Binlinera(很模糊的方式)和Point(不均勻方式)。

Most scenes only need high-quality texture mapping for parts of the image that are directly visible to the camera, i.e. the 「primary rays」. Secondary rays (reflections, refractions, GI, lights) and shadow rays are often less visually important so they can get away with using lower-quality texture sampling techniques. For this reason, by default, Redshift enables 『Anisotropic』 for primary rays and 『Bilinear』 for secondary and shadow rays.

大多數場景只需要在相機直接可見區域使用高品質材質貼圖,例如「Primary Rays」。Secondary Rays(反射、折射和GI),以及陰影採樣射線在視覺上通常不太重要,所以使用質量低一些的紋理採樣技術即可。因此Redshift默認為主採樣射線啟用「Feline」,而為次採樣射線和陰影啟用「Bilinear」(雙線性)。

Tip建議

If you』re rendering a scene that uses very clear mirrors or glass and seem to be seeing blurry textures through those mirrors, you might want to increase the quality of the secondary rays to 『Anisotropic』. Mind you, though, that this can increase rendering times!

如果你想渲染放置了非常乾淨的鬼影鏡子(Mirrorsor Glass)的場景,想在鏡子中看到模糊的紋理,那可以將次採樣射線的質量提高到「Anisotropic」(各向異性)。記住這會增加很多渲染時間。

MIP-maps are pre-filtered (blurred) versions of the textures and are automatically computed by Redshift behind the scenes. MIP-maps are useful in making textures appear less noisy when viewed from far away. Each texture has several MIP-maps associated with it. For example, a 1024x1024 texture will have a 512x512, 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4, 2x2 and 1x1 MIP maps. Each time the renderer needs to pick a samples for texture mapping, it selects two consecutive MIP-maps (for example 256x256 and 128x128) depending on how far away the textured object is from the camera and then filters in-between them. The best filtering for this job is called 「tri-linear interpolation」. The 「MIP Filtering Trace Depth Threshold」 forces the renderer to disable 「tri-linear」 filtering between MIP-map levels after a specified trace depth, which will help performance but at the potential cost of introducing banding artifacts. Generally, banding artifacts will not be visible beyond certain trace depths, so it is recommended that you use the default settings and allow the renderer to use switch to 「bi-linear」 filtering after the first trace depth.

Mip-Mans是一種預先過濾(模糊)版本的紋理貼圖,是由Redshift在後台自動計算的,當從很遠的地方看時,使用Mip-Maps,能使紋理的噪點更少。每個紋理都有幾個Mip-Mpas。例如,一個1024x1024的紋理有512x512, 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4, 2x2和1x1 MIP maps。每當渲染器需要為紋理貼圖選擇樣本時,它就會選用兩個連續的Mip貼圖(比如256x256 和 128x128)。然後在這兩種紋理之間進行過濾。選擇多大的解析度取決下紋理里相機的距離。完成這一過濾工作最好的方式稱為「tri-linear interpolation」(三線性插值)。「Mip Filtering Trace Depth Threshold」,(MIP過濾跟蹤深度閾值)強制渲染器在經過指定數量的Trace Depth之後,禁用兩種MIP-Maps級別之間的「Tri-Linear」過濾。這將提高渲染性能,但可能會引入條帶狀偽影。一般來說,超過一定Trace Depth之後條帶狀偽影就不可見了,所以建議你使用默認的設置,並允許渲染器在第一個Trace Depth之後切換成「Bi-Linear」過濾方式。

The 「Copy Pre-Converted Textures to Cache Folder」 option is used in junction with textures that have been pre-converted using the 『TextureProcessor』 tool. By default this option is enabled, the assumption being that the local texture cache folder has better IO performance than the source texture folder, which is common for example when source textures are stored on slower network drives or when the local texture cache folder is on an SSD drive while the source texture folder is on a mechanical drive. By copying the pre-converted textures to the local machine cache folder, the out-of-core texture file streaming during rendering can be significantly faster, which can have a significant impact on rendering performance. This option should be disabled when the IO performance of the texture cache folder is equal to or lower than that of the source texture folder.

Copy Pre-Converted Textures to Cache Folder選項用於與Texture Processor工具預先轉換過的貼圖紋理同一使用。這個選項默認是開啟的,能提高速度和前提是這裡設定用於存儲紋理的磁碟訪問速度要比原始貼圖路徑訪問速度快。如果原始貼圖被放在一個比較慢的網路伺服器上,或者被放在普通的機械硬碟上,而本地磁碟是SSD硬碟的話,那麼就該開啟這個功能。通過複製轉換格式前的原如貼圖文件到本地緩存路徑上,這些非核心紋理文件在渲染時間的訪問數據流會快很多,這能在很大程度上提高渲染速度。如果指定路徑的訪問速度並不比原文件路徑訪問速度快的話,應該禁用這個選項。

Global Overrides全局覆蓋

The 「Enable Reflections」 and 「Enable Refractions」 options globally enable/disable reflections and refractions respectively.

Enable Reflections(啟用反射)和Enable Refractions(啟用折射)用於在全局上分別啟用/禁用反射和折射。

The 「Enable Subsurface Scattering」 option bypasses all subsurface scattering preprocessing and renders the SSS shaders as diffuse.

Enable Subsurface Scattering(啟用次表面散射)用於屏蔽次表面散射進程,也就是用漫反射取代SSS材質。

Similarly, 「Enable Tessellation And Displacement」 enables/disables all tessellation and displacement.

The 「Enable Emission」 option globally enables/disables emission on materials.

類似的Enable Tessellation、Displacement(啟用細分和置換)用於啟用/禁用細分和置換。


推薦閱讀:

Material Shaders - Incandescent
Redshift Output
Gamma

TAG:redshift | gpu渲染 | 渲染 |