Skip to content

Conversation

@wouterlucas
Copy link
Contributor

✨ What changed? ✨

  • Decouple isRenderable from hasRenderableOwner as textures can be loaded asynchronously.
  • Refactored the isRenderable detection:
    • If a node has alpha = 0 or is off screen its not renderable
    • If a node has dimensions and color properties, its marked renderable and we assume its a ColorTexture.
    • If a node has a texture, it will be marked as a renderable owner. Which will trigger loading of the texture (if its the first owner)
      • If the texture is loaded, it is marked renderable
  • On renderQuads we assume everything has a texture if not we set the defaultTexture for 1x1 sampling. This is implicit but matches the old behaviour.
  • CoreTextNode overwrites behaviour and checks for text !== ''.
  • Also fixed a bug where the default texture was still loading but already referenced.
  • Added a CoreNode unit test to validate this more rapidly.

🔧 Addresses the following
Fixes #477

@wouterlucas wouterlucas added this to the 2.9.0 release milestone Jan 9, 2025
@wouterlucas wouterlucas added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit ad55881 Jan 10, 2025
2 checks passed
@wouterlucas wouterlucas deleted the refactor/isRenderable branch January 10, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All nodes are renderable

4 participants