Developer tools
The engine's optional developer tools - FPS overlay and frame-time graph, picking debug, render debug overlay, infinite grid, state logging and screenshots - and how to turn them on.
The developer tools are small plugins for looking inside a running game: an FPS counter, overlays that show what the renderer or picking sees, a ground grid for editors. They live in neo::dev_tools and only exist when the neo_dev_tools cargo feature is on.
[features]
dev = ["neo/dev"]cargo run --features devFPS overlay#
FpsOverlayPlugin shows the frame rate in a corner, with an optional frame-time graph:
use neo::dev_tools::fps_overlay::{FpsOverlayConfig, FpsOverlayPlugin, FrameTimeGraphConfig};
use neo::prelude::*;
fn main() {
App::new()
.add_plugins((
DefaultPlugins,
FpsOverlayPlugin {
config: FpsOverlayConfig {
text_color: Color::srgb(0.0, 1.0, 0.0),
refresh_interval: core::time::Duration::from_millis(100),
enabled: true,
frame_time_graph_config: FrameTimeGraphConfig {
enabled: true,
min_fps: 30.0,
target_fps: 60.0,
},
..default()
},
},
))
.run();
}The overlay needs both neo_dev_tools and render_dev_tools. FpsOverlayConfig is also a resource, so a system can hide the overlay or change its colour while the game runs. The frame-time graph isn't available in WebGL builds; the text still is.
The tools#
| Tool | Feature | What it does |
|---|---|---|
fps_overlay::FpsOverlayPlugin | neo_dev_tools + render_dev_tools | Frame rate text and frame-time graph. |
diagnostics_overlay::DiagnosticsOverlayPlugin | neo_dev_tools + render_dev_tools | An overlay listing any diagnostics you choose (DiagnosticsOverlay::fps(), or your own list). |
picking_debug::DebugPickingPlugin | neo_dev_tools | Shows what each pointer hits and logs pointer events. DebugPickingMode::Normal, Noisy (also moves and drags) or Disabled. |
render_debug::RenderDebugOverlayPlugin | render_dev_tools | Draws the renderer's buffers over the scene: depth, normals, motion vectors, the deferred G-buffer and more. Added by DefaultPlugins when the feature is on; insert RenderDebugOverlayKeybindings { enable_keybindings: true, ..default() } to cycle modes with F1 and opacity with F2. |
infinite_grid::InfiniteGridPlugin | neo_dev_tools + render_dev_tools | A ground grid that fades with distance, with coloured axes. Spawn an InfiniteGrid. |
states::log_transitions::<S> | neo_dev_tools | A system that logs every transition of the state S. |
EasyScreenshotPlugin | neo_dev_tools + render_dev_tools | A key that saves a screenshot. |
The entity inspector#
An entity tree and component inspector built from the engine's UI exists behind the neo_inspector feature. NEO's Studio has its own Scene panel for this, which works with every NEO game without extra features; see Scene and objects and Play in the Studio.
Examples: cargo run --example fps_overlay --features neo_dev_tools,render_dev_tools, cargo run --example debug_picking --features neo_dev_tools, and cargo run --example infinite_grid --features neo_dev_tools,free_camera,render_dev_tools.