Game Development Community

Vertical Scrolling Background Tearing

by Chase Webb · in Torque 2D Beginner · 04/06/2013 (11:08 pm) · 7 replies

I'm not sure if this is a bug or if I am doing something wrong. Whenever I have vertical scrolling for a background in my project (not a sandbox toy) horizontal lines appear. I tried using a bit of code I found on the wiki for virtualsync, thinking that might help, but apparently it does not. Has anyone else encountered this? Here are the project files, if it helps: https://dl.dropbox.com/u/18965446/RBY%20Food%20Test.zip

#1
04/07/2013 (4:49 am)
Set %background.RepeatX and Y to 1 or 2 and there are no artifacts. Above that and artifacts appear. A temporary fix is to use the water tile by itself (a 128x128 image and asset).
#2
04/07/2013 (3:41 pm)
Actually, if I set them to 1 or 2 I still get the artifacts. I will try out the image thing to see if it helps though.
#3
04/08/2013 (5:40 am)
practicing01 is right, A single image without any tiles fixes the tearing. However, it's just a workaround for a problem that should probably get tackled somewhere.
#4
04/08/2013 (8:18 pm)
Let me know if I have this right, as I think I'm running into a similar, if not the same, issue. The fix was creating a single image asset, instead of say a multi-frame/cell asset?
#5
04/08/2013 (8:43 pm)
Sure enough, fixed the issue. What made you think to use a single image? I ran into this when creating some tile layers with the composite sprites, but could never figure out why it was happening. Thanks!
#6
04/12/2013 (12:37 pm)
Probably because you're using bi-linear interpolation and your frames are butted-next to each other in the texture thus the edges of the frames end up sampling the adjacent frames. Setting the filter to nearest stops this so you could check that by setting the filter of the asset to nearest or set it globally.

That is described here.
#7
05/08/2013 (7:26 pm)
Sorry to respond to this post so late, but I'm pretty sure I was using nearest while still seeing the issue. That said, it's been a while so I guess I could be wrong. I'll have to test it again sometime.