-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Draw materials in tile atlas view #77909
Conversation
79e6c37
to
dae1dd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soooo. I've been thinking about it a bit and I am a bit worried this cached materials pool could become big as it is only cleaned when changing sources. While most of the edits only trigger queue_redraw.
I would be more confident if the cache was cleaned dynamically in the drawing functions. The idea would be, when drawing, to keep track of the materials in the cache that were not used by any tile, then free the corresponding CanvasItems at the end of the drawing function.
Also, this needs to be implemented for _draw_alternatives
, which means you probably need two HashMaps to store the CanvasItems.
I implemented what you said and then discovered that material change always results in |
dae1dd3
to
755d4ea
Compare
Ok pushed fix for alternate tiles. I did not add removing unused materials for the reason described above. |
755d4ea
to
16ac217
Compare
hmm, that sounds like a bug though. I don't really understand why that would be triggered. |
Thanks! |
Can confirm this solves #77672. This is so much better thank u!!! |
Cherry-picked for 4.0.4. |
Fixes #77672
godot.windows.editor.dev.x86_64_jduJMJS1OT.mp4
Test TileSet:
Shaderset.tres.txt
(requires icon.png)
There is also a separate (and unreported?) issue where the "ghost" tiles (i.e. when drawing on TileMap) are not using their material.