Game Development Community

TorqueX 2D tilemap artifacts

by Thijs Sloesen · in Torque X 2D · 02/22/2009 (4:36 am) · 2 replies

Hello,

I recently started experimenting with Torque X 2D again and I'm currently working on some tilemaps. I created a simple tile layer in the Torque X Builder 2D. The tile images come from the ground_tiles.png tileset image from the TGB Adenture Pack for those who are familiar with the pack.

Unfortunately, a lot of artifacts appear when moving the camera around on the edges of single tiles, as you can see in this screenshot:

Click here for the image

As you can see in this second screenshot, the artifacts also appear within the editor. The screenshot also shows the camera settings:

Click here for the image

Does anybody know if I am doing anything wrong? Maybe wrong camera settings? Are the images themselves not optimized?

Anyway, any help will be appreciated.

Thanks!



#1
02/22/2009 (8:44 am)
Hi Thijs:

I saw a post about this some time ago, here is the link: http://www.garagegames.com/community/forums/viewthread/75132

The explanation to the problem by the poster there makes sense to me, it looks like you would need to modify the actual HLSL shader attached to the sprite to allow different texture filtering modes (minification, magnification, etc).

What size are your actual tile images and what is the size of your tiles within your tile map? I think I've had some luck before making those the same size, since then it wouldn't have to really perform any type of texture filtering.
#2
02/22/2009 (2:15 pm)
@Lucas: Well that could be it, it does appear that a tile image set with only one tile in it (in other words, the tile image/frame is the same size as the image itself) renders correctly.

So it could indeed be the scaling in the shader, because it seems the artifact are pixels from the tile frames that are next to the frame being rendered.

Also, maybe it is just because of TX's weird unit system. I still haven't figured it out completely, but I think every unit in TX is about 25.6 screen pixels. I'm guessing this might lead to rounding errors, which could also explain the artifacts. I don't know why the documentation does not explain anything about the weird unit system though.