Skip to content

Conversation

@blamelessgames
Copy link
Contributor

@blamelessgames blamelessgames commented Dec 7, 2025

Objective

  • I am using gizmos to visualize some long-term debugging information that grows considerably over the lifetime of my sessions, and using retained gizmos helps me avoid the slowdowns I was experiencing, however I wish to be able to hide them and retained gizmos currently do not respect visibility components

Solution

  • Following the visibility-related code in other bevy systems, I implemented visibility culling for retained gizmos

Testing

  • Changes were tested by building a new retained gizmos example.

- set `Visibility` as a required component on `Gizmo` components in
  `GizmoRenderPlugin`
- update `extract_linegizmos` to take view visibility into account
- update the 3d_gizmos example to toggle visibility of the retained
  gizmo in the scene

investigating the feasibility of attaching an AABB to the gizmo for
better visibility testing

will build a `retained_gizmos` example to better demonstrate the
feature. it's kind of crammed into the current example code
- add a visibility class to the gizmo
- calculate AABBs for the gizmos
- start a new example for retained gizmos
@blamelessgames blamelessgames force-pushed the visibility-for-retained-gizmos branch from 4917325 to d07ee96 Compare December 7, 2025 06:20
@blamelessgames blamelessgames marked this pull request as ready for review December 7, 2025 06:47
@mnmaita mnmaita added C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Gizmos Visual editor and debug gizmos D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 8, 2025
@blamelessgames
Copy link
Contributor Author

it occurs to me that it is probably possible to make the mark_x_changed_if_assets_change systems into a single generic system, i'll take a look at doing that

@blamelessgames
Copy link
Contributor Author

it occurs to me that it is probably possible to make the mark_x_changed_if_assets_change systems into a single generic system, i'll take a look at doing that

I think this is feasible but it lends itself to a bit of a scope expansion because there are at least two different ways this is currently happening, possibly more I haven't found yet. I'll address it in another more targeted PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants