Re: Tiling large bitmap, what size tile is best?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Eyal Teler (et_at_nospam-et3d.com)
Date: 11/21/04


Date: Sun, 21 Nov 2004 22:56:12 +0200

Okay, let me see if I understand the problem:

You have to display an image as a background. This is a single image,
and it can be larger than 2048x2048, which is the commonly supported
maximum texture size. Presumably this background needs to be seen at
its actual resolution and scrolled -- otherwise you'd just load it
scaled down.

I don't understand why you're saying "Larger tiles would be less
memory efficient but faster." The fewer the textures, the less memory
overhead will be used, and if the tiles aren't fixed in size, then
you'll be able to fit the exact image, without waste. If you have,
say, a 3000x2500 image, then using four textures, on 2048x2048, one
952x2048, one 2048x452 and one 952x452 will cover your image.

Regarding cracks, the more tiles the more potential cracks there will
be. Although if you're drawing 1:1 without filtering, you should be
able to align the texture to the screen such that there are no cracks.

In general, I'd suggest just writing what is easiest for you to
implement, and only consider something more complicated if there's
actual evidence that performance is bad because of your implementation.

        Eyal

mikegi wrote:
> I'm using a large background bitmap in my DX app. Users want the ability to
> add higher resolution bitmaps which will exceed the max texture size of most
> chips. So, I'll need to tile the background. Should I standardize on a fixed
> tile size, say 256x256 or 512x512, or use variable sizes tiles? It seems
> like fixed-size tiles would help prevent cracks at the boundaries. The
> advantage of smaller tiles is that they would use less texture memory but
> they would be slower because of more texture switching. Larger tiles would
> be less memory efficient but faster.
>
> I'm looking for thoughts from those who've been there and fought with the
> details. What worked best in actual practice?
>
> Thanks,
> Mike



Relevant Pages

  • Re: Tiling large bitmap, what size tile is best?
    ... In addition, another large texture I ... result in less waste in the tiles on the right and bottom. ... >> I'm using a large background bitmap in my DX app. ... >> be less memory efficient but faster. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Think twice before using Direct3D for tilemaps
    ... DirectX is unweildy for making simple 2D games because DirectDraw has been ... set texture and DrawPrimitive calls. ... buffer and set the texture coordinates to corrospond to your batched tile. ... Clearly you only do this for onscreen tiles. ...
    (rec.games.roguelike.development)
  • Help please: Map of tiles has seams when a zoom is applied.
    ... Im having quite a bit of trouble with zooming in on a map of tiles I am ... drawing with DirectX. ... I have tried playing with the Device's RenderState and Texture stage to ... trying to roll my own render method, or switching to DirectDraw which I ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Tiling large bitmap, what size tile is best?
    ... image and a set of device caps, and will load all of the data into memory ... > like fixed-size tiles would help prevent cracks at the boundaries. ... > advantage of smaller tiles is that they would use less texture memory but ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Travertine and thermal shock
    ... the tiles have cracked (in ... >would be grateful for a geological perspective on this. ... >those lines happen to co-incide with joins in the ply laid down ... that was the cause of the cracks. ...
    (sci.geo.geology)