Jump to content
  • Advertisement
Sign in to follow this  
stealthgate

having trouble making my tiles seemless in-game

This topic is 4374 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

I've created a seamless isometric tile, ok, just fine in that department. Now, I tried two different methods to make it so I can connect them in-game. 1) I used black, and then a bright pinkish color, and keyed those bg colors out of the image when I D3DXCreateTextureFromFileEx. I tried .bmp, .png, .jpg; these formats simply had speckled backgrounds, but were not completely keyed with the pinkish colors (I figured because the image was not saved truly due to compressing [but the bitmap??]. The black did sort of just fine, but for around the edges of the actual texture pixels, which happened to be grass. 2) I saved the image as a .png with a black, then white, background. Opened up Photoshop and used the magic eraser tool to get rid of the bg color and save as a .png. The same thing happened and their was still bits of background color along the edges of the grass pixels. I'm at a complete loss how to make this tile (or any tiles) seamless. The textures *are* seamless but not "in-game" which is a custom 2d engine (<-most likely the prob). Any help would be greatly appreciated. -stealthgate

Share this post


Link to post
Share on other sites
Advertisement
Are the tiles scaled in any way when you draw them in-game? I ran into this problem when working on my tile maps. There's a small edge of color around them on certain video cards or when they are scaled in any way other than 100%.

I got this to go away by doing two things.

1) When I create my textures, I load them with no filters (Filter.None) on them. I want pixel-perfection!

2) Before I call my draw code, I use the following settings:
graphics.D3DSprite.Begin(SpriteFlags.None);
graphics.D3DDevice.SamplerState[0].MinFilter = TextureFilter.None;
graphics.D3DDevice.SamplerState[0].MagFilter = TextureFilter.None;


This seemed to resolve my issues with the problem you're describing. Try it out.

Share this post


Link to post
Share on other sites
I've come across this problem too! Maxamor is right, it's easy to have your game "scale" your bitmaps without you knowing it. For example, if your using the "Blt" function, and the dimensions in your rect.dest don't match the dimensions in your rect.source, that is one way it can happen. But it might be something much simpler. Your grass tile might LOOK like it's completly bordered by black, but it really isn't. Keep in mind that if the value of the color is off by even 1 then the transparency won't work. In other words the color might LOOK black, but it's really dark dark dark grey. Using PhotoShop I found that it likes to add a certain fuzziness to all edges. So you might want to try going over the edges pixel by pixel and make absolutly sure that all black pixels are really black. Hope this helps.

Share this post


Link to post
Share on other sites
I'm glad to see this problem isn't one that's few and far between - good thing headaches like this are shared! I found out exactly what was going on. I was rendering the model to an image with anti-aliasing enabled (as available in 3ds max at least), and my map filters were ridiculously high (for me) 2.0! Thanks for the heads-up Maxamor!

I didn't know either than scaling could give some problems...I am NOT going to forget that one - never again do I want to waste time on such a problem that needs an idiot fix!

thanks guys!

Share this post


Link to post
Share on other sites
Yes, that "fuzziness" is the filtering. It may be set to Filter.Normal or Filter.Linear which all blur it a bit. So if you're trying to get pixel-perfect sprites and tiles turn Filtering off completely like the code in my previous post does.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey, by the way, I'm having trouble DRAWING seemless tiles myself. There seems to be plenty of tools out there to seamlessly draw square tiles, but I havn't found anything good to compose seamless diamond (isometric) tiles. Any leads?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous PosterThere seems to be plenty of tools out there to seamlessly draw square tiles


There are? I'm gonna go have a look for them now, but before I forget, and in case I can't find any, what kind of tools are we talking about?

Share this post


Link to post
Share on other sites
Quote:
Original post by Deyja
Photoshop's pattern maker can automagically create seamless textures/tiles.


Not sure if I used that or Photoshop's "Tilemaker". Whichever one it was, was rubbish. All it did was blur the edges... Not what I want.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!