Debug Draw 3D (C#)

An asset by DmitriySalnikov
The page banner background of a mountain and forest
Debug Draw 3D (C#) thumbnail image
Debug Draw 3D (C#) thumbnail image
Debug Draw 3D (C#) hero image

Quick Information

0 ratings
Debug Draw 3D (C#) icon image
DmitriySalnikov
Debug Draw 3D (C#)

⚠No longer supported⚠This is a script that adds functionality for drawing debug shapes. Written in C#, so only Godot Mono supported. Works in the game and in the editor.For more info click on "View Files"

Supported Engine Version
3.3
Version String
1.1.3
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

README icon

Debug drawing utility

This is a debug drawing script, which you can setup as an autoload singleton. Written in C#, so only Godot Mono supported.

Inspired by Zilann's addon for the GDScript https://github.com/Zylann/godot_debug_draw

Donations

README ko-fi

README paypal

Features

Primitives:

  • Box
  • Sphere
  • Cylinder
  • Line
  • Line with Arrow
  • Line Path
  • Camera Frustum
  • Billboard opaque square
  • Position 3D (3 crossing axis)

Overlay:

  • Text (with grouping and coloring)
  • FPS Graph

No need to warry about removing or disabling functionality of this addon in export builds. Everything in this addon will be disabled automatically.

Usage

  1. Copy addons/debug_draw_cs to your addon folder, create it if the folder doesn't exist.
  2. Rebuild project.
  3. Add addons/debug_draw_cs/DebugDraw.cs to your project as autoload singleton.
  4. (Optionally) Enable the Debug Draw For Editor plugin to enable debug drawing support inside the editor.

Example (information about all public static functions and properties is present inside the script):

public override void _Process(float delta)
{
    var time = OS.GetTicksMsec() / 1000f;
    var box_pos = new Vector3(0, Mathf.Sin(time * 4f), 0);
    var line_begin = new Vector3(-1, Mathf.Sin(time * 4f), 0);
    var line_end = new Vector3(1, Mathf.Cos(time * 4f), 0);

    DebugDraw.DrawBox(box_pos, new Vector3(1, 2, 1), new Color(0, 1, 0), 0, false);
    DebugDraw.DrawLine3D(line_begin, line_end, new Color(1, 1, 0));
    DebugDraw.SetText("Time", time);
    DebugDraw.SetText("Frames drawn", Engine.GetFramesDrawn());
    DebugDraw.SetText("FPS", Engine.GetFramesPerSecond());
    DebugDraw.SetText("delta", delta);
}

README screenshot_3

If you see ERROR: _gl_debug_print: GL ERROR: Source: OpenGL Type: Error ID: 1281 Severity: High Message: GL_INVALID_VALUE error generated. Invalid offset and/or size., try increasing the value of rendering/limits/buffers/immediate_buffer_size_kb.

More screenshots

DebugDrawDemoScene.tscn in editor README screenshot_1

DebugDrawDemoScene.tscn in play mode README screenshot_2

⚠No longer supported⚠

This is a script that adds functionality for drawing debug shapes. Written in C#, so only Godot Mono supported. Works in the game and in the editor.

For more info click on "View Files"

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Debug Draw 3D (C#) icon image
DmitriySalnikov
Debug Draw 3D (C#)

⚠No longer supported⚠This is a script that adds functionality for drawing debug shapes. Written in C#, so only Godot Mono supported. Works in the game and in the editor.For more info click on "View Files"

Supported Engine Version
3.3
Version String
1.1.3
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers