Why do textures flicker when camera moves?

北慕城南 提交于 2019-12-08 05:06:28

问题


I implemented a top view camera which moves with the player, only a bit slower using camera.position.lerp. The problem is that the textures are flashing (flickering) a little because i have scaled my textures. If I use normal size of textures the flickering stops. Does anyone have any ideas on how to move the camera with zoom (or textures scaled - same thing) without getting the textures to flicker (or flash)? I use linear filtering and load every asset from an atlas. I saw this problem on multiple forums, but no answer. I wanted to load higher resolution textures and resize them in code, that's why I am asking this question.


回答1:


You need to extrude the borders of your sprites in the atlas. The Extrude option tends to be close to the Padding ones.

Most texture packers support that feature and Libgdx will pick that information up from the atlas file straight away.

This way you get to use the filter you want.



来源:https://stackoverflow.com/questions/24038033/why-do-textures-flicker-when-camera-moves

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!