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

[3.x] Support AtlasTexture in radial modes of TextureProgress #68246

Merged

Conversation

arkology
Copy link
Contributor

@arkology arkology commented Nov 4, 2022

Closes #34837 for 3.x
Same changes are made as in #66352

@arkology arkology requested a review from a team as a code owner November 4, 2022 10:27
@akien-mga akien-mga added this to the 3.6 milestone Nov 4, 2022
@kleonc
Copy link
Member

kleonc commented Nov 4, 2022

Note that this (and #66352) adds support only for trivial case, AtlasTexture margins are ignored and nested AtlasTextures are not handled. Some examples:

(on the right Sprite2Ds, each rendered properly; on the left TextureProgresss with progress texture matching the sprite on the right)
godot windows editor dev x86_64_zLnC5DS9uF


But it does make sense to merge this to make 3.x/master match. It can be improved in another PR.

@arkology
Copy link
Contributor Author

arkology commented Nov 7, 2022

I looked at what can be done, and here are my preliminary thoughts:

  1. We have this phrase in docs: "AtlasTexture does not work properly if used inside of other AtlasTexture resources"
  2. Nested AtlasTexture drawing works because draw_rect and draw_rect_region are recursively called
  3. Not sure that drawing polygon correctly using nestest AtlasTexture could be done without changing much code and in elegant way. Taking into account (1) and (2), I think it could be left as it is now.
  4. Not sure is it even possible to add margins support for polygon, need more time to think.
  5. We have CPU_ and GPU_ 2d particles with the same limitations - margins and nesting are not supported.

Summing up, current implementation is OK and could (or could not) be improved in future (just newbie thoughts, maybe maintainers have a different opinion).
(I was afraid that my first PR is not correct, but looks like notes made by @kleonc is just implementation limitations and there's no need to reopen original issue and redo everything).

@akien-mga akien-mga merged commit 11c14ce into godotengine:3.x Nov 9, 2022
@akien-mga
Copy link
Member

Thanks!

@arkology arkology deleted the 3x_progressbar_atlastexture_radial branch November 9, 2022 12:20
@akien-mga akien-mga changed the title [3.x] AtlasTexture in radial modes of TextureProgress [3.x] Support AtlasTexture in radial modes of TextureProgress Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants