Artifacts on non-2^N texture sizes

New releases and general discussions.

Post » Sun Sep 14, 2008 6:37 pm

I've read on Construct Wiki that there are artifacts on Tiled Background when its sprite's size is not 2^N. Are you going to deal with this problem or should we be prepared to use 2^N sized tiles in games? This is quite important question, please answer ASAP ^^. Thanks.
Posts: 219
Reputation: 3,013

Post » Sun Sep 14, 2008 6:54 pm

The Tiled Background works best with 2^N sized textures - it renders faster and seamlessly. DirectX 9 supports built-in tiling with power of two textures. Obviously you can't use this with non-power-of-two textures, so instead each tile is drawn individually, which is also a little bit slower.

The problem with non-2^N sized textures is it is not possible for individual tile rendering to draw seamlessly (as far as I know) when it is drawn at a non-integer position on the screen. Due to floating point scrolling and positions in Construct, if you need to display 100x100 tiles from (0.5, 0.5), along the seams, pixels need to be drawn which are a halfway colour between the top/bottom pixels, or the left/right pixels on the image. This is only supported with power-of-two textures.

To remedy this, the tiles are drawn overlapping by one pixel to ensure that obvious seams do not appear. This can create a very slight artefact which is sometimes visible if you look very carefully at a static display (it's generally small enough to be unnoticable with moving displays).

For perfect tiling, you need to use power-of-two textures. Many commercial games only tile power-of-two textures for the same reason.
Scirra Founder
Posts: 24,368
Reputation: 193,746

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest