Repository navigation
Features
Depth testing
UGizmos.depthTest = true makes every gizmo respect the scene depth buffer, so anything behind other geometry is not drawn.
UGizmos.depthTest = true;Left off, the look is unchanged: wireframes and points draw on top, solid primitives show their occluded parts faintly.
Built-in Render Pipeline sample
A BRP sample scene is now available from Package Manager > UGizmo > Samples. Its scripts subscribe to UGizmos.OnDraw rather than using OnDrawGizmos, which is editor-only and lags a frame behind.
Gizmos in release builds, without setup
The UGIZMO scripting define is added on first import, so release builds draw gizmos out of the box. To strip them and get the zero-cost behaviour, untick Tools > UGizmo > Keep Gizmos in Release Builds.
Fixes
- Unity 2021.3 could not compile the package. It used
GraphicsBufferAPIs that only exist from 2022.2, despitepackage.jsondeclaring 2021.3 as the minimum. - Gizmos never rendered in player builds. Nothing referenced
UGizmoDispatcher, so its[InitializeOnLoad]static constructor never ran outside the editor and no draw path was hooked up. - Depth testing was a no-op under URP. Gizmos were drawn from
endCameraRendering, which leaves no depth attachment bound. They are now drawn from an injectedScriptableRenderPass; no Renderer asset changes are required. - Occasional garbled vertices and crashes.
Reserve()returned pointers into a shared buffer that a laterReservecould reallocate, leaving jobs writing into freed memory. Reservations now return indices and are all taken before any job is scheduled. - The Benchmark sample was missing its script.
Performance
- Line matrices are built directly instead of through a quaternion and back, removing a length, a normalize, two square roots and a matrix conversion per line.
- Jobs are no longer scheduled for gizmo types with nothing queued that frame.
DateTime.Now, which costs a timezone conversion per call, is gone from the per-draw path for duration gizmos.- Startup type discovery only scans assemblies that reference UGizmo.
Compatibility
No API removals. UGizmos.depthTest is new and defaults to false, so existing projects render exactly as before.
Full Changelog: 1.1.0...1.2.0