No “Pixel Snap” option in 'Sprite-Lit-Default' material causing some sprites to tear

不打扰是莪最后的温柔 提交于 2020-07-10 10:25:57

问题


The Problem:

I have a pixel-art based project that uses tilemaps and etc. Previously with just the default material Sprites/Default, I have this "Pixel Snap" option:

However, ever since I upgraded to LWRP/URP; and used 2D Lights (my game has a day/night cycle); all of the sprites have to be upgraded to a new Sprite-Lit-Default material which allows my sprites to be affected by the 2D Lights. The only problem I noticed in this new material is that it hasn't got any "Pixel Snap" option:

And after I used this new material, I notice some of my sprites (specifically the ones on the Tilemaps) tear. It's not game breaking and it occurs sometimes, but it's really quite annoying (and let's face it, it looks bad for your game to have that bug).

I haven't noticed this tearing bug on my other sprites (player, trees, obstacles, etc) only particularly on the tilemaps.

What I've Done So Far:

  • My sprites are set to Point (no filter), and Compression is set to None. On my tile sprites, there are no transparent edges etc. Even if I use Unity's Pixel Perfect Camera, the problem is still there.

  • Duplicated my tilemaps and offset the other ones to -0.01 or -0.02 on its X axis (so just in case it would tear, the player would still see the same tilemap).

None of these things have fixed the problem so far.

Are there any ways to bypass/fix this issue? Thanks a lot!


回答1:


What Solved My Problem

I placed the tilemap sprites on a sprite atlas, set the filter to Point, set the compression to None, left everything else by default, and then clicked "Pack Preview".

来源:https://stackoverflow.com/questions/62764718/no-pixel-snap-option-in-sprite-lit-default-material-causing-some-sprites-to

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