I'm aware of the texel thing and the article
over on MSDN but I still can't seem to get everything to go right. I'm hoping some one here will be able to put me out of my misery.
I'm using quads as 2D tiles - I can plot them no problem but when I move around the textures get screwed up.
Here's what it looks like at the start:
This is my debug tile, all the sides are different colours and the middle has a nice gradient, everything is okay.
Now I moved up or down and a bit annnnddd...
The pink line comes from the space surrounding my texture in the main texture file. Why grahhhh?
Here's the code:
Problem.zip(Visual Studio 2005)
It's very light - I've written it especially just to try and sort out this problem.
I would love someone to be able to tell me what changes I would need to make. I'm not in love with the current aspect ratio I'm willing to change :D
The likely culprits
The actually quad size which is currently like this:
verts[TopRight].Position = new Vector3(0.25f - 0.003f, 0 - 0.003f, 1f);
verts[BottomRight].Position = new Vector3(0.25f - 0.003f, -0.25f - 0.003f, 1f);
verts[BottomLeft].Position = new Vector3(0 - 0.003f, -0.25f - 0.003f, 1f);
verts[TopLeft].Position = new Vector3(0 -0.003f, 0-0.003f, 1f);
The 0.003f business is making my texels pixel specific or so I hope.
The camera setup
device.Transform.Projection = Matrix.OrthoLH(5.0f,
5.0f, 0, 1.0f);
Or sometimes I have it like this
device.Transform.Projection = Matrix.OrthoLH(5f,
3.75f, 0.0f, 1.0f);
Making my tiles nice and not squashed - either way I'm stuck with the same problem.
Please help me and my hair.
[Edited by - Balaam on December 13, 2005 2:03:53 AM]