天天看點

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Post-processing overview 後期處理概述

本文檔主要是對Unity官方手冊的個人了解與總結(其實以翻譯記錄為主:>)

僅作為個人學習使用,不得作為商業用途,歡迎轉載,并請注明出處。

文章中涉及到的操作都是基于Unity2018.3版本

參考連結:https://docs.unity3d.com/Manual/PostProcessingOverview.html

Post-processing is the process of applying full-screen filters and effects to a camera’s image buffer before it is displayed to screen. It can drastically improve the visuals of your product with little setup time.

後期處理(後處理)是将全屏濾鏡和效果應用到相機的圖像緩沖區,然後再顯示到螢幕上的過程。它可以大大改善視覺效果,隻要很少的設定時間。

You can use post-processing effects to simulate physical camera and film properties; for example; Bloom, Depth of Field, Chromatic Aberration or Color Grading.

您可以使用後處理效果來模拟實體相機和膠片的屬性;例如;輝光(Bloom)、景深(Depth of Field)、色差(Chromatic Aberration)或顔色分級(Color Grading)。

Using post-processing

To use post-processing in your project you can import Unity’s post-processing stack. You can also write your own post-processing effects. See Writing post-processing effects for details.

要在你的項目中使用後處理,你可以導入Unity的後處理棧。您還可以編寫自己的後處理效果。詳見後處理效果。

The images below demonstrate a Scene with and without post-processing.

下面的圖檔展示了一個有和沒有後處理的場景。

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Scene with post-processing

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Scene with no post-processing

Post-processing stack 後期處理棧

The post-processing stack is an über effect that combines a complete set of effects into a single post-processing pipeline. This has a few advantages:

後處理堆棧是一種超級效果,它将一組完整的效果組合到單個後處理管線中。這有幾個優點:

  • Effects are always configured in the correct order 效果總是按照正确的順序配置
  • It allows a combination of many effects into a single pass 它允許多個效果組合成一個pass
  • All effects are grouped together in the UI for a better user experience 為了更好的使用者體驗,所有效果都在一個UI界面中

The post-processing stack also includes a collection of monitors and debug views to help you set up your effects correctly and debug problems in the output.

後處理堆棧還包括一組螢幕和調試視圖,以幫助您正确設定效果并調試輸出中的問題。

To use post-processing, download the post-processing stack from the Asset Store.

要使用後處理,請從資産存儲中下載下傳後處理堆棧。

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Post-processing stack

Setting up the post-processing stack 設定後處理堆棧

For optimal post-processing results it is recommended that you work in the Linear color-space with HDR enabled. Using the deferred rendering path is also recommended (as required for some effects, such as Screen Space Reflection).

為了獲得最佳的後處理結果,建議您在啟用HDR和線性顔色空間中工作。還建議使用延遲渲染路徑(根據某些效果的需要,如螢幕空間反射)。

First you need to add the Post Processing Behaviour script to your camera. You can do that by selecting your camera and use one of the following ways:

首先,您需要将後處理行為腳本添加到相機中。你可以選擇你的相機,并使用以下方法之一:

  • Drag the PostProcessingBehaviour.cs script from the project window to the camera.
  • Use the menu Component > Effects > Post Processing Behaviour.
  • Use the Add Component button in the Inspector.
    Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述
    Adding a Post-Processing Behaviour script

You will now have a behaviour configured with an empty profile. The next step is to create a custom profile using one of the following ways:

現在您将擁有一個配置為空配置檔案的元件腳本。下一步是使用以下方法之一建立自定義配置檔案:

  • Right-click in your project window and select Create >Post-Processing Profile.
  • Use the menu Assets > Create > Post-Processing Profile.

This will create a new asset in your project.

這将在您的項目中建立一個新的資産。

Post-Processing Profiles are project assets and can be shared easily between scenes / cameras, as well as between different projects or on the Asset Store. This makes creating presets easier (ie. high quality preset for desktop or lower settings for mobile).

後處理配置檔案是項目資産,可以在場景/錄影機之間、不同項目之間或資産存儲上輕松共享。這使得建立預設更容易(高品質的預設為桌面或較低的設定為移動)。

Selecting a profile will show the inspector window for editing the profile settings.

選擇檔案将顯示在用于編輯檔案設定的inspector視窗。

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Newly created post-processing profile

To assign the profile to the behaviour you can drag it from the project panel to the component or use the object selector in the inspector.

要将概要檔案指派給元件,您可以将其從項目面闆拖到元件,或者使用檢查器中的對象選擇器。

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Post-processing profile assigned to the Behaviour script

With the profile selected, you can use the checkbox on each effect in the inspector to enable or disable individual effects. You’ll find more information about each effect in their individual documentation pages.

選中概要檔案後,可以在檢查器中的每個效果上使用複選框來啟用或禁用各個效果。您将在它們各自的文檔頁面中找到關于每種效果的更多資訊。

Post-processing overview 後期處理概述 後期處理系列1Post-processing overview 後期處理概述

Bloom effect enabled

繼續閱讀