Im getting white lines in between some tiles when i move the camera.. This issue is really persistent.. I havent found any workarounds other than overlapping 2 tiles.. tried everything, like replacing the tiles entirely with some other etc but the issue is still there The strange part is that, it seems to occur in a certain area only as creating the same tiled structure somewhere else doesnt seem to have this problem Any help guys, thanks in advance (sorry for my english) Attached ss
I tried the default shader and created a new material with base as default shader but enabled pixel snap.. Both give the exact same result.. Im starting to think this is a bug OR it could be the annoying floating point imperfections i keep hearing about.. what value do I set the main camera in order to avoid FP imperfections ?
with pixel snap it seems you also must have an exact pixel-to-texel ratio set up in your camera, so that e.g. if the resolution is 768 pixels high then the ortho needs to be 384... or work out so that you get `whole pixels`, otherwise it seems the calculations will produce some floating point fluctuations like this.
You've hit one of the things that drove me batty for a month or two. This is what I ended up doing that resolved the issue. Note that doing any one or the other may solve the issue in specific cases but not in others. For 2D, this is what I use: Locking the camera to pixel positions (if the camera can move then you will need to use code to do the pixel positioning in the update method of an attached script) Using a sprite renderer material with Pixel Snap enabled (I never saw this make any difference but others said it worked for them). Point Filtering (this has no effect on the gap issue but definitely want to use it for sharp non-blurred images) Locking the position of each sprite to pixel coordinates meaning you will need to put code into update to do this for every sprite. Make sure each tile (and sprite) image has 2 pixels of transparent space on each side. For 1 and 4 what I do is use a Vector2D to hold the pixel position which I then use to position the transform in Update. I use another Vector2D to hold the "real" position of the objects and this is the one I use to do the actual movement and so forth. The v2PixelPosition is used only in the Update to position the object. By doing all of these things I no longer encounter any glitches in the way tiles / sprites are displayed.
^2,3 ive already tried, didnt work... 5 is not possible, im halfway through my work and i cant edit the pixels one by one again Ill try 1 and 4, and report asap.. thanks a lot for the help guys, you guys making my life easier
Currently in all my tiles, the Pixel to Unit is set to 100, i want to change it to 1 without it messing up in distance, is there any way to do it ? im halfway through and remapping all tiles will take days, is there any efficient way that Unity will automatically calculate distance between 2 tiles etc
Update : Im rounding off the maincamera X and Y position to 2 decimal places using a function update this seems to have solved most of the white line flickering (some still remains).. Update2: Issue fixed, thanks for the help everyone
I've been having a similar issue and turning off antialising helped but didn't completely solve the issue. I'm not that a confident programmer so locking the camera to pixel points confused me ... a lot. Setting Clear Flags on my camera to Depth Only seems to have done the job - not sure of the knock ons however as I have no idea what that even means...