bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Tracking issue: Amazing Gizmos

Open nicopap opened this issue 2 years ago • 15 comments

This issue tracks the progress on Gizmo features

Contributing

Want to check off one of those checkboxes? Nothing easier!

  1. Open a feature request you can copy/paste the description if you feel lazy!
  2. Implement the feature and open a PR!

All related issues will be listed in this tracking issue.

The (IMO) easy ones

  • Linecaps
  • Dotted lines
  • more gizmo shapes
  • light source gizmos

All features

Not sorted in any specific order:

  • [X] Gizmos MVP #6529 Make it possible to draw lines on screen, for them to be immediately despawned next frame
  • [X] AABB gizmos #8468 Draw entity bounding boxes
  • [ ] Light source gizmos: Gizmos that show where light sources are placed, potentially their intensity, color & direction
  • [ ] UI layout gizmos: show outline of CSS flexbox and grid UI elements. #11237
  • [x] More than one gizmo kind: Gizmo line width/depth bias/render layer should be configurable at call site, not just in a resource (system level: #10342)
    • [x] multiple line width
    • [x] multiple depth bias
    • [x] multiple render layers
  • [ ] Retained gizmos: We want to give shape to invisible things such as physics collider. It would make more sense to have a retained API for this. Would supersede wireframe rendering #9178
  • [ ] FixedUpdate gizmos: Currently gizmos do not work if used in the FixedUpdate schedule. (#10973, #9153)
  • [ ] More gizmo shapes (#10571)
    • [x] arrows (#10550)
      • [ ] Double ended arrows
    • [X] lines/linestrip/ray
    • [X] cuboids/rectangles
    • [X] spheres/circles
    • [X] ellipses
    • [X] Regular polygons
    • [X] arcs/ semi-circles
    • [ ] grids
    • [ ] splines
    • [ ] camera
    • [ ] 3D meshes/2D meshes/wireframes (#10621)
    • [X] axes
    • [ ] light bulb
    • [ ] rounded cuboid
    • [x] Cylinder/arbitrary 3d shape extrusion
    • [X] frustum (conical frustrum with 4 segments)
    • [X] pyramid/cone (Cone with 4/N segments)
    • [x] capsule
    • [X] triangle
    • [ ] tetrahedron
    • [X] torus/donuts
    • [ ] Rounded arbitrary shapes
  • [x] Gizmo registry: Allows plugin to register categories of gizmos and defer to user ability to toggle or control properties of gizmos within a category. See #9187 and #10342
    • [ ] System-level gizmo registration: Automate the gizmo registration by inheriting a system-level registry assignation
  • [ ] Actually-immediate-mode API: no SystemParam required, just a macro/function call to draw gizmos, nothing more. No more need to modify the system signature to add gizmos, or even pass around the gizmo struct, in the style of https://github.com/nicopap/bevy-debug-text-overlay/)
  • [ ] dotted lines: Gizmo with a dotted line effect.
  • [ ] Line caps: Gizmo squares have ugly corners because the line caps are not filled. See The tutorial that led to bevy_polyline
    • [ ] Square caps: Extend the gizmo lines by the line width
    • [ ] Round caps: Add a semi-circle of line-width radius to the end of lines
  • [ ] Line Joints: Smooth out space between subsequent lines
    • [ ] Round joints
    • [ ] flat joints
    • [ ] spiky joints
  • [ ] Text gizmos: Draw text on screen without the bevy_text sanctimonious rituals. Just a gizmo_print!("foobar") and it would show on screen.
    • [ ] multiline text: Should support line returns
    • [ ] user-provided font
    • [ ] Text in 2d space: Gizmo should let print text on screen on arbitrary positions in 2D games.
    • [ ] log-style text: Users would not provide a position, but it would show up on screen as event in a way similar to a console message in Garry's Mod or Minecraft. Note: This is already implemented as a 3rd party plugin in https://github.com/nicopap/bevy-debug-text-overlay/
    • [ ] Text in 3d space: Gizmo should let print text in 3D games, may chose to keep the same size with distance or apply perspective.
    • [ ] Oriented text: Text that always faces a specific direction.
    • [ ] Non-overlapping text: There could be a toggle that allows text placed on screen through 2D or 3D API to not overlap, even if they should, given their provided position.
  • [ ] Filled shape gizmos: We want to be able to draw filled shapes, this might be useful for special signaling or highlighting areas. See https://github.com/james-j-obrien/bevy_vector_shapes
    • [ ] semitransparent filled shape gizmos: Semi-transparent this becomes apparently much more useful.
  • [ ] Reactive gizmos: ability to associate Gizmos to game state; accept input from gizmos and modify game state from gizmos. It probably would look like an immediate mode UI, but 3D #9498

nicopap avatar Aug 09 '23 20:08 nicopap

I'm now using gizmos extensively for debug visualizations.

Here's a +1 for filled shapes. One of my gizmos is visualizing a quadtree, another is the nav mesh (using the quadtree) and filled gizmos would let me make an Unreal-style navigable area preview. It works now, just not as easy to look at as it could be.

brandon-reinhart avatar Sep 07 '23 15:09 brandon-reinhart

https://github.com/bevyengine/bevy/issues/9475 also seems relevant.

dmyyy avatar Sep 13 '23 17:09 dmyyy

Could you also add regular and irregular polygons to the list of shapes?

musjj avatar Oct 08 '23 07:10 musjj

Could you also add regular and irregular polygons to the list of shapes?

I think it could be better expressed as "2D meshes". I'll reword the post to be more inclusive.

nicopap avatar Oct 08 '23 07:10 nicopap

Text in 3d space: Gizmo should let print text in 3D games, may chose to keep the same size with distance or apply perspective.

Should have the choice between the text being billboarded or facing a specific direction

SIGSTACKFAULT avatar Nov 14 '23 01:11 SIGSTACKFAULT

Could write a polyhedron function with a similar interface to OpenSCAD's polyhedron() function. And by being less strict about the faces argument (since we only actually care about edges) it would work for polygons too.

SIGSTACKFAULT avatar Nov 14 '23 04:11 SIGSTACKFAULT

Under arrows, could you add "double-ended"? thought of it just now but i'll forget by the time i can do it

SIGSTACKFAULT avatar Nov 18 '23 03:11 SIGSTACKFAULT

I think passing a Mesh to the gizmos would be enough for the polyhedron API (it's listed in the issue as "3D Mesh")

Under arrows, could you add "double-ended"? thought of it just now but i'll forget by the time i can do it

Should have the choice between the text being billboarded or facing a specific direction

Added them!

nicopap avatar Nov 18 '23 07:11 nicopap

Could you add "Compatibility with FixedUpdate"?

SpecificProtagonist avatar Dec 13 '23 19:12 SpecificProtagonist

#11072 technically addressed support for tons of new shapes:

  • Ellipse
  • Capsule
  • Plane (axes and surface normal in 3D)
  • Triangle
  • Regular polygon
  • Cylinder
  • Cone
  • Conical frustum
  • Torus

They don't have their own gizmo methods (except ellipses), but work through the primitive_2d and primitive_3d methods.

Jondolf avatar Feb 03 '24 13:02 Jondolf

Just asking, but does "Round joints" mean that you can have round corners for the gizmos? Would love to be able to draw rectangles, polygons, etc. with rounded corners.

musjj avatar Feb 03 '24 17:02 musjj

does "Round joints" mean that you can have round corners for the gizmos?

Not exactly. Try drawing a rectangle with the current gizmos and a large line width. You'll notice the corners are "cut". The joints would fill the corners. There are several ways to fill the corners, one of them is to fill it with a rounded shape, which we call "rounded joint".

_Ascreencap

nicopap avatar Feb 04 '24 07:02 nicopap

Ah alright, thanks for the explanation. Should I make a new issue about this, or could this just be added to the list above?

musjj avatar Feb 04 '24 08:02 musjj

Well, there is "Rounded cuboid" but not "rounded arbitrary shapes" which seems to be a bit harder to implement. Though no reasons to add them to the wish list: added!

nicopap avatar Feb 05 '24 15:02 nicopap

I think we have to support a better way of using multiple windows with gizmos without having to create multiple configs for all windows

pablo-lua avatar Feb 10 '24 00:02 pablo-lua

Can you mark grid as resolved and add a sub-section "cubic grid"?

pablo-lua avatar Mar 01 '24 23:03 pablo-lua

Can you mark 3d grid #12430, dotted lines #12394 and line joints as resolved please?

lynn-lumen avatar Mar 25 '24 19:03 lynn-lumen

Text gizmos... please

simbleau avatar May 02 '24 00:05 simbleau

@nicopap double-ended can be ticked off. actually a good few can be ticked off. (unless i'm stupid and you're waiting for the features to actually ship)

SIGSTACKFAULT avatar May 29 '24 12:05 SIGSTACKFAULT