Pixel bleeding in Tilemaps with filtering enabled
Godot 2.1.2 x64 Linux kubuntu 16.10
When enabling filtering for tilesets, you can see bleeding from neighboring tiles on edges. For example
You can clearly see that pixels from white tile above are bleeding into the one displayed.
Steps to reproduce:
- Create a tilemap from tileset with filtering enabled.
- Paint tiles that have differently colored neighbors to see the bleeding.
Note this is NOT a duplicate of #1682.
@ArcFutahito BTW, this is mentioned in the docs, so it is a known issue..
Bad Zoom.tar.gz If only disabling filtering didn't make things worse
Honestly, I am out of options. With filtering I have artifacts, without filtering sprites become complete shit during movement, zooming out makes art look like shit and blowing up pixel art to 1.5x size makes it look bad. On top of all this games stutter despite >60 fps which looks more and more like some fuckup in the engine.
Jokes aside, I am really bummed because of godot right now.
So the issue with tile atlases is that the linear filter causes neighbor tiles to bleed on the edges... that's just the way it is.
How about introducing a slight padding to the UVs? I used to do that in my previous projects.
Another way is to add a margin of 1 pixel to all your sprites (so instead of say 32x32 you have 34x34 per tile, where you fill the margins with one row/column of pixels of the same colours) and select an inset of 32x32 of that. This hack can probably be automated (no need to do it by hand :p), never tried it but just had the idea :)
No idea why nearest filter still produces artefacts however. Maybe vertex positions? I have this too in my game, maybe a similar padding technique can take care of it?
Edit:
I had a try with the atlas margin, works like a charm:

This is a hardware limitation of any engine that runs over a 3D API.
I was thinking of adding a hack in 3.0 to clamp the uvs to the region if repeat is disabled, though (this is impossible to do in 2.1).
On Mar 20, 2017 10:42 AM, "Marc" [email protected] wrote:
How about introducing a slight padding to the UVs? I used to do that in my previous projects.
Another way is to add a margin of 1 pixel to all your sprites (so instead of say 32x32 you have 34x34 per tile, where you fill the margins with one row/column of pixels from the opposite side) and select an inset of 32x32 of that. This hack can probably be automated, never tried it but just had the idea :)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287762028, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z23lSY-TWSiIjtKMOZ-s523JF2R2Kks5rnoIvgaJpZM4MiBU1 .
sorry my english you try to use texture "power of two"? example image file size: 8x8 16x16 32x32... The engine has problems with this "rule" with 2.1 I do not know if 3.0 happens the same (unofficial godot compiles)
@reduz Even without problems in filtering that leaves the issue of stuttering. https://www.youtube.com/watch?v=p4niEyvqLZo It's not because of load, it's not because of heavy scene, it's not because of too many calls each frame, but it's there without doubt.
At this point I don't think this is godot fault anymore. After VSync was implemented it does no longer depend on Godot..
On Mar 20, 2017 7:17 PM, "ArcFutahito" [email protected] wrote:
@reduz https://github.com/reduz Even without problems in filtering that leaves the issue of stuttering. https://www.youtube.com/watch? v=p4niEyvqLZo It's not because of load, it's not because of heavy scene, it's not because of too many calls each frame, but it's there without doubt.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287915628, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z2wHpkeCWOTBeTtRiEk-2nmcAzramks5rnvsNgaJpZM4MiBU1 .
Is it driver/hardware dependent? I have vsync turned off and tried limited/unlimited fps. Both produce this stuttering.
vsync turned off OR limiting fps will always result in stuttering. Just leave vsync on and do not limit fps.
On Mon, Mar 20, 2017 at 7:34 PM, ArcFutahito [email protected] wrote:
Is it driver/hardware dependent? I have vsync turned off and tried limited/unlimited fps. Both produce this stuttering.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287919296, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z20Yy_CivcBawMQG5ItDhP91Uxncwks5rnv73gaJpZM4MiBU1 .
Same thing with vsync on.
most likely driver issue then. If your stutter happens from time to time (ie, a skip every a few seconds), then that's your OS/compositor fault
On Mon, Mar 20, 2017 at 7:52 PM, ArcFutahito [email protected] wrote:
Same thing with vsync on.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287922980, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z22jhM3UynxikUBYBd2BoqJECVgSuks5rnwMegaJpZM4MiBU1 .
Only in Godot though. Other games and OS itself run on smooth 60 fps
it may be because godot uses all your CPU by default, does it happen if you run your exported game with
-fdelay 1
?
On Mon, Mar 20, 2017 at 8:12 PM, ArcFutahito [email protected] wrote:
Only in Godot though. Other games and OS itself play on smooth 60 fps
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287927106, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z214xdfruEnLf5HA3AQNb0t5Rg6WBks5rnwf5gaJpZM4MiBU1 .
although vsync should take care of that so you don't use all your fpu.
Honestly Godot does nothing special on it, I suggest you pay attention in your other games, as general when a lot of thing goes on on screen its difficult to notice stuttering but it's still there
On Mon, Mar 20, 2017 at 8:19 PM, Juan Linietsky [email protected] wrote:
it may be because godot uses all your CPU by default, does it happen if you run your exported game with
-fdelay 1
?
On Mon, Mar 20, 2017 at 8:12 PM, ArcFutahito [email protected] wrote:
Only in Godot though. Other games and OS itself play on smooth 60 fps
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287927106, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z214xdfruEnLf5HA3AQNb0t5Rg6WBks5rnwf5gaJpZM4MiBU1 .
On video I have system monitor to preempt this question. It's certainly not because of cpu load. I can also post side by side comparison of godot running and, let's say, Enter the gungeon (which is top down 2d bullet hell game). It definitely doesn't have this stuttering.
beats me then, talk to whoever supplies video driver for your compositor and ask them to take a look. Godot does nothing out of the ordinary so it's definitely not at fault for the stutter.
Most likely it's triggering a bug in your specific setup.
On Mon, Mar 20, 2017 at 8:21 PM, ArcFutahito [email protected] wrote:
On video I have system monitor to preempt this question. It's certainly not because of cpu load.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287928792, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z28Za8f8O_WAcqTipHlCtSuI1-QHiks5rnwoUgaJpZM4MiBU1 .
I would've thought that if there was unusual behavior in other games or applications but a bug in setup that's popping up only in godot? I'm not sure.
If you believe the problem comes from Godot, you can eventually install profiling samplers yourself everywhere in the main loop to find out where stutter happens on the lower level, if you find how to do it with minimal overhead.
Also, stuttering is not the title of this issue. If you want to talk about it, I suggest you do it on a dedicated issue (that one? https://github.com/godotengine/godot/issues/2043)
Yes, defininitely. If it only happens to few people in specific configurations, it is most likely unrelated to Godot. I noticed this behavior with Noveau drivers, and they went away when installing the binary Nvidia driver, and in far most cases users report this when running under Linux compositors.
On Mon, Mar 20, 2017 at 8:35 PM, ArcFutahito [email protected] wrote:
I would've thought that if there was unusual behavior in other games or applications but a bug in setup that's popping up only in godot? I'm not sure.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/8084#issuecomment-287931393, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z28ZWbP1-Xuc6acflTmEJxaOlsxQPks5rnw1VgaJpZM4MiBU1 .