Debug tools¶
See what the plugin sees: the rays, the radii and every value it works out, in the editor and in game.
In the editor¶
Select a SpatialAudioPlayer3D and the 3D viewport draws:
- Blue lines: the room rays, as far as they reach
- Purple lines: reflection bounces, in Fibonacci Sphere mode with
fibonacci_ray_reflectionsabove 0 - Red lines: rays that hit nothing (open air), or the ray to the camera when a wall blocks it
- Green line: the ray to the editor camera, when nothing blocks it
- Cyan sphere: the inner radius
- Orange sphere: the outer edge,
inner_radius + falloff_distance
Nothing needs turning on. The ray to the listener follows the editor camera, so you can fly around a wall and watch it turn red.
In game¶
Turn these on in the player's Debug group:
| Property | Shows |
|---|---|
debug_draw_rays |
The same coloured rays as in the editor |
debug_draw_radius |
The cyan and orange radius spheres |
debug_draw_playing_state |
A small sphere on the source: green when playing, yellow while a delayed sound is on its way, red when stopped |
display_debug_info |
The debug panel |
The debug panel¶
With display_debug_info on, a panel shows in the top left while you're in range of the sound, playing or not. It
updates ten times a second and goes away as soon as you turn display_debug_info off. It opens in a short view:
| Line | Shows |
|---|---|
| Status | Playing or stopped, indoor, semi-open or outdoor, and the frame rate. Says when effects are off |
| Distance | Distance to the listener. Marked routed when a navigation agent sets it from the route |
| Level | The current volume, with a level bar under the list |
| Walls | none, or how many walls are in the way and their materials. blocked for total absorption |
| Lowpass | The filter cutoff, from walls and corners together |
| Reverb | Room size and reverb level |
| Route | Only with a navigation agent: direct, the number of corners and the bend, or no route |
Press F3 or click More for the details:
| Section | Shows |
|---|---|
| Sound | Current and target volume and lowpass, the radii and which zone you're in, the curve, panning, air absorption, the bend filter and the audio bus |
| Walls | The wall cutoff, how much each wall blocks in dB, and the volume it takes off |
| Room | Current and target reverb level, size and damping, roughly how wide the room is, how open it is, and the average absorption with its low and high bands |
| Route | The agent, its state, the route length against the straight line, how far away the player sits, and the fill's cell count, cell size and time |
| Rays | Click to list every ray and how far it went |
The ray list shows open air as open, floor rays as floor, and the material each ray hit. In Fibonacci Sphere
mode with reflections, click a ray to see its bounces.
F3 switches every panel at once. With several players showing panels, they stack in one scrolling list.
Keys¶
While a panel shows:
| Key | Does |
|---|---|
| F1 | Turns this player's effects off and on (debug_toggle_effects_key) |
| F2 | Turns the rays and radius spheres off and on together (debug_toggle_shapes_key) |
| F3 | Shows or hides the details (debug_toggle_details_key) |
| F4 | Draws or hides the route, with a navigation agent (debug_toggle_route_key) |
| F5 | Draws or hides the agent's cells (debug_toggle_cells_key) |
The panel lists the keys under its details.
debug_accent_color sets the colour of the panel's accent bar, level bar and the line to the sound. To restyle the
panel itself, open debug/debug_panel.tscn in the editor. Each row is debug/debug_row.tscn.
In code¶
spatial_audio_debug sends the main values ten times a second while the panel is showing, so you can build your own
display:
func _ready():
$Radio.display_debug_info = true
$Radio.spatial_audio_debug.connect(_on_debug)
func _on_debug(info: Dictionary):
%Label.text = "%.1f m, %d walls" % [info.distance, info.wall_count]
The keys are listed in the Signals reference.
To switch every player's effects off from code, for a settings menu or a performance mode:
SpatialAudioPlayer3D.set_global_effects_disabled(true)