此篇文章記錄Dissolve Effect(溶解特效)的制作過程
軟件環境
Unity 2018.1.2f1
Packages: Lightweight Render Pipeline 1.1.11
Dissolve Effect最終效果
創建工程及初始設定
New Project & New Scene;
創建Lightweight Pipeline Asset,打開Vertex Lighting與HDR,關聯到Graphics Settings當中;
在場景中放置Monkey Model,創建默認材質Default,Albedo = (25, 25, 25, 0)
攝像機Clear Flags設置為Solid Color = (80, 80, 80, 0), FOV = 40;
Player Settings的Color Space = Linear;
初始設定預覽
溶解特效
使用Simple Noise結點生成隨機Alpha貼圖,AlphaClipThreshold與Alpha一起控制片段的顯示或隱藏:當片段的Alpha < AlphaClipThreshold時,此片段將被丟棄,即隱藏不顯示出來。
Dissolve Shader Graph
溶解特效預覽
溶解邊緣發光特效
使用Step結點將Alpha貼圖轉換為黑白分明的貼圖,黑白貼圖與Color相乘后輸入到Emission;
Step Node: Returns 1 if the value of input In is greater than or equal to the value of input Edge, otherwise returns 0.
邊緣發光特效Shader Graph
邊緣發光特效預覽
Post Processing Effects
選中Main Camera,添加組件Post Process Layer(Layer = PostPorcessing);
Post Process Layer
創建Post-process Volume(GameObject -> 3D Object -> Post-process Volume),設置Layer = PostProcessing,Blend Distance = 1。調整Volume大小,將Monkey Model包含在內部;
Post-process Volume
新建Post-processing Profile:
a) Add effect: Color Grading(Mode = ACES)
b) Add effect: Bloom(Intensity = 2, Threshold = 1)
Post-processing Profile
添加后期處理特效后,最終效果如下圖