Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tilemap texture bleeding #98

Open
Rombusevil opened this issue Sep 25, 2016 · 6 comments
Open

Tilemap texture bleeding #98

Rombusevil opened this issue Sep 25, 2016 · 6 comments

Comments

@Rombusevil
Copy link

I'm experiencing some texture bleeding with tile maps that I can't seem to get rid off.
One thing I'm trying to test is to add double padding to the tilesheet, as I've been reading is a proper solution, but the problem is that the padding/margin I add on Tiled is not being interpreted by the FlxTilemap loader and I'm not being able to modify it to take it into account.

This problem occurs after the update to the last commit d8d2808 with changes I suggested of removing int casts. On issue #30 I was wondering why those explicit casts where there... this might be the answer (as this problem didn't occur before the update)

@moly
Copy link
Contributor

moly commented Sep 25, 2016

Could you upload a screenshot of the issue please?

@Rombusevil
Copy link
Author

0

There you can se some horizontal bleeding, apparently is only visible with transparent tiles and it's related with camera movement (I only see those lines when the camera moves fast)

@moly
Copy link
Contributor

moly commented Sep 28, 2016

Is it definitely texture bleeding? Are the tiles next to something with those colours in the tile sheet? I've had a look at the changes to the int casts and I can't see what could have caused texture bleeding like this. Could you try adding back some of the casts in FlxTilemap and see if you can isolate which lines are causing the issue.

Thanks

@Rombusevil
Copy link
Author

Rombusevil commented Sep 29, 2016

Let me check... Yes, here's the spritesheet where it shows the background tiles and the dead guys on top that are the ones bleeding in.
captura de pantalla de 2016-09-28 22-04-27

I'm going to do what you suggest to see if I can isolate the problem (hope to do it sooner but if not I'll do it this weekend)

@Rombusevil
Copy link
Author

Reporting back having done some testing.
The casts that generates the bleeding are the most important casts of the fix :P as are the responsible lines of not jiggling the map.

Lines 427 and 428 of FlxTilemap class, drawTilemap(...) method.

Any idea on how to fix this?
I kind of fall short on this one.

More details:
Only happens on android version. Run same code on desktop and works fine.
Only bleeds textures when the tile has transparency (the first screenshot I showed only shows the bleeding in the back, and not in the ceiling or floor that are solid tiles)

@moly
Copy link
Contributor

moly commented Oct 1, 2016

That's odd, I can't see how those lines would cause this bleeding. They determine the position to draw the tile on screen, but not the tile region itself. I can only think of two things to try at the moment:

In the pack file for your spritesheet, near the top there should be line that starts filter:. Make sure this is set to filter: Nearest,Nearest. If you're using a different type of filter it can cause this sort of bleeding, although I don't know why it would only show after the change to the int casts.

If it only happens on android but not desktop, it sounds like it could be a bug in the libgdx android implementation. Could you try updating to the latest libgdx nightly and see if that fixes it? We haven't updated in a while so you might have to make a couple of changes but hopefully nothing major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants