##開篇
####1. 屏幕灰化效果簡述
一般由於政策特殊日期等因素,或者遊戲內角色死亡效果要求等等,我們會想看到一個整體灰色的效果。具體表現測試效果:
####2. 需要了解
Unity後處理OnRenderImage
(https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnRenderImage.html)
[Graphics](https://docs.unity3d.com/ScriptReference/Graphics.html).Blit
** Copies source texture into destination render texture with a shader.**
在後處理中調Graphics.Blit傳入一個改變顏色飽和度的shader,即可實現想要的灰色效果。
變量
兼容判斷(不支持的話會造成卡幀等等)
可動態調整灰度值,看後處理渲染出的灰色效果
腳本掛在相機上即可。