前面的
傳送特效1與
傳送特效2是使用standard的light mode,因此模型在外觀上並不是很好看。在Amplify shader editor中可以使用custom lighting,並整合Ampify中所提供的cel-shader,來讓畫面更好看,cel-shader的原理可以參考
此篇
轉換 surface normal vector 以及 light direction vector 到world space 並計算兩者的內積(dot),出來的值較做N.L
接著一樣把轉換到world space的 surface normal vector與 camera view vector做dot,值為N.V
把剛剛算出的N.L拿去跟一數值做scale與offset之後重新mapping到0與1之間,並把此值當成UV向量給Toon Ramp(這是一張Texture),接著在與Diffuse的texture做blend
計算Attenuation 與Ambient
把計算出的Attenuation 與Ambient和Diffuse wrap再做一次blend。
計算出Rim Light ,把NL與NV都納入計算。算出後再與上面的結果再blend一次。就可以得到cel-shader。
整體圖
以下就是最後的畫面
teleport
teleport 2
可以看到模型改成了卡通渲染,也讓整體看起來比較好看了