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 (not DirectDraw). Drawing the actual tiles works
fine without a zoom:
http://img409.imageshack.us/img409/2241/goodciv2pp5rv.jpg

But if I apply even a little bit of a zoom I get seems:
http://img409.imageshack.us/img409/3628/badciv2pp6pw.jpg

And this is driving me crazy.

I am using the Sprice to draw everything, and I am setting is transform
like so to do the zooming:
sprite.Transform = Matrix.RotationZ(0f) * Matrix.Scaling(viewZoom,
viewZoom, 1.0f) * Matrix.Translation(0f);

And it almost works! Which is what kills me, Im so close.

I have tried playing with the Device's RenderState and Texture stage to
a little avail: if I set
controller.Device.RenderState.SourceBlend = Blend.DestinationAlpha;

Then the problem completely goes away, but this turns off alpha
blending I think, such that textures that use alpha for transparancy
effects (overlayed on the base tiles) seem completely solid now.

I now *think* this problem may be something related to how I am loading
the texture. My texture is loaded from a png file, and I go through
and change three pixels colors to be transparaent right after its
loaded. I thought that was OK, but on a hunch I created a DDS texture
file with the alpha channel set up correctly and then the seams almost
disappeared. But not completely.

I am really not sure where else to go from here, other than maybe
trying to roll my own render method, or switching to DirectDraw which I
dont want to do. Anyone have help or ideas about where I should look?

.



Relevant Pages

  • Re: Tiling large bitmap, what size tile is best?
    ... I don't understand why you're saying "Larger tiles would be less ... Regarding cracks, the more tiles the more potential cracks there will ... able to align the texture to the screen such that there are no cracks. ... > be less memory efficient but faster. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • 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)
  • Re: Buffer Surface/Texture D3D Problem
    ... A managed texture maintains a copy of the image in system ... > memory, and uploads it to video memory as needed by your application. ... > are pretty much limited to using it for rendering 3D primitives. ... > One distinction between DirectDraw and Direct3D, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Buffer Surface/Texture D3D Problem
    ... and use these to texture quads to be rendered to the screen. ... uploads it to video memory as needed by your application. ... for rendering 3D primitives. ... One distinction between DirectDraw and Direct3D, ...
    (microsoft.public.win32.programmer.directx.graphics)