godot
godot copied to clipboard
Godot 4.0 tilemaps has huge performance issues with ysorted tilemaps
Godot version
4.0.stable
System information
Windows 10, OpenGL ES
Issue description
When I create a scene with tilemap ( in my case it is isometric) it has ok performance but after I enable y-sort which is required for isometric it has huge performance impact. This is not a big case where tilemap is small but it gets worse with tilemap size. (I think y-sort is calculated for offscreen elements on every frame :( )
Steps to reproduce
Create a isometric tilemap add big tile (In my case 400x400) enable y-sort for both layer and for tilemap. when you run game it is 1-2 fps
Minimal reproduction project
See #73813.
Hello, I also have the same problem (without ysort in the tilemap the game runs at 220fps+, with ysort the game stays at 60fps, dropping to 50 and 40 sometimes). Luckily my game isn't due for release right now, but is there any news on #73813?
Hello, I also have the same problem (without ysort in the tilemap the game runs at 220fps+, with ysort the game stays at 60fps, dropping to 50 and 40 sometimes). Luckily my game isn't due for release right now, but is there any news on #73813?
Please test that pull request locally and confirm whether it works as expected :slightly_smiling_face:
Hello, I tested the PR by building the source using the commands provided in the link. My tilemap has animated water tiles and static ground of different types, its size is (114, 366) (this was obtained using get_used_rect(), but I'm not sure if I understood the documentation correctly), and its tileset is isometric, stacked and has horizontal offset. These were the results:
On godot 4+:
Vsync enabled | Vsync disabled | |
---|---|---|
TileMap YSort enabled | 55fps (dropping to 45 in camera transitions) | 55fps (dropping to 45 in camera transitions) |
TileMap YSort disabled | 60fps (no dropping) | 120 - 130 fps |
On #73813:
Vsync enabled | Vsync disabled | |
---|---|---|
TileMap YSort enabled | 60fps (no dropping) | 180 - 220 fps |
TileMap YSort disabled | 60fps (no dropping) | 220 - 320 fps |
Hello there. I did build the PR in https://github.com/godotengine/godot/pull/73813 and I can confirm that I obtained a similar results as racs4.