godotengine / godotengine/godot

Viewport debug draw modes remain partially effective in release export templates

Open
#88,772 0 comments 0 reactions 0 assignees View on GitHub
discussion topic:3d topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

- *Related to https://github.com/godotengine/godot-proposals/issues/6451.*

### Tested versions

- Reproducible in: 4.2.1.stable, 4.3.dev 8f0c20ee8

### System information

Godot v4.3.dev (8f0c20ee8) - Fedora Linux 39 (KDE Plasma) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 545.29.06) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

### Issue description

The left side shows the appearance of a given debug draw mode in an editor build, while the right side shows the same debug draw mode in a release export template build:

https://github.com/godotengine/godot/assets/180032/9659c557-be4d-466f-bfd0-b6a5fa5b7ea1

The following debug draw modes look different in editor and release builds:

- **Lighting** (2): Objects remain textured.
- **Overdraw** (3): Sky is black, but objects aren't made transparent.
- **Directional Shadow Splits** (14): Objects remain textured.

These are all debug draw modes that rely on globally overriding materials in the entire viewport with a shader generated in the engine on startup.

We should figure out what to do:

- Completely disable the partially-functional debug draw modes in release export templates, but leave other debug draw modes intact.
- Completely disable **all** debug draw modes in release export templates (this can reduce binary size a bit).
- Add support for all debug draw modes in release export templates by fixing those 3 debug draw modes.

### Steps to reproduce

- Set `get_viewport().debug_draw()` in a script to change the debug draw mode. Export the project with debugging disabled then run the project.

### Minimal reproduction project (MRP)

[test_debug_draw_modes.zip](https://github.com/godotengine/godot/files/14393989/test_debug_draw_modes.zip)
Movie Maker mode (`--write-movie out.avi`) can be used to generate a slice of the above video.

Contributor guide

Open the contributing guide

Research direction

Start with the attached minimal reproduction project and the get_viewport().debug_draw() entry point; compare editor and release export-template behavior for Lighting, Overdraw, and Directional Shadow Splits. Done means an agreed policy is implemented consistently—disable the affected modes, disable all modes, or support all three—and the reproduction no longer shows a partial effect.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.