不管是UGUI還是NGUI,只要控制的UI設(shè)置了旋轉(zhuǎn),邊緣就有明顯的鋸齒巍佑。設(shè)置里打開(kāi)8倍抗鋸齒也沒(méi)效果硕舆。看了網(wǎng)易的《非人學(xué)園》里面的界面蛾方,很多應(yīng)該也是旋轉(zhuǎn)的像捶,并沒(méi)有鋸齒。
https://gamedev.stackexchange.com/questions/139626/is-ui-anti-aliasing-broken-in-unity-5-6
“Thanks for raising this issue. In unity 5.6 we made a change to how the backbuffer / msaa / hdr works. A side effect of this is that the backbuffer is never created with MSAA enabled, we go via an intermediate render texture. In the example you have sent the canvas is set to ‘screen space overlay’. This means that is renders directly into the ‘final’ buffer (in this case the framebuffer).
The normal scene camera is set to have MSAA enabled, if you change the camera mode to Screen Space - Camera and render them into the camera (last step via sorting layers), then MSAA will work as they will not be rendered direct into the backbuffer but into the intermediate render texture.”
意思是桩砰,如果你的Canvas選擇的是默認(rèn)的ScreenSpace-Overlay拓春,那么就不會(huì)走M(jìn)SAA的那個(gè)buffer,而是直接寫(xiě)入到“final” buffer中亚隅。
所以解決辦法就是使用Screen Space-Camera的方式硼莽。
除了開(kāi)抗鋸齒之外,如果圖片是靜態(tài)的煮纵,就是不會(huì)旋轉(zhuǎn)的懂鸵。只是這個(gè)角度偏螺,不想開(kāi)MASS可以考慮讓UI直接出圖成斜的,OverDraw高一些匆光,不過(guò)不用抗鋸齒了套像。
另外建議題主關(guān)注下開(kāi)了抗鋸齒之后的字體效果,有可能沒(méi)有那么“銳利”了终息。