-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 rendering incorrectly when positioned exactly on .5 #76517
Comments
I checked the code, but could not find anything wrong on the TileMap side. I think there's likely an issue with the rendering code but I have no clue what would cause that. As a workaround, it seems like disabling |
Is it related to #82696? |
I cannot reproduce, either on 4.0.4 or 4.3.dev, with the supplied MRP. Can you confirm that the issue is still relevant, @blDraX? |
@adamscott: Yes, I can still reproduce this with the minimal example I've attached on v4.2.1.stable.official [b09f793]. In fact, while also testing this on my pixel art project, I found that the camera being close to .5 does not only do weird things to the tilemap but to my animated sprites as well. Check out this clip: The diamonds moving up and down is not a change in position but implemented as animated sprite with three frames. Attaching the texture I'm using as well. When the camera is on .5, the pixels are doing.. super weird stuff? Attaching the png as well. (in the video you can also see the problem on the tilemap again. Check out the side of the cliffs for example. Outmost pixel column is duplicated and on the other side, one column is cut off; also attaching a marked screenshot) |
@blDraX What should I see then in the MRP you joined? |
@adamscott: Sorry, I probably didn't choose a good texture in the MRP that easily shows the issue. But you should see essentially what I've also shown in the first video back in April last year. Change the camera position between 0 and 0.5 for example. You will see the tile texture wandering by one pixel column. Here a recording using the MRP: |
@adamscott @Cerno-b @groud I would like to bring attention to this issue again as it is still unsolved for me. @groud previously mentioned that disabling texture padding can be used as a workaround. It's true that this prevents this specific rendering issue from happening but instead, a new issue arises: It seems like in the situations where the bug previously occured, the respective rows/columns are now instead not drawn at all: It's hard for me to understand what is going on here and why only certain tiles are affected. I also have the issue attached on video which should make it a bit more clear what is going on. I also want to add that this issue is apparently not limited to tilesets but also applies to ohter kinds of tiles images like for AnimatedSprite2D. In the second part of the video, you see the player sprite getting weirdly distorted as the camera moves diagonally, following the movement of the player up the slope: For example, the lines appearing above the player sprite sometimes is actually the bottom row of one of the frames of the animation (the feet of the player sprite): For reference, this is a part of the respective sprite sheet I'm using (tiled 32x32): Here is the video: |
I can confirm that this issue is still present on the latest stable release (4.3-stable) |
I've published a PR (#97891) which fixes this issue whose scope seems to include things like Sprite2D outside of the original Tileset issue, meaning that it encompasses other issues outside of this one, although I wasn't able to check them all. Would you be able to check which specific issues regarding pixel rendering were fixed for your project @blDraX? |
cc. @markdibarry |
Hm. I get a segfault when trying to load the MRP, both in PR branch and in master. I'll tinker a bit. |
Godot version
v4.0.2.stable.official [7a0977c]
System information
Windows 11
Issue description
When using typical settings for obtaining pixel-perfect rendering (texture filter nearest, stretch mode viewport), tilemaps do not render correctly when they (or the camera) are exactly positioned on a half-pixel (e.g. 0.5). Looks like the left-most column is duplicated and the right-most column is cut off. Only tested for a horizontal .5 coordinate.
Aufzeichnung.2023-04-27.194721.mp4
Steps to reproduce
Set up new project with a tilemap. Build a simple tilemap. Set texture filter to nearest and stretch mode viewport. Make resolution very small to make issue more apparent.
Minimal reproduction project
tilemap_rendering.zip
The text was updated successfully, but these errors were encountered: