Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

red_sodium

Gaps appear in tiled area

This topic is 5167 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey GDers, I''m using DX9b SDK and ID3DXSprite for a 2D game. The problem is that when I render my tiles in a grid formation, I get 1 pixel wide gaps that look like lines in between tiles, even when they''re the exact number of pixels in position (64 in this case). When I move the camera, the gaps flicker on and off and I get it in between different tiles. Does anyone know why this happens and does anyone know of an easy solution? Thanks Stay Clausal, Red Sodium

Share this post


Link to post
Share on other sites
Advertisement
I''ve had that too on some projects, and not on others. You could try playing with the frustum, that might help. I''m not sure why it doesn''t happen to me sometimes...

Share this post


Link to post
Share on other sites
Is your near plane set to 1.0? Setting it to 0 can cause such things sometimes. Also, there''s another post currently on here about something similar. Basically, your tiles should be powers of 2.

Chris

Share this post


Link to post
Share on other sites
Nope, that doesn''t help. I have the same problem.
Nothing I''ve tried so far works.

The only work-around I''ve found is "padding" color
around your tiles. Make the padding around the texture
coordinates match the color inside the lines. For far
distances, you need to pad it with 2 pixels

Share this post


Link to post
Share on other sites
Glad to see I''m not the only one with these problems.

As I said above, my tiles are 64 x 64, and I tried the FOV fix but it didn''t work.

I do not want to have to pad my tiles: no cheap hacks. Surely there must be some easier way.

I also get a slight shimmer when I move my camera in relation to the grid of tiles sometimes.

Stay Clausal,

Red Sodium

Share this post


Link to post
Share on other sites
Using Radeon 8500? I see the same shimmers. Mine seem to
appear when I try to render one mesh on top of another.
Even with Z-buffering off, the back mesh seems to want to
come through. Farther away I go, the worse it gets.

Let me know if you figure out a solution?

Share this post


Link to post
Share on other sites
Err, nVidia TNT 2, its extremely annoying and I can''t seem to get rid of it. Moving the camera around at an angle doesn''t get rid of it. Please, I really don''t want to have to resort to padding - there surely must be some other way?!

Stay Clausal,

Red Sodium

Share this post


Link to post
Share on other sites
I believe it's actually texture filtering that's doing it.
At least that's what my problem was. It makes sense. It's
using the colors around each color to blend in the filter.
So it's using the transparent color around our tiles. Try
setting these right before you draw your tiles (if you're
using the D3DXSPRITE class, set these after Sprite->Begin()):

Device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
Device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);

I'm not sure why D3DXSPRITE turns on filtering, but it looks
100% better with it. So I'm sticking to padding

[edited by - Jiia on May 20, 2004 9:56:07 AM]

Share this post


Link to post
Share on other sites
That isn't my problem, because the tiles I am using have no transparent areas around them. I tried your code anyway and it didn't change anything. Thanks anyway.

I really, really don't want to use padding. Really. It would feel cheap and hacky and surely many developers have this problem? Any other suggestions?

PS:
quote:
You could try playing with the frustum, that might help.
Read that out aloud, sounds a little, err :S
Anyway, how could I change it in such a way that it might eliminate these problems? Thanks.


Stay Clausal,

Red Sodium

[edited by - red_sodium on May 21, 2004 12:09:21 PM]

Share this post


Link to post
Share on other sites
Are you developing in 2D or 3D?

Do your tiles look pixelated when you zoom in?

If you''re using mip-maps, I think you need to disable
their filtering systems, too. Not too sure about it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!