Depth of Field 3.4 is a common postprocessing effect that simulates the properties of a camera lens. The name refers to the fact that the effect has had significant performance and feature improvements in Unity 3.4.
景深3.4特效是一種常見的模擬相機透鏡的後處理特效。它的名字反映了在Unity3.4中該特效有了重要特性增強以及性能增強。
In real life, a camera can only focus sharply on an object at a specific distance; objects nearer or farther from the camera will be somewhat out of focus. The blurring not only gives a visual cue about an object's distance but also introduces bokeh which is the term for pleasing visual artifacts that appear around bright areas of the image as they fall out of focus.
現實生活中,相機可以只專注特定距離的物體;更近或更遠的物體將會出現一定的失焦現象。模糊不僅提供了一個關於物體距離的視覺提示,同時也帶來了散景(bokeh)效果,這種效果是由圖片中明亮失焦物體而產生的。
An example of the new Depth of Field effect can be seen in the following images, displaying the results of a defocused foreground and a defocused background. Notice how the foreground blur overlaps with the rest while the background doesn't.
新的景深效果顯示如下面的圖片,一個顯示前景散焦效果,另一個顯示背景散焦的效果。可以看到前景的模糊區域會蔓延,並與其他部分重疊,而背景模糊則不會。
只是附近的管道是在聚焦區域
景深效果中的前景模糊與背景模糊
You might also consider using theTilt Shift effect for a more straightforward but less sophisticated depth-of-field effect.
As with the otherimage effects, this effect is only available in Unity Pro and you must have the Pro Standard Assets installed before it becomes available.
您還可能會考慮使用Tilt Shift效果來得到更加直接但簡單的景深效果。和其他圖像特效一樣,該特效只能在Unity Pro上進行使用,並且在使用之前必須安裝Pro Standard Assets。
General Settings 一般設置
Resolution
分辨率
Determines the internal render target sizes. A lower resolution will result in faster rendering and lower memory requirements.
確定內部渲染目標的大小。較低的分辨率將導致更快地渲染效率和較低的內存要求
Quality
質量
The quality level. Choose between the faster OnlyBackground or the higher-quality BackgroundAndForeground which calculates the depth-of-field defocus for both areas separately.
質量級別。在OnlyBackground和BackgroundAndForeground之間進行選擇。前者更快,後者質量更高。
Simple tweak
簡單調整
Switches to a simpler focal model.
調整到簡單的聚焦模型
Visualize focus
可視焦點
This shows the focal plane in the game view to assist learning and debugging.
在游戲中顯示當前的聚焦平面,從而來幫助學習和調試。
Enable bokeh
開啟散景
This will generate more realistic lens blurs where very bright parts are scaled and overlap.
這將生成更真實的透鏡模糊效果,對很明亮的地方進行縮放與區域重疊。
Focal Settings 聚焦設置
Focal distance
聚焦距離
The distance to the focal plane from the camera position in world space.
在世界空間中焦平面到相機的距離
Object Focus
物體聚焦
Determine the focal distance using a target object in the scene.
使用場景中的目標物體來決定的聚焦距離
Smoothness
光滑度
The smoothness when transitioning from out-of-focus to in-focus areas.
從失焦區域到聚焦區域的光滑度
Focal size
聚焦尺寸
The size of the in-focus area.
聚焦區域的尺寸
Blur 模糊
Blurriness
模糊次數
How many iterations are used when blurring the various buffers (each iteration requires processing time).
模糊各種緩存的迭代次數(每次迭代都需要一定的處理時間)
Blur spread
模糊半徑
The blur radius. This is resolution-independent, so you may need to readjust the value for each required resolution.
模糊半徑,這是與分辨率相關的,所以您需要對於每個特定的分辨率重新設定該值。
Bokeh Settings 散景設定
Destination
目標
Enabling foreground and background blur increases rendering time but gives more realistic results.
開啟前景和背景模糊,雖然會增加渲染時間,但會得到更加真實的效果。
Intensity
亮度
Blend intensity used as bokeh shapes are being accumulated. This is a critical value that always needs to be carefully adjusted.
使用模擬的散景形狀來混合亮度。這是一個很關鍵的數值,需要謹慎調整。
Min luminance
最小亮度
The luminance threshold below which pixels will not have bokeh artifacts applied.
亮度阈值,小於該值的像素將不產生散景效果。
Min contrast
最小對比度
The contrast threshold below which pixels will not have bokeh artifacts applied. The significance of this is that you usually only need bokeh shapes in areas of high frequency (ie, cluttered or "noisy" areas of image) since they are otherwise nearly invisible. Performance will be improved if you use this parameter to avoid generating unnecessary bokeh artifacts.
對比度阈值,小於該值的像素將不產生散景效果。該值的重要意義在於你通常只想場景中一些高頻率地方(即圖片中的噪聲區域)產生散景效果,否則他們將幾乎無法看見。如果您使用該值,將提升渲染性能,因為這樣做可以避免生成一些不必要的散景效果。
Downsample
下采樣
The size of the internal render target used for accumulating bokeh shapes.
模擬散景形狀的內部渲染目標的尺寸
Size
尺寸
The maximum bokeh size. Will be modulated by the amount of defocus (Circle of Confusion).
最大的散景效果尺寸。可以通過散焦程度來進行調整(模糊圈)
Bokeh Texture
散景紋理
The texture defining the bokeh shapes.
定義散景形狀的紋理
Note that since the bokeh effect is created by drawing triangles per pixel, it can drastically affect your framerate, especially if it's not adjusted optimally. Adjust theSize, Min luminance, Min contrast,Downsample and Resolution to improve performance. Also, since the screen is darkened before the bokeh shapes are applied, you should use an appropriateBlurriness level to remove possible artefacts.
請注意由於散景效果的創建是通過在每個像素上渲染三角形,所以會大幅度地影響您的幀速率,特別是在沒有進行優化調整的時候。您可以調整大小、最小亮度、最小對比度、下采樣和分辨率來提高性能。此外,由於在使用散景形狀之前場景會變暗,所以您應該使用合適的模糊級別來去除可能產生的瑕疵。
This effect requires a graphics card with pixel shaders (3.0) or OpenGL ES 2.0. Additionally, depth texture support is required. PC: NVIDIA cards since 2004 (GeForce 6), AMD cards since 2005 (Radeon X1300), Intel cards since 2006 (GMA X3000); Mobile: OpenGL ES 2.0 with depth texture support; Consoles: Xbox 360, PS3.
這個特效需要顯卡擁有像素著色器(3.0)或者OpenGL ES 2.0,同時需要支持深度紋理。台式機:2004年以後的NVIDIA顯卡(GeForce6),2005年以後的AMD顯卡(Radeon X1300),2006年以後的Intel卡(GMA X3000);移動設備:OpenGL ES 2.0並支持深度紋理;控制台: Xbox 360、 PS3。
All image effects automatically disable themselves when they can not run on end-users graphics card.
所有圖像特效如果無法在用戶顯卡上運行時將會自動被關閉。