   2d tiles in D3D - can I get rid of the gaps?
  I'm trying to get some basic 2d tiles in D3D.I set the camera back a bit, and draw 4 quads. I make each quad 64 units in length, and start the next quad at lastquadsLeft + 64.0f. I use a tiling texture.However, as I scroll the camera left or right (it doesn't turn) I can see gaps between the quads.Now, I could use the D3Dsprite interfaces, but then I wouldn't be able to use fx files, and I would like to build them in somehow.Is there a way to make these quads appear to be continuous without any gaps, or should I just give up and go with sprites and forget fx?   
  I had the same problem as u did while trying to draw the terrain for a rts game. I solved it by scalling the quads by 1.05f. U could also try multisampling (if u haven't already)   ;  Or just try adding 0.5 to the vertices to the quad making up your tiles.   ;  I have the same problem, I have a blue rectangle(gap) around tiles...I've tried to add 0.5 to bottom and right pos already but that doesnt helped me.I'm drawing tiles like thisSprite.Begin(D3DXSPRITE_OBJECTSPACE or D3DXSPRITE_DO_NOT_ADDREF_TEXTURE);Loop where I draw all tiles:Sprite.Draw(Texture, Rect, nil, Vector, D3DCOLOR_ARGB(255, 255, 255, 255));Finish:Sprite.End();Can anybody show me any example with 2d tile drawing in D3D? Thank you for any answers...[Edited by - Overdose7 on April 27, 2009 6:37:01 AM];Quote:Original post by FunsoIs there a way to make these quads appear to be continuous without any gaps, or should I just give up and go with sprites and forget fx?Sprites are just quads.How exactly are you rendering these quads? Can we see some code?   ;  First, offset your screen coordinates (not your texture coordinates) by 0.5f units - all of them, including the top left. That will prevent texel dancing, because at even screen coordinates, the pixels would hit the exact space between two texels, so depending on the round-off error, the texture mapping unit will sometimes use the left texel and sometimes the right if you use point filtering.Next, make sure you're using identical coordinates for the sprites. Not just calculations that _should_ result in the same coordinates, but actually the very same coordinates. Otherwise, the floats may have minuscule variations that can result in small seams depending on the camera position.For example, this would cause problems:for(int quadY = 0; quadY < width; ++quadY) {  for(int quadX = 0; quadX < height; ++quadX) {    vertices[vertexIndex].X = quadY * 2.0f - 1.0f;    vertices[vertexIndex + 1].X = quadY * 2.0f + 1.0f;  }}If you use point filtering, you're done here :)If you use linear filtering, use the CLAMP adressing mode. Otherwise, the border pixels of a tile will interpolate either to black or to the color of the neighboring tile. Another solution is to add a border to the tiles on the texture only. For example, for a 16x16 tile, reserve a 18x18 region, where you use the border to specify the color the texture mapping unit should interpolate to at the tile borders.But some code would definitely help!   ;  Thanks for the input, you're right about using clamp, that helped, I was using wrap in my fx file. If I use point filtering, yes the problem goes away. Now of course if I move the camera nearer the quads, the texture looks very pixelated, but still this might work, zooming in/out is not an intention. And the quads are being drawn at virtually the same resolution as the texture itself, so I am not losing much by using the point filter.   ;  This can most definitely be solved with quads, with linear filtering. Could you show the code for your vertex buffer, where you create the quad coordinates?   